flathub / com.visualstudio.code.oss

https://flathub.org/apps/details/com.visualstudio.code.oss
GNU Affero General Public License v3.0
47 stars 12 forks source link

Can't use gpg build in on vscode terminal. #12

Closed ghost closed 6 years ago

ghost commented 6 years ago

Environment

Operation System Desktop Environment Flatpak
Fedora 28 Gnome 3.28.2 0.99.3

Running commit git commit -S -m result on error message

error: gpg failed to sign the data
fatal: failed to write commit object

After testing if gpg running really well with echo "test" | gpg --clearsign result on error message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

test
gpg: signing failed: No pinentry
gpg: [stdin]: clear-sign failed: No pinentry

Remark

Before update i can use gpg and sign commit really fine. But after getting latest update yesterday there was an error.

amtlib-dot-dll commented 6 years ago

I've upgraded the base runtime from org.freedesktop.Sdk//1.6 to org.freedesktop.Sdk//18.08, and probably those maintainers removed pinentry from the latest runtime. I'll roll back the recipe.


The reason why they removed pinentry might probably be flatpak/freedesktop-sdk-images#70

ghost commented 6 years ago

Getting latest update above 30min ago still no luck

sh-4.3$ echo "test" | gpg --clearsign
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

test
gpg: signing failed: Provided object is too short
gpg: [stdin]: clearsign failed: Provided object is too short
amtlib-dot-dll commented 6 years ago

After some investigation I only discovered that I cannot clearsign due to no available key and I cannot generate my key because Provided object is too short. The gpg command and the gpg2 command inside the sandbox both have the version 2.1.14-unknown so they are the same executable. The recipe used to build the current build is similar to the one without problem https://github.com/flathub/com.visualstudio.code.oss/compare/ca56e4206a72edacb11aa93b664ed3e2ec0ac4e1...master. I'm not familiar with GnuPG and if you have any new discoveries please tell me thanks.

ghost commented 6 years ago

No after googling everything out no luck... Don't really know what is the root cause.

amtlib-dot-dll commented 6 years ago

I made a new commit ebf87fe5c7c75bab51be7aa22e1de5a1e4471863 to exactly match the working revision ca56e4206a72edacb11aa93b664ed3e2ec0ac4e1, and please give us feedback whether it runs or not @vibolvireak Thanks!

ghost commented 6 years ago

@amtlib-dot-dll still the same result..

amtlib-dot-dll commented 6 years ago

@vibolvireak Thus, may you generate a clear new ~/.gnupg directory and repeat the test? If the problem still exists, the base runtime may be to blame.

ghost commented 6 years ago

event do everything event you try generate a new one

amtlib-dot-dll commented 6 years ago

flatpak/freedesktop-sdk-images#114 This may probably help :man_shrugging:

ghost commented 6 years ago

@amtlib-dot-dll After got today update from freedesktop flatpak. I got it working but at lease try to gen key first and everything will work normally event i use the old key. Hope this help if everything experience my issue.

amtlib-dot-dll commented 6 years ago

Still I want to upgrade the base runtime to use a newer version of toolchains (GCC 8, GDB 8, Clang 6 and Python 3.7) but pinentry is missing there. I am wondering whether I should embed it inside the recipe or wait for some news from the runtime developers. BTW, congratulations for the solved problem

amtlib-dot-dll commented 6 years ago

@vibolvireak According to your understanding, is it possible for the git client inside the sandbox to use the GPG Agent outside in the host system? Thanks

ghost commented 6 years ago

@amtlib-dot-dll I'm sorry if i maybe wrong but.. i think the problem is i resize the terminal in vscode really small so when start using gpg will alert

error: gpg failed to sign the data
fatal: failed to write commit object

if i use the default height size or increase the high size of the terminal will successfully use gpg below is the explaination via screenshot

screenshot from 2018-08-24 12-06-36 screenshot from 2018-08-24 12-07-21

Remark I think if the terminal height is too short it can't fit the password box.

amtlib-dot-dll commented 6 years ago

@vibolvireak

  1. Do you have this problem before this issue? That is, can you correctly type in your password one week ago?
  2. Do you have a running gpg-agent outside in your host system?
ghost commented 6 years ago

@amtlib-dot-dll Before i never experience the problem I don't really sure that the problem is cause with the size of the terminal or not but .. before just working really fine as i remember event i try to resize the terminal. Question 2 i don't really sure if have gpg-agent outside my system or not.

amtlib-dot-dll commented 6 years ago

That's weird. Well I think that embedding it inside this package is a good option

amtlib-dot-dll commented 5 years ago

@vibolvireak I'd like to upgrade the base runtime again; are you still using pinentry now?

ghost commented 5 years ago

@amtlib-dot-dll everything work as expect event upgrade to the new runtime... But everytime i wan to use gpg i need to type "export GPG_TTY=$(tty)" every time do you have any workround ?

amtlib-dot-dll commented 5 years ago

@vibolvireak I don't understand your English. Can you write your question in your native language? Thence I can use Google Translate to help me.

ghost commented 5 years ago

@amtlib-dot-dll Yes everything working fine.. You can close this issue!