Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Private key not found in the argument. Please provide a valid key. #2670

Closed
YoavGro opened this issue Dec 3, 2024 · 4 comments
Closed

Comments

@YoavGro
Copy link

YoavGro commented Dec 3, 2024

Description of the problem

Using sparkle in Github actions, copied the private key to the secrets.
Using this to copy the private key to a file

  echo "$SPARKLE_PRIVATE_KEY" > sparkle_private_key
  echo -n "$SPARKLE_PRIVATE_KEY" > ./Sparkle/sparkle_private_key

And using this to update the appcast with a new item

      ./Sparkle/generate_appcast \
          --ed-key-file Sparkle/sparkle_private_key \
          --phased-rollout-interval 86400 \
          -o Sparkle/appcast.xml \
          artifacts/<appName>

Getting this error
"Error: Private key not found in the argument. Please provide a valid key."

Do you use Sandboxing in your app? No

Version of Sparkle.framework in the latest version of your app

I'm currently using a hardcopy of the generate_appcast file from my latest build

Version of Sparkle.framework in the old version of app that your users have (or N/A)

Sparkle's output from Console.app


Steps to reproduce the behavior

[The more information provided and pasted verbatim, the easier it will be to diagnose an issue. If you can provide the affected application/binary and XML feed to reproduce an issue, share them]

@zorgiepoo
Copy link
Member

zorgiepoo commented Dec 4, 2024

generate_appcast doesn't think the key is a valid base64 encoded string. Please check the contents of the file.

The error message is a bit misleading which I suppose we can use this issue for improving.

If you can it's better to pass the key via standard input (this is taken from generate_appcast's help page for the --ed-key-file option):

echo "$SPARKLE_PRIVATE_KEY" | ./Sparkle/generate_appcast --ed-key-file - --phased-rollout-interval 86400 -o Sparkle/appcast.xml artifacts/<appName>

@YoavGro
Copy link
Author

YoavGro commented Dec 4, 2024

Do I need to base 64 encode the key in the secrets?

@zorgiepoo
Copy link
Member

zorgiepoo commented Dec 4, 2024

If you're getting the private key from exporting via generate_keys -x it should already be base64 encoded. I think the tools always deal with reading/storing a base64 encoded representation, so I would check the contents of the key..

@zorgiepoo
Copy link
Member

Clarified error message better in #2675, nothing else actionable here otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants