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

Firefox not starting with web-ext run #1607

Closed
baptx opened this issue May 9, 2019 · 9 comments
Closed

Firefox not starting with web-ext run #1607

baptx opened this issue May 9, 2019 · 9 comments

Comments

@baptx
Copy link

baptx commented May 9, 2019

Is this a feature request or a bug?

Bug

What is the current behavior?

Firefox does not start with the command "web-ext run":

user@dell:~/Downloads/borderify$ web-ext run -v                                                                                                                                             
[program.js][info] Version: 3.0.0                                                                                                                                                             
[program.js][debug] Getting the version from package.json                                                                                                                                     
[program.js][debug] Discovering config files. Set --no-config-discovery to disable
[config.js][debug] Discovered config "/home/user/.web-ext-config.js" does not exist or is not readable
[config.js][debug] Discovered config "/home/user/Downloads/borderify/web-ext-config.js" does not exist or is not readable
[config.js][debug] Discovered config "/home/user/Downloads/borderify/package.json" does not exist or is not readable
[cmd/run.js][info] Running web extension from /home/user/Downloads/borderify
[util/manifest.js][debug] Validating manifest at /home/user/Downloads/borderify/manifest.json
[extension-runners/firefox-desktop.js][debug] Creating new Firefox profile
[firefox/index.js][debug] Running Firefox with profile at /tmp/0a45836a-01b3-479d-8589-3c2e44137fa0
[firefox/index.js][debug] Checking if remote Firefox port 6005 is available
[firefox/remote.js][debug] Connecting to Firefox on port 6005

On my current Linux desktop, the default Node.js version is 8.11.4 and default Firefox version is 66.0.4 so I also tried with Node.js 10.15.3 and latest Firefox Developer Edition 67.0b18:

user@dell:~/Downloads/borderify$ ~/Downloads/node-v10.15.3-linux-x64/bin/node /usr/local/bin/web-ext run -f ~/Downloads/firefox/firefox -v
[program.js][info] Version: 3.0.0
[program.js][debug] Getting the version from package.json
[program.js][debug] Discovering config files. Set --no-config-discovery to disable
[config.js][debug] Discovered config "/home/user/.web-ext-config.js" does not exist or is not readable
[config.js][debug] Discovered config "/home/user/Downloads/borderify/package.json" does not exist or is not readable
[config.js][debug] Discovered config "/home/user/Downloads/borderify/web-ext-config.js" does not exist or is not readable
[cmd/run.js][info] Running web extension from /home/user/Downloads/borderify
[util/manifest.js][debug] Validating manifest at /home/user/Downloads/borderify/manifest.json
[extension-runners/firefox-desktop.js][debug] Creating new Firefox profile
[firefox/index.js][debug] Running Firefox with profile at /tmp/b045aa1b-3449-4fb5-98ec-d482e16fd5ae
[firefox/index.js][debug] Checking if remote Firefox port 6005 is available
[firefox/remote.js][debug] Connecting to Firefox on port 6005

What is the expected or desired behavior?

Firefox should start and use the web extension example "borderify" (https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension).

Version information (for bug reports)

  • Firefox version: 66.0.4
  • Your OS and version: Lubuntu 18.10
  • Paste the output of these commands:
user@dell:~/Downloads/borderify$ node --version && npm --version && web-ext --version
v8.11.4
5.8.0
3.0.0
@baptx baptx changed the title firefox not starting with web-ext run Firefox not starting with web-ext run May 9, 2019
@Rob--W
Copy link
Member

Rob--W commented May 9, 2019

Is that the full log? Or are the last lines repeating, like #1509 ?

What is the output of netstat -tunalp | grep 6005 before you run web-ext run?

At first, the output should be empty (indicating that nothing is using port 6005).

While web-ext run is active, the output should be:

tcp        0      0 127.0.0.1:6005          0.0.0.0:*               LISTEN      11111/firefox       
tcp        0      0 127.0.0.1:41736         127.0.0.1:6005          ESTABLISHED 11100/node          
tcp        0      0 127.0.0.1:6005          127.0.0.1:41736         ESTABLISHED 11111/firefox       

@baptx
Copy link
Author

baptx commented May 10, 2019

Hi, it is the full log, lines are not repeating and I have to press Ctrl+C since nothing happens after more than 10 seconds.
Before running web-ext run, the output of netstat -tunalp | grep 6005 is empty.
Here is what it looks like while web-ext run is active:

user@dell:~$ sudo netstat -tunalp | grep 6005
tcp        0      1 10.0.0.104:58342        27.0.0.1:6005           SYN_SENT    5561/node           
user@dell:~$

@Rob--W
Copy link
Member

Rob--W commented May 13, 2019

