null-dev / firefox-profile-switcher-connector

Native connector software for the 'Profile Switcher for Firefox' extension.
GNU General Public License v3.0
121 stars 25 forks source link

Recent version always shows "setup incomplete" on macos #5

Closed asfaltboy closed 3 years ago

asfaltboy commented 3 years ago

sorry, I wouldn't know where to start looking for debug logs 🤷

MattHardcastle commented 3 years ago

I'm assuming you installed the connector using brew. Can you run brew config command on your Mac and paste the output here? I have a suspicion I know what your issue may be.

asfaltboy commented 3 years ago

Yes. One important note I forgot to mention: I installed it before the new version was out, as I came across the thread in #1 and it worked fine for me for a period.

I also tried reinstalling the connector from brew, symlinking again, and restarting firefox

ls -al ~"/Library/Application Support/Mozilla/NativeMessagingHosts"/
lrwxr-xr-x 89 meuser 23 Jun 17:38 ax.nd.profile_switcher_ff.json -> /usr/local/Cellar/firefox-profile-switcher-connector/0.0.7/ax.nd.profile_switcher_ff.json

and, the output from brew config:

HOMEBREW_VERSION: 3.2.0-28-g41e875a
ORIGIN: https://github.com/Homebrew/brew
HEAD: 41e875a676b66f105ee4e7823cfbae7c1a3116f4
Last commit: 19 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 2446ac0635db29786a9cbbf10f48ee137c7b78ab
Core tap last commit: 15 hours ago
Core tap branch: HEAD
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_EDITOR: vim
HOMEBREW_MAKE_JOBS: 12
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: dodeca-core 64-bit kabylake
Clang: 12.0.5 build 1205
Git: 2.32.0 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 11.4-x86_64
CLT: 12.5.0.22.9
Xcode: 12.5.1
null-dev commented 3 years ago

Can you screenshot Menu > More Tools > Browser Console?

Also, can you:

  1. Go to this URL: about:debugging#/runtime/this-firefox.
  2. Click "Inspect" beside the extension.
  3. Make sure you are on the "Console" tab.
  4. Take a screenshot of the console and upload it here.
forabi commented 3 years ago

@null-dev I'm running into the same issue, here's a screenshot:

Screenshot 2021-07-03 at 4 38 23 PM
❯ brew config
HOMEBREW_VERSION: 3.2.0
ORIGIN: https://github.com/Homebrew/brew
HEAD: 09f7bc27a99469cf947431df4754737dfbadb31d
Last commit: 13 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: dc14a439f1df41a32e7d0166028a07ab12157b53
Core tap last commit: 20 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 12.0.5 build 1205
Git: 2.30.1 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 11.4-arm64
CLT: 12.0.0.32.29
Xcode: 12.5.1
Rosetta 2: false

Device is Mac Mini M1

forabi commented 3 years ago

I've fixed it with ln -s /opt/homebrew/Cellar/firefox-profile-switcher-connector/0.0.7/bin/ff-pswitch-connector /usr/local/bin/ff-pswitch-connector

sergeda commented 3 years ago

I have the same problem but different errors. Mine are:

Screenshot 2021-07-04 at 20 25 30
asfaltboy commented 3 years ago

Sorry for the delay, here are my screenshots: Screenshot 2021-07-05 at 09 00 46 Screenshot 2021-07-05 at 09 01 29

null-dev commented 3 years ago

I just released a new version of the extension that should hopefully fix this issue. Can you try updating to it? Also make sure to update the additional software when asked.

asfaltboy commented 3 years ago

No luck, still looks broke... need to see any other logs?

null-dev commented 3 years ago

@asfaltboy Just to confirm, you are running regular Firefox, not a fork right? Can you send me the output of the following commands?

asfaltboy commented 3 years ago

Heh, after restarting I see no such dir:

$ ls -la ~"/Library/Application Support/Mozilla/NativeMessagingHosts"                                                                          Wed Jul 14 09:29:31 2021
lrwxr-xr-x 89 pavelsavchenko 14 Jul 09:29 ax.nd.profile_switcher_ff.json -> /usr/local/Cellar/firefox-profile-switcher-connector/0.0.8/ax.nd.profile_switcher_ff.json
$ ls -la ~"/Library/Application Support/Mozilla/NativeMessagingHosts"                                                                      Wed Jul 14 11:32:47 2021
"~/Library/Application Support/Mozilla/NativeMessagingHosts": No such file or directory (os error 2)

That's weird, before restart it was clearly there... (check the timestamps to the right)

asfaltboy commented 3 years ago

Just noticed I'm on (regular) firefox 90.0. Could be that the directory is deleted when firefox is upgraded?

So I just symlinked and restarted again, but issue persists. I just ran the commands you gave me and it looks like the ff-pswitch-connector rust app fails.

Here's the output:

$  cat ~"/Library/Application Support/Mozilla/NativeMessagingHosts/ax.nd.profile_switcher_ff.json"
{
    "allowed_extensions": [
        "profile-switcher-ff@nd.ax"
    ],
    "description": "Profile Switcher for Firefox",
    "name": "ax.nd.profile_switcher_ff",
    "path": "/usr/local/Cellar/firefox-profile-switcher-connector/0.0.8/bin/ff-pswitch-connector",
    "type": "stdio"
}

$ find /usr/local/Cellar/firefox-profile-switcher-connector
/usr/local/Cellar/firefox-profile-switcher-connector
/usr/local/Cellar/firefox-profile-switcher-connector/0.0.8
/usr/local/Cellar/firefox-profile-switcher-connector/0.0.8/INSTALL_RECEIPT.json
/usr/local/Cellar/firefox-profile-switcher-connector/0.0.8/bin
/usr/local/Cellar/firefox-profile-switcher-connector/0.0.8/bin/ff-pswitch-connector
/usr/local/Cellar/firefox-profile-switcher-connector/0.0.8/.brew
/usr/local/Cellar/firefox-profile-switcher-connector/0.0.8/.brew/firefox-profile-switcher-connector.rb
/usr/local/Cellar/firefox-profile-switcher-connector/0.0.8/README.md
/usr/local/Cellar/firefox-profile-switcher-connector/0.0.8/ax.nd.profile_switcher_ff.json
/usr/local/Cellar/firefox-profile-switcher-connector/0.0.8/LICENSE.txt

$ echo | ff-pswitch-connector
C{"id":-1,"resp":{"event":"ConnectorInformation","version":"0.0.8"}}thread 'main' panicked at 'Failed to read native message size!: Error { kind: UnexpectedEof, message: "failed to fill whole buffer" }', src/native_req.rs:66:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

$ export RUST_BACKTRACE=full 
$ echo | ff-pswitch-connector
C{"id":-1,"resp":{"event":"ConnectorInformation","version":"0.0.8"}}thread 'main' panicked at 'Failed to read native message size!: Error { kind: UnexpectedEof, message: "failed to fill whole buffer" }', src/native_req.rs:66:10
stack backtrace:
   0:        0x1043fd92e - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7dac4b58aa11870a
   1:        0x10443178e - core::fmt::write::h53badd02f711efbe
   2:        0x1043f960a - std::io::Write::write_fmt::hd02c4bbaf6463567
   3:        0x10441449f - std::panicking::default_hook::{{closure}}::ha7d22468d4529f02
   4:        0x10441402a - std::panicking::default_hook::hc6c5fb91e7ed228a
   5:        0x104414a10 - std::panicking::rust_panic_with_hook::h94fd567d38cd4da7
   6:        0x1043fdca5 - std::panicking::begin_panic_handler::{{closure}}::h953a8f32e4882703
   7:        0x1043fdaa8 - std::sys_common::backtrace::__rust_end_short_backtrace::h8472811b9ff0c597
   8:        0x1044145a3 - _rust_begin_unwind
   9:        0x10443e36f - core::panicking::panic_fmt::h5a271c2839c7a480
  10:        0x10443e665 - core::result::unwrap_failed::hdc9b54af28d7ad5c
  11:        0x1043850c1 - firefox_profile_switcher_connector::native_req::read_incoming_message::h10e526e4598251d9
  12:        0x1043965a4 - firefox_profile_switcher_connector::main::h272fedf7ba8d5ebf
  13:        0x10435feea - std::sys_common::backtrace::__rust_begin_short_backtrace::h513498f37a35895d
  14:        0x10437f81c - std::rt::lang_start::{{closure}}::hf9afb0351872cde8
  15:        0x10441d2ba - std::rt::lang_start_internal::h43b407d2a4fa0408
  16:        0x104396e59 - _main
null-dev commented 3 years ago

@asfaltboy I'm completely stumped as everything looks just fine. The error you see with the program is actually because the connector software is expecting to be launched by Firefox however in this case I had you launch it through the terminal just to test that it's installed properly.

The last idea I have is to make the manifest globally visible, which you can do by running this command:

sudo ln -s /usr/local/Cellar/firefox-profile-switcher-connector/0.0.8/ax.nd.profile_switcher_ff.json /Library/Application Support/Mozilla/NativeMessagingHosts/ax.nd.profile_switcher_ff.json
caseykramer commented 3 years ago

The above step to make the manifest globally visible fixed things for me. I had to create the /Library/Application Support/Mozilla/NativeMessagingHosts directory first, but once I added the softlink all was well.

null-dev commented 3 years ago

The above step to make the manifest globally visible fixed things for me. I had to create the /Library/Application Support/Mozilla/NativeMessagingHosts directory first, but once I added the softlink all was well.

Huh, well that's good news, I'll instruct users to run that command as well.

asfaltboy commented 3 years ago

Yep that worked for me too, I'm on a work laptop, could be that is needed on certain setups? Is it something to do with permissions?

null-dev commented 3 years ago

I'm still not really sure why it solves the problem but since it seems to work I'm going to consider this issue solves, feel free to re-open if it comes up again!