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

Public key was provided but there is no JWT signature within app bundle to verify #64

Open
tolutronics opened this issue Oct 27, 2021 · 17 comments

Comments

@tolutronics
Copy link

E/Capacitor/Console: File: http://localhost/vendor.js - Line 131045 - Msg: [CodePush] Error! Public key was provided but there is no JWT signature within app bundle to verify. Possible reasons, why that might happen:
1. You've been released CodePush bundle update using version of CodePush CLI that is not support code signing.
2. You've been released CodePush bundle update without providing --privateKeyPath option.. StackTrace: Error: Error! Public key was provided but there is no JWT signature within app bundle to verify. Possible reasons, why that might happen:
1. You've been released CodePush bundle update using version of CodePush CLI that is not support code signing.
2. You've been released CodePush bundle update without providing --privateKeyPath option.
at verify (http://localhost/vendor.js:131531:32)
at http://localhost/vendor.js:131573:21
at LocalPackage. (http://localhost/vendor.js:131592:17)
at Generator.next ()
at fulfilled (http://localhost/vendor.js:131438:58)
at ZoneDelegate.invoke (http://localhost/polyfills.js:436:30)
at Zone.run (http://localhost/polyfills.js:196:47)
at http://localhost/polyfills.js:1354:38
at ZoneDelegate.invokeTask (http://localhost/polyfills.js:470:35)
at Zone.runTask (http://localhost/polyfills.js:241:51)

NOTE, I am using the latest appcenter-cli
I also provided a private key path

@tolutronics
Copy link
Author

Is anyone else having this issue?

@alexcroox
Copy link

alexcroox commented Oct 29, 2021

I have the same issue, occurs after:

[CodePush] Installing update
[CodePush] Applying full update

I release with the following:

appcenter codepush release --target-binary-version '^1' --app FarmTo/farmto-ios-sandbox --update-contents-path ./ios/App/App/public/ --private-key-path '/Users/alex/Documents/Keys/farmto-app/codepush-keys/private.pem' --deployment-name Production

And my capacitor config looks correct:

image

image

@alexcroox
Copy link

I've also noticed the docs and the error feedback reference --privateKeyPath but if you use that with codepush cli you get the error;

"Unknown argument --privateKeyPath" so consulting the docs https://docs.microsoft.com/en-gb/appcenter/distribution/codepush/cli#releasing-updates-general I used --private-key-path and it stopped complaining

@alexcroox
Copy link

Others in the react-native repo are having issues with this recently, wonder if related microsoft/react-native-code-push#2141

@alexcroox
Copy link

The workaround for me is to not sign the release and remove the IOS_PUBLIC_KEY entry

@tolutronics
Copy link
Author

@alexcroox Do you get the signing working for android?

@tolutronics
Copy link
Author

I've also noticed the docs and the error feedback reference --privateKeyPath but if you use that with codepush cli you get the error;

"Unknown argument --privateKeyPath" so consulting the docs https://docs.microsoft.com/en-gb/appcenter/distribution/codepush/cli#releasing-updates-general I used --private-key-path and it stopped complaining

yes, that flag does not work but instead "-k" works

@tolutronics
Copy link
Author

This issue is a serious one, that needs urgent attention

@veneliniliev
Copy link

i have the same problem :(

@Dwimcore
Copy link

Same here

@LouiMinister
Copy link

Same here too

@veneliniliev
Copy link

The workaround for me is to not sign the release and remove the IOS_PUBLIC_KEY entry

@LouiMinister use this for now. its working for me.

@LouiMinister
Copy link

LouiMinister commented Dec 16, 2021

@veneliniliev After applied your advice, JWT ERROR was solved but other error has occurred on xcode.

{"data":"OK","status":200,"url":"https://codepush.appcenter.ms/v0.1/public/codepush/report_status/download","headers":{"Content-Length":"2","access-control-allow-methods":"POST","request-context":"appId=cid-v1:4116a8f2-fe3b-4636-b7b9-91c8df94c88d","
ERROR MESSAGE: {"message":"The file “hotcodepush.json” couldn’t be opened because there is no such file.","errorMessage":"The file “hotcodepush.json” couldn’t be opened because there is no such file."}
⚡️ [error] - {"message":"The file “hotcodepush.json” couldn’t be opened because there is no such file.","errorMessage":"The file “hotcodepush.json” couldn’t be opened because there is no such file."}
⚡️ To Native -> CodePush getPublicKey 127958629
⚡️ [log] - [CodePush] Applying full update
ERROR MESSAGE: {"message":"The file “.codepushrelease” couldn’t be opened because there is no such file.","errorMessage":"The file “.codepushrelease” couldn’t be opened because there is no such file."}
⚡️ [error] - {"message":"The file “.codepushrelease” couldn’t be opened because there is no such file.","errorMessage":"The file “.codepushrelease” couldn’t be opened because there is no such file."}
⚡️ To Native -> CodePush getAppVersion 127958632
⚡️ To Native -> CodePush getBinaryHash 127958633
⚡️ To Native -> CodePush isPendingUpdate 127958634
⚡️ To Native -> CodePush getNativeBuildTime 127958636
⚡️ To Native -> CodePush getAppVersion 127958637
⚡️ TO JS {"uri":"file:///var/mobile/Containers/Data/Application/DF8D00C6-0C29-4649-B70D-76F19A14546C/Documents/codepush/currentPackage.json"}
⚡️ To Native -> CodePush preInstall 127958639
⚡️ [error] - [CodePush] Preinstall failure. Could not find start page in package.. StackTrace: CapacitorException@capacitor://localhost/vendor.js:105239:14
⚡️ [error] - [CodePush] An error has occured while installing the package. Could not find start page in package.. StackTrace: preInstallFailure@capacitor://localhost/vendor.js:172081:46
⚡️ [error] - [CodePush] An error occurred during sync. An error has occured while installing the package. Could not find start page in package.. StackTrace: preInstallFailure@capacitor://localhost/vendor.js:172081:46

Do you know about this?
I think it is related with #21
Thx for your comment.

@veneliniliev
Copy link

veneliniliev commented Dec 16, 2021

@LouiMinister try with --update-contents-path ./www/
my project is angular/ionic based and build path is www/ in root folder

@LouiMinister
Copy link

@veneliniliev It works when I use -c ./ios/App/App/public on ios codepush.
Thanks for your hint.

@bazuka5801
Copy link

@tolutronics AppCenter React Native CodePush is good replacement, but look at these lines of code:
https://github.com/microsoft/appcenter-cli/blob/f4f9b8f5d2dd0d3988977ed6efa412e3320ff141/src/commands/codepush/lib/codepush-release-command-base.ts#L114-L123

appcenter-cli will zip www to CodePush folder ignoring -c ios/app/app/public argument

I modified this cli (ignoring the lines above), you can install it with yarn global add @bazumax/appcenter-cli (after removing the original appcenter-cli)

This works as expected with signing of build

@samicston
Copy link

@tolutronics your solution did not work for me or am i missing something?

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

7 participants