Based on the above netstat output (that shows that node attempts to connect) and the observation that the last log is:

[firefox/index.js][debug] Checking if remote Firefox port 6005 is available
[firefox/remote.js][debug] Connecting to Firefox on port 6005

... it seems that the connection does unexpectedly not get refused even though there is nothing that listens to the port. Is your firewall configured to silently drop packets to destinations without listeners?

In any case, this bug would disappear if we fix #1509 and stop trying to check the validity of the port.

@baptx
Copy link
Author

baptx commented May 13, 2019

Before testing, I disabled my firewall rules with iptables -F and also disabled my VPN. So I don't think it can be a firewall issue. Or could it come from my Internet router?
By the way, is it normal that there is an error with web-ext run if I am disconnected from my local network? I guess web-ext run should work without Internet connection.

Here is the output:

user@dell:~/Downloads/borderify$ web-ext run -v  
[program.js][info] Version: 3.0.0
[program.js][debug] Getting the version from package.json
[program.js][debug] Discovering config files. Set --no-config-discovery to disable
[config.js][debug] Discovered config "/home/user/.web-ext-config.js" does not exist or is not readable
[config.js][debug] Discovered config "/home/user/Downloads/borderify/package.json" does not exist or is not readable
[config.js][debug] Discovered config "/home/user/Downloads/borderify/web-ext-config.js" does not exist or is not readable
[cmd/run.js][info] Running web extension from /home/user/Downloads/borderify
[util/manifest.js][debug] Validating manifest at /home/user/Downloads/borderify/manifest.json
[extension-runners/firefox-desktop.js][debug] Creating new Firefox profile
[firefox/index.js][debug] Running Firefox with profile at /tmp/60b142df-6c53-4b85-9ae0-4704d5b65112
[firefox/index.js][debug] Checking if remote Firefox port 6005 is available
[firefox/remote.js][debug] Connecting to Firefox on port 6005
[program.js][error] 
Error: connect ENETUNREACH 27.0.0.1:6005 - Local (0.0.0.0:0)
    at Object._errnoException (util.js:992:11)
    at _exceptionWithHostPort (util.js:1014:20)
    at internalConnect (net.js:960:16)
    at defaultTriggerAsyncIdScope (internal/async_hooks.js:284:19)
    at GetAddrInfoReqWrap.emitLookup [as callback] (net.js:1106:9)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:97:10)

[program.js][error] Error code: ENETUNREACH

[program.js][debug] Command executed: run
user@dell:~/Downloads/borderify$
user@dell:~/Downloads/borderify$ ~/Downloads/node-v10.15.3-linux-x64/bin/node /usr/local/bin/web-ext run -f ~/Downloads/firefox/firefox -v
[program.js][info] Version: 3.0.0
[program.js][debug] Getting the version from package.json
[program.js][debug] Discovering config files. Set --no-config-discovery to disable
[config.js][debug] Discovered config "/home/user/.web-ext-config.js" does not exist or is not readable
[config.js][debug] Discovered config "/home/user/Downloads/borderify/package.json" does not exist or is not readable
[config.js][debug] Discovered config "/home/user/Downloads/borderify/web-ext-config.js" does not exist or is not readable
[cmd/run.js][info] Running web extension from /home/user/Downloads/borderify
[util/manifest.js][debug] Validating manifest at /home/user/Downloads/borderify/manifest.json
[extension-runners/firefox-desktop.js][debug] Creating new Firefox profile
[firefox/index.js][debug] Running Firefox with profile at /tmp/55f91dbe-a6ed-4c95-b1f3-b94cbc546ba9
[firefox/index.js][debug] Checking if remote Firefox port 6005 is available
[firefox/remote.js][debug] Connecting to Firefox on port 6005
[program.js][error] 
Error: connect ENETUNREACH 27.0.0.1:6005 - Local (0.0.0.0:0)
    at internalConnect (net.js:872:16)
    at defaultTriggerAsyncIdScope (internal/async_hooks.js:294:19)
    at GetAddrInfoReqWrap.emitLookup [as callback] (net.js:1019:9)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:61:10)

[program.js][error] Error code: ENETUNREACH

[program.js][debug] Command executed: run
user@dell:~/Downloads/borderify$ 

@baptx
Copy link
Author

baptx commented May 13, 2019

I noticed that in the error it is trying to connect to 27.0.0.1:6005 and not 127.0.0.1:6005, this looks like a bug. The same result 27.0.0.1:6005 appeared when I posted the output of netstat -tunalp | grep 6005.
Update: I don't know how it happened but I had the line 27.0.0.1 localhost instead of 127.0.0.1 localhost in the file /etc/hosts.

