# Error upload file to apt hosted repository

**URL:** <https://community.sonatype.com/t/error-upload-file-to-apt-hosted-repository/4612>\
**Category:** Sonatype Nexus Repository\
**Tags:** nexus-repository\
**Created:** [July 13, 2020, 1:52pm UTC](https://community.sonatype.com/t/error-upload-file-to-apt-hosted-repository/4612 "2020-07-13T13:52:38Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![aornatovskyy](https://avatars.discourse-cdn.com/v4/letter/a/34f0e0/32.png) [@aornatovskyy](https://community.sonatype.com/u/aornatovskyy)\
**Post date:** [July 13, 2020, 9:44pm UTC](https://community.sonatype.com/t/error-upload-file-to-apt-hosted-repository/4612/2 "2020-07-13T21:44:22Z")

</div>

> [@bezpalko1987](#):
>
> java.io.IOException: unknown object in stream: 19

Hi Pavel,  
Most likely you have an issue with GPG key.

1. Next instruction will help you to generate new GPG key in the Docker. Also, you can do it on the Debian machine if you don’t have Docker.

> docker run -v /Users/\<USER\_NAME\>/share\_folder/:/root/share -it ubuntu  
> apt-get update  
> apt-get install gpg  
> gpg --gen-key  
> gpg --list-keys  
> cd /root/share  
> gpg --armor --output public.gpg.key --export 315F58C16D58E682E39A816AD7  
> gpg --armor --output private.gpg.key --export-secret-key 315F58C16D58E682E39A816AD7

1. Be sure you are using private key not public in the Nexus repository settings.
2. Important thing is to copy private key with all headers, next lines. If something in the document will be changed, GPG key becomes broken.
3. If nothing help, I can share with you my temporary created GPG just for testing.

Good luck!

---

_[View the full topic](https://community.sonatype.com/t/error-upload-file-to-apt-hosted-repository/4612)._
