Giter Site home page Giter Site logo

Comments (11)

ueno avatar ueno commented on July 24, 2024

if you see GPGME::Error you can always get more information by setting GPGME_DEBUG:

$ GPGME_DEBUG=9 irb
irb(main):001:0> require 'gpgme'
GPGME 2014-07-17 11:23:15 <0x11b8>  gpgme_debug: level=9
...

otherwise we can't isolate which ruby-gpgme or libgpgme is causing the issue.

from ruby-gpgme.

mlagas avatar mlagas commented on July 24, 2024

Thanks for the quick response @ueno, I will try to implement this on our server now and see for the error.

from ruby-gpgme.

mlagas avatar mlagas commented on July 24, 2024

Hi @ueno, how about debugging during run time on our controllers on a rails application? It's just weird that I tried to install it on a new rails application on an ec2 instance and worked fine, however when I tried to deploy it on our existing application it still gives me an InvalidValue error.

from ruby-gpgme.

mlagas avatar mlagas commented on July 24, 2024

In addition to my investigation, it's so weird that in may irb or rails console, it lists all the keys available when running GPGME::Key.find(:public), however during run time on my controller, I went inside the gem and added loggers and retrieves no keys.

from ruby-gpgme.

mlagas avatar mlagas commented on July 24, 2024

Hi @ueno I've found out that what's causing the issue are the permissions. Sorry for the questions raised. Thanks for your help.

from ruby-gpgme.

colto avatar colto commented on July 24, 2024

@mlagas I am running into the same things here, how did you change the permissions to fix your issue? This is driving me crazy.

from ruby-gpgme.

bbozo avatar bbozo commented on July 24, 2024

@colto @mlagas what did you do to fix the permissions???? :) production breaking, grr, help please :)

Adding GPGME_DEBUG=5 or 9 returns me a C segfault

from ruby-gpgme.

bbozo avatar bbozo commented on July 24, 2024

Thing is, I had to import the keys manually, for whatever reason they were not ending up in the keyring. And for the "name" use the name from the GPG cert that I saw once I did gpg --import key_path, then everything worked

Seriously irritated by GPG's stubborn insistence on the keyring and the way it behaves differently from host to host, from key to key

from ruby-gpgme.

bbozo avatar bbozo commented on July 24, 2024

Aaaand, I would like to take this moment to reiterate how much I hate GPG as a programming SDK facilitator, it literally never so far behaved the same on 2 different VMs for the purpose of solving the problem of "encrypt file with this key"

this time the issue was that the issues of the PGP key could not be confirmed by the web-of-trust thingy, whatever it is http://askubuntu.com/a/523228/468618

But... still not resolved :-/ this is the debug trace, showing both the successful local execution and the failed execution in production: https://gist.github.com/bbozo/3d8a7fd5f04babb3f08314f9b7d4e491

The production trace is with gpg (GnuPG) 1.4.20, the exactly same source code depending on gpg (GnuPG) 1.4.18 works on my dev box.

This command works on both boxes:

/usr/bin/gpg1  --output ./test_file.txt.pgp --encrypt --recipient dcapci test_file.txt

Any ideas what might be going wrong? :-/

from ruby-gpgme.

ueno avatar ueno commented on July 24, 2024

In https://gist.github.com/bbozo/3d8a7fd5f04babb3f08314f9b7d4e491, I see --homedir points to /home/webteh. That means gpg will look for the keys under /home/webteh, rather than /home/webteh/.gnupg. Is it intentional?

GPGME 2016-11-08 11:53:58 <0x7a25>    _gpgme_io_spawn: check: path=0x658f330, argv[ 3] = --homedir
GPGME 2016-11-08 11:53:58 <0x7a25> _gpgme_io_spawn: check: path=0x658f330, argv[ 4] = /home/webteh

from ruby-gpgme.

bbozo avatar bbozo commented on July 24, 2024

@ueno wowwww, that solved it, set_engine parameter homedir is homedir of GnuPG, not of the user ^_^ thank you very very much, I am in your debt dear sir

EDIT: you need to set an env var such as GNUPGHOME=/home/user/.gnupg

from ruby-gpgme.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.