@rpl
Copy link
Member

rpl commented May 13, 2019

@baptx hehe, that was starting to be my guess too (I initially though that 27.0.0.1 was a typo in the copy and paste).

Thanks for confirming that this was actually related to an issue in your local setup, I'm closing this and marking as invalid.

@rpl rpl closed this as completed May 13, 2019
@baptx
Copy link
Author

baptx commented May 13, 2019

Thanks for your help, Firefox started after I updated my hosts file. That's interesting, the IP address 27.0.0.1 actually exists, it is from Amazon Web Services in Japan.

@GrayedFox
Copy link

GrayedFox commented Sep 3, 2019

Hi there, I understand this was a local bug for the OP but I get the exact same error and can confirm that it is not due to a hosts file misconfiguration. Here is the verbose output of trying to run with a specific profile (it also fails for the same reason if simply running web-ext run without specifying any options):

web-ext run -p ~/snap/firefox/common/.mozilla/firefox/lis9gi8g.addons/ -v
[program.js][info] Version: 3.1.1
[program.js][debug] Discovering config files. Set --no-config-discovery to disable
[config.js][debug] Discovered config "/home/grayedfox/.web-ext-config.js" does not exist or is not readable
[config.js][debug] Discovered config "/home/grayedfox/github/multi-dict/web-ext-config.js" does not exist or is not readable
[program.js][info] Applying config file: ./package.json
[config.js][debug] Loading JS config file: "/home/grayedfox/github/multi-dict/package.json" (resolved to "/home/grayedfox/github/multi-dict/package.json")
[config.js][debug] Looking for webExt key inside package.json file
[config.js][debug] Config file /home/grayedfox/github/multi-dict/package.json did not define any options. Did you set module.exports = {...}?
[cmd/run.js][info] Running web extension from /home/grayedfox/github/multi-dict
[util/manifest.js][debug] Validating manifest at /home/grayedfox/github/multi-dict/manifest.json
[extension-runners/firefox-desktop.js][debug] Copying Firefox profile from /home/grayedfox/snap/firefox/common/.mozilla/firefox/lis9gi8g.addons/
[firefox/index.js][debug] Copying profile directory from "/home/grayedfox/snap/firefox/common/.mozilla/firefox/lis9gi8g.addons/"
[firefox/index.js][debug] Running Firefox with profile at /tmp/890adb6d-e660-4dbe-a2d2-d23a5a2237a5
[firefox/index.js][debug] Checking if remote Firefox port 6005 is available
[firefox/remote.js][debug] Connecting to Firefox on port 6005
[firefox/index.js][debug] Executing Firefox binary: /snap/bin/firefox
[firefox/index.js][debug] Firefox args: -start-debugger-server 6005 -foreground -no-remote -profile /tmp/890adb6d-e660-4dbe-a2d2-d23a5a2237a5
[firefox/index.js][info] Use --verbose or open Tools > Web Developer > Browser Console to see logging
[firefox/remote.js][debug] Connecting to the remote Firefox debugger
[firefox/remote.js][debug] Connecting to Firefox on port 6005
[firefox/index.js][debug] Firefox stderr: /snap/firefox/253/bin/desktop-launch: line 174: /home/grayedfox/snap/firefox/common/.config/user-dirs.dirs: No such file or directory
[firefox/index.js][debug] Firefox stderr: cp: cannot create regular file '/home/grayedfox/snap/firefox/common/.config/': Not a directory
[firefox/index.js][debug] Firefox stderr: /snap/firefox/253/bin/desktop-launch: line 177: /home/grayedfox/snap/firefox/common/.config/user-dirs.dirs.md5sum: No such file or directory
[firefox/index.js][debug] Firefox stderr: /snap/firefox/253/bin/desktop-launch: line 177: /home/grayedfox/snap/firefox/common/.config/user-dirs.locale.md5sum: No such file or directory
[firefox/index.js][debug] Firefox stderr: Gtk-Message: Failed to load module "canberra-gtk-module"
...
[firefox/remote.js][debug] Retrying Firefox (250); connection error: Error: connect ECONNREFUSED 127.0.0.1:6005
[firefox/remote.js][debug] Connect to Firefox debugger: too many retries
[program.js][error] 
Error: connect ECONNREFUSED 127.0.0.1:6005
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)

[program.js][error] Error code: ECONNREFUSED

[program.js][debug] Command executed: run

Ubuntu 18.04, Snap packaged FF

@Rob--W
Copy link
Member

Rob--W commented Sep 3, 2019

@GrayedFox Please open a new bug. Your log is almost certainly unrelated to the originally reported issue here, but related to the fact that you're using Firefox in a Snap package.

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

No branches or pull requests

4 participants