Error signing code of Conduct

Asked by JL on 2018-05-23

I followed the instructions:

"Sign the Ubuntu code of Conduct

To sign the code of conduct:

    Download the file to your own computer and read it carefully to ensure you agree to it.
    In a terminal, run the command:

        gpg --clearsign UbuntuCodeofConduct-2.0.txt

    (or whatever filename you gave to the code). This will create a file with a name like UbuntuCodeofConduct-2.0.txt.asc."

 and recieved the message:

"xyz@xyz-HP-Pavilion-Sleekbook-15:~$ gpg --clearsign UbuntuCodeofConduct-2.0.txt
gpg: no default secret key: secret key not available
gpg: UbuntuCodeofConduct-2.0.txt: clearsign failed: secret key not available"

(I have OpenPGP keys.)
Do I need something more or are there other problem? Do I need SSH keys too?

Question information

Language:
English Edit question
Status:
Solved
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Solved by:
JL
Solved:
2018-08-15
Last query:
2018-08-15
Last reply:
2018-07-08
Manfred Hampl (m-hampl) said : #3

There are several different steps involved, among other creating the key and uploading it to Launchpad, but also signing the UbuntuCodeofConduct-2.0.txt file with your key.

The error message "gpg: no default secret key: secret key not available" seems to indicate, that the "gpg ..." command did not know which signature to use and so the step of signing the file failed.

What output do you receive for the command
gpg --default-key 286DB6BC --clearsign UbuntuCodeofConduct-2.0.txt
or for the command
GPGKEY=286DB6BC gpg --clearsign UbuntuCodeofConduct-2.0.txt

JL (jl2414) said : #4

Here is the output:

gpg --default-key 286DB6BC --clearsign UbuntuCodeofConduct-2.0.txt
gpg: no default secret key: secret key not available
gpg: UbuntuCodeofConduct-2.0.txt: clearsign failed: secret key not available

GPGKEY=286DB6BC gpg --clearsign UbuntuCodeofConduct-2.0.txt
gpg: no default secret key: secret key not available
gpg: UbuntuCodeofConduct-2.0.txt: clearsign failed: secret key not available

On my User info overview it appears that I have a OpenPGP key, that’s what makes me confused.

Thanks again...

Manfred Hampl (m-hampl) said : #5

You have to differentiate between your local system and the launchpad servers.

You need your key information (including the secret key) locally to be able to sign a file.
The launchpad servers need the public part of your key to be able to verify the contents.

It seems that the public key has successfully been uploaded to Launchpad.

The error message about signing the CoC file is something happening locally on your machine.
Apparently you have not stored your secret key in the default keyring which is used during "gpg …" activities.

If you list the keys in your key store with the commands
gpg --list-keys
and
gpg --list-secret-keys
do you see your cryptographic key being listed (no need to copy/paste the output)?

JL (jl2414) said : #6

Thank you very much,

When I run the:
gpg --list-keys
and
gpg --list-secret-keys
commands in the Terminal there are no output what so ever. Makes me confused, because I have 2 keys.

I run Ubuntu 16.04 on my conmputer and I keep my GnuPG keys:
Passwords and Keys: GnuPG keys (holdig the pointer over it shows: GnuPG: default keyring directory)

I just tried to import another OpenPGP key into Launchpad, but with the same result.

Runned the command:
gpg --clearsign UbuntuCodeofConduct-2.0.txt

Output:
gpg: no default secret key: secret key not available
gpg: UbuntuCodeofConduct-2.0.txt: clearsign failed: secret key not available

I still don't know what's missing...

Thank again you for your help.

Manfred Hampl (m-hampl) said : #7

The cause for your problem seems to be that your gpg key is not stored in the standard keyring file.

How did you create your GPG key?

Did you delete the .gnupg subdirectory of your home directory (where the default keyring should be stored)?

JL (jl2414) said : #8

I'm unfamiliar with the commands using Terminal, so I use the graphical input. I used "Passwords and Keys" and then GnuPG keys, were I created two keys. One for email and another for Launchpad.

If I delete all the GPG keys, then when creating new ones it should create a new .gnupg subdirectory if it were deleted, right?

JL (jl2414) said : #9

I don’t think I deleted the .gnupg subdirectory of my home directory.

Launchpad Janitor (janitor) said : #10

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

JL (jl2414) said : #11

If I delete the .gnupg subdirectory of my home directory. (I don’t know how to check.)
If so, is it possible to create a new one? How do I proceed?

Or is it easier and would it result if I format the computer and recover my GPG key or even created new GPG keys?

What is best to do?

I actually just need to sign the "Ubuntu Code of Conduct".
Is here a short-cut?

Manfred Hampl (m-hampl) said : #12

I assume the easiest is just restarting the signing process.

Follow https://help.ubuntu.com/community/GnuPrivacyGuardHowto as far as applicable (create a new key …)

JL (jl2414) said : #13

Dear mr Manfred Hampl,

I just created a new GPP key, uploaded it to the server, validated it through my email and also on Launchpad, downloaded the Code of conduct 2.0 to (by default to) 'Downloads', run the command

gpg --clearsign UbuntuCodeofConduct-2.0.txt

in the Terminal and still got the message:

gpg: can't open 'UbuntuCodeofConduct-2.0.txt': No such file or directory
gpg: UbuntuCodeofConduct-2.0.txt: clear-sign failed: No such file or directory

I think the problem must be the location where the Code of Conduct is saved.
Because I have a new GPG key registered, because of the message that show up at the signing steps:

It appears you have already done this. The key XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX is registered on your account. You can skip to the next step if you are not intending on signing with a different key.

(This is the most recent key I registered.)

Conclusion:
I think the problem must be the location where the Code of Conduct is saved, and the command

gpg --clearsign UbuntuCodeofConduct-2.0.txt

don't know where to find it. ;D

What do you think?

JL (jl2414) said : #15

I run the command in Terminal:

gpg --list-secret-keys

and it listed all the three secret keys for the above listed keys.

JL (jl2414) said : #16

Problem solved.

YES!!!

The problem was that the downloaded Code of conduct was downloaded to 'Downloads' and not to '/home' where, by default, the command

gpg --clearsign UbuntuCodeofConduct-2.0.txt

look for the UbuntuCodeofConduct-2.0.txt file and create the new UbuntuCodeofConduct-2.0.txt.asc file

Thank you very much for your patience and all your help and efforts to do your outermost to help me.

Mission accomplished!

Again,
Thanks a lot!