mozilla / web-ext

A command line tool to help build, run, and test web extensions
Mozilla Public License 2.0
2.65k stars 334 forks source link

`web-ext sign` times out #3098

Closed paulrouget closed 3 months ago

paulrouget commented 4 months ago

Is this a feature request or a bug?

Bug. It started a few days ago.

What is the current behavior?

With --use-submission-api:

Waiting for Validation...
Fetching URL: https://addons.mozilla.org/api/v5/addons/upload/XXX/
Fetching URL: https://addons.mozilla.org/api/v5/addons/upload/XXX/
Fetching URL: https://addons.mozilla.org/api/v5/addons/upload/XXX/
Fetching URL: https://addons.mozilla.org/api/v5/addons/upload/XXX/
Building web extension from /tmp/mozilla-signing-tmp
Fetching URL: https://addons.mozilla.org/api/v5/addons/upload/
Waiting for Validation...Fetching URL: https://addons.mozilla.org/api/v5/addons/upload/XXX/
Fetching URL: https://addons.mozilla.org/api/v5/addons/upload/XXX/
[…]
Fetching URL: https://addons.mozilla.org/api/v5/addons/addon/XXX/
Fetching URL: https://addons.mozilla.org/api/v5/addons/addon/XXX/versions/?filter=all_with_unlisted
Waiting for Approval...
Fetching URL: https://addons.mozilla.org/api/v5/addons/addon/XXX/versions/XXX/
Fetching URL: https://addons.mozilla.org/api/v5/addons/addon/XXX/versions/XXX/
Fetching URL: https://addons.mozilla.org/api/v5/addons/addon/XXX/versions/XXX/
// this goes for a long time, and then

FAIL

WebExtError: Approval: timeout.
    at file:///Users/xxx/node_modules/web-ext/lib/cmd/sign.js:156:13
    at async Program.execute (file:///Users/xxx/node_modules/web-ext/lib/program.js:268:7)
    at async file:///Users/xxx/node_modules/web-ext/bin/web-ext.js:13:1

And without --use-submission-api, it times out as well.

$ node --version && npm --version && npx web-ext --version
v18.19.1
10.2.4
7.11.0
paulrouget commented 3 months ago

If anyone is running into a similar issue: even though web-ext times out, the XPI is actually available. You can probably go download it yourself, but if you use a CI, this is how I did it with https://github.com/mike-engel/jwt-cli and https://mozilla.github.io/addons-server/topics/api/index.html :


jwt=$(jwt encode --jti=0.$(( ( RANDOM % 1000000000 )  + 1 )) --exp=$(( $(date +%s) + 300 )) -i $api_key -S $api_secret)

curl "https://addons.mozilla.org/api/v5/addons/addon/XXX/" -H "Authorization: JWT $jwt" > /tmp/out.json
eval $(yq ".latest_unlisted_version.file.url" -o shell /tmp/out.json)
rm /tmp/out.json

jwt=$(jwt encode --jti=0.$(( ( RANDOM % 1000000000 )  + 1 )) --exp=$(( $(date +%s) + 300 )) -i $api_key -S $api_secret)
curl $value -H "Authorization: JWT $jwt" > out.xpi
paulrouget commented 3 months ago

Hm, I think I'm wrong. Firefox tells me this is not signed.

Rob--W commented 3 months ago

There is no guarantee of the signed file being available soon after submission. The documentation calls this out, at https://extensionworkshop.com/documentation/publish/signing-and-distribution-overview/#post-submission-review

It can take up to 24 hours for your submission to be signed and published, or longer if your submission is selected for manual review.

paulrouget commented 3 months ago

Understood.