Skip to content
This repository has been archived by the owner on Nov 27, 2019. It is now read-only.

jpm sign --xpi errors with EACCES (needs a better error messaage) #600

Open
lukeis opened this issue Oct 18, 2016 · 10 comments
Open

jpm sign --xpi errors with EACCES (needs a better error messaage) #600

lukeis opened this issue Oct 18, 2016 · 10 comments

Comments

@lukeis
Copy link

lukeis commented Oct 18, 2016

node -v 6.2.1
OSX El Capitan 10.11.6
jpm 1.2.2

jpm sign --api-key $AMO_API_KEY --api-secret $AMO_API_SECRET --xpi build/javascript/firefox-driver/webdriver.xpi

JPM [error] FAIL
Error: EACCES: permission denied, stat '/var/folders/r8/3v1w2db52gx3gjbs393990_910gc7h/T/tmp-extracted-xpi-38176wELUXG21544k/platform/WINNT_x86-msvc'
at Error (native)

The folder in question here doesn't exist. I am also not out of disk space :)

Also tried specifying the browser to nightly, but get the same result:

jpm -b /Applications/FirefoxNightly.app/Contents/MacOS/firefox  sign --api-key $AMO_API_KEY --api-secret $AMO_API_SECRET --xpi build/javascript/firefox-driver/webdriver.xpi

xpi used: https://gus.my.salesforce.com/sfc/p/T0000000Dpvc/a/B00000000Kjp/K_.glcjeykbIdZem4taMpcBUFwwNnyxH3TyP88UqDGs
Attached: webdriver.xpi.zip

(can also be generated from https://github.com/SeleniumHQ/selenium using the command ./go //javascript/firefox-driver:webdriver )

Any other information I can provide please let me know.

@andreicristianpetcu
Copy link

I get the same issue. On Ubuntu 16.04 with your file.

@kumar303
Copy link
Contributor

Thanks for providing the XPI. I can reproduce it too.

I swear I've seen a report of this before but can't dig up the issue. Last time it was caused by a bug in https://github.com/jsantell/node-zip-dir (I think).

There's something in the add-on triggering an error when it tries to deflate the XPI to a temp directory (which gets removed after the error). I don't see anything obvious at a glance so it will require some Node debug spelunking to track it down.

@kumar303
Copy link
Contributor

Well, it would more likely be something happening in decompress-zip. It looks like our version is up to date.

@andreicristianpetcu
Copy link

andreicristianpetcu commented Oct 19, 2016

There is something completly broken with the zip file. What program did you use to archive it? I paused while extracting and took a look at the generated files in /tmp. They all look messed up.

ls -la /tmp/tmp-extracted-xpi-21882DP4QSEbwh5sK/platform                                                                                                 ls: cannot access '/tmp/tmp-extracted-xpi-21882DP4QSEbwh5sK/platform/.': Permission denied
ls: cannot access '/tmp/tmp-extracted-xpi-21882DP4QSEbwh5sK/platform/..': Permission denied
total 0
d????????? ? ? ? ?            ? .
d????????? ? ? ? ?            ? ..

I extracted all the files and made a new xpi from them. I used the default file extractor from Gnome Shell in Nautilus. I changed the install.rdf since it said that the addon is not mine but besides this it is the same. Now it fails with this:

JPM [info] Signing XPI: dir_webdriver.xpi
Validating add-on [.................................................................................................................................................................................................]
JPM [error] FAIL
Error: Validation took too long to complete; last status: {"guid":"{65C3BB66-94B0-11E6-B331-D1BEC6AD2208}","active":false,"automated_signing":true,"url":"https://addons.mozilla.org/api/v3/addons/%7B65C3BB66-94B0-11E6-B331-D1BEC6AD2208%7D/versions/3.0.0/uploads/207005e017824b0793cf27f4666bcb7c/","files":[],"passed_review":false,"pk":"207005e017824b0793cf27f4666bcb7c","processed":true,"reviewed":false,"valid":true,"validation_results":{"errors":0,"success":false,"warnings":283,"compatibility_summary":{"notices":0,"errors":0,"warnings":0},"passed_auto_val...
    at Timeout._onTimeout (/home/andrei/.ndenv/versions/v6.3.1/lib/node_modules/jpm/node_modules/sign-addon/dist/webpack:/src/amo-client.js:222:16)
    at tryOnTimeout (timers.js:228:11)
    at Timer.listOnTimeout (timers.js:202:5)

@andreicristianpetcu
Copy link

HA! I signed it @lukeis . After extracting the files from the archive and after I put them back as I said in the previous comment I put this content inside install.rdf. Here is the signed archive :D.

<?xml version="1.0"?>
<RDF:RDF xmlns:em="http://www.mozilla.org/2004/em-rdf#"
         xmlns:NC="http://home.netscape.com/NC-rdf#"
         xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <RDF:Description RDF:about="rdf:#$VB9S51"
                   em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
                   em:minVersion="3.0"
                   em:maxVersion="*" />
  <Description RDF:about="urn:mozilla:install-manifest"
                   em:id="{5AB8F5AC-9644-11E6-89DF-D9D3C6AD2208}"
                   em:name="Firefox WebDriver"
                   em:version="3.0.0"
                   em:description="WebDriver implementation for Firefox"
                   em:creator="andreicristianpetcu@github.com">
    <em:targetApplication RDF:resource="rdf:#$VB9S51"/>

    <em:targetPlatform>Darwin</em:targetPlatform>
    <em:targetPlatform>SunOS</em:targetPlatform>
    <em:targetPlatform>FreeBSD</em:targetPlatform>
    <em:targetPlatform>OpenBSD</em:targetPlatform>
    <em:targetPlatform>WINNT</em:targetPlatform>
    <em:targetPlatform>Linux</em:targetPlatform>

  <em:type>2</em:type>
  </Description>
</RDF:RDF>

@kumar303
Copy link
Contributor

So the zip file was corrupt? Should we close the issue? It would be nice if the error message made this a bit more clear.

@andreicristianpetcu
Copy link

Actually I don't think it was corrupt since I could extract it in Nautilus and archive it again. Probably there is a bug in decompress-zip or an unsupported feature. Not a jpm issue anyway.

Better logging in jpm would be really nice. At least a stack trace.

@lukeis
Copy link
Author

lukeis commented Oct 20, 2016

@andreicristianpetcu i can't find anything corrupt about the zip archive. When I do an unzip webdriver.xpi, everything inflates correctly, and I get:

ls -l platform/WINNT_x86-msvc/components/
total 16
-rw-r--r--  1 linman  SFDC\Domain Users  8192 Oct 18 22:08 imehandler.dll

Will log a bug with the decompress-zip library. Error message displayed by jpm is just that of the decompress library. Would be nice to have a clear error message, but I won't leave this open for that.

@lukeis lukeis closed this as completed Oct 20, 2016
@lukeis
Copy link
Author

lukeis commented Oct 20, 2016

would like to note that project appears dead-ish. no commits since april? Might need to change zip libraries... but in my initial search there's dozens and I would have no idea which to pick (arg... node community! :) )

@kumar303
Copy link
Contributor

Yeah, maybe a different library will provide us with a better error message. I'm attaching the XPI to this issue so it doesn't get lost:
webdriver.xpi.zip

I'd like to see a less confusing error message for this so I'm re-opening the issue. It won't be high priority but maybe someone will have time to fix it.

@kumar303 kumar303 reopened this Oct 20, 2016
@kumar303 kumar303 changed the title jpm sign errors with EACCES jpm sign --xpi errors with EACCES (needs a better error messaage) Oct 20, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants