Cwtch for MacOS error connecting to Tor #166

Closed
opened 2021-09-02 01:55:25 +00:00 by quartermarsh2 · 22 comments

I get the following error message when I launch Cwtch 1.2 for MacOS:
Error connecting to Tor: Could not connect to or start Tor that meets requirements (min Tor version 0.3.5.x)
(see attached screenshot)
OS version 10.14.6
Tor version 10.5.5
I've been troubleshooting but no success yet.
Any advice?
Thx,
Mark

I get the following error message when I launch Cwtch 1.2 for MacOS: Error connecting to Tor: Could not connect to or start Tor that meets requirements (min Tor version 0.3.5.x) (see attached screenshot) OS version 10.14.6 Tor version 10.5.5 I've been troubleshooting but no success yet. Any advice? Thx, Mark
Author

A further question if I may. Will you be releasing 1.2.1 as a DMG? That would let me avoid installing flutter, git and homebrew in order to build Cwtch myself.
Many thanks!
Mark

A further question if I may. Will you be releasing 1.2.1 as a DMG? That would let me avoid installing flutter, git and homebrew in order to build Cwtch myself. Many thanks! Mark
sarah added the
bug
mac
labels 2021-09-03 18:38:39 +00:00
dan was assigned by sarah 2021-09-03 18:38:44 +00:00
Owner

we already have a Cwtch 1.2 DMG download at https://cwtch.im/download/ so you don't need to be building it now.

Running it from the console and pasting the outout can help with diagnosis, but if you built it yourself... we don't bundle tor with the source, only the DMG, but as the build instructions mention, you then need tor browser installed (which you mentioning a version of 10.5.5 sounds like you do, that's a tor browser version that should be bundled with a compatible tor of version 0.4.x.x) and then get that tor into a location that the app expects. in this case we do that with maxos/package-release.sh line

cp -r /Applications/Tor\ Browser.app/Contents/MacOS/Tor build/macos/Build/Products/Release/Cwtch.app/Contents/MacOS/

Hope that helps, let me know

we already have a Cwtch 1.2 DMG download at https://cwtch.im/download/ so you don't need to be building it now. Running it from the console and pasting the outout can help with diagnosis, but if you built it yourself... we don't bundle tor with the source, only the DMG, but as the build instructions mention, you then need tor browser installed (which you mentioning a version of 10.5.5 sounds like you do, that's a tor browser version that should be bundled with a compatible tor of version 0.4.x.x) and then get that tor into a location that the app expects. in this case we do that with maxos/package-release.sh line cp -r /Applications/Tor\ Browser.app/Contents/MacOS/Tor build/macos/Build/Products/Release/Cwtch.app/Contents/MacOS/ Hope that helps, let me know
Contributor

This also happens to me when I reboot my system, the only fix I can find is reinstalling the app each time, I believe it's to do with macOS gatekeeper being weird, because when I first run Cwtch it asks me to confirm the app in Security & Privacy, then I get that popup, then it asks me to confirm another cwtch binary, which allows tor to load.

Interestingly enough the second popup seems to imply it's pulling tor from the loaded Cwtch.dmg

Edit: Alright I've found the issue, the issue is the Cwtch app won't load when the Cwtch.dmg isn't mounted, the reason being for some reason it points to the tor.real binary in the DMG instead of in the .app.

/Volumes/Cwtch/Cwtch.app/Contents/MacOS/Tor/tor.real

Reason being that the .app isn't able to find tor.real in the following code path, assuming it's because it needs a full path? ffi.dart:

118       if (await File("Cwtch.app/Contents/MacOS/Tor/tor.real").exists()) {
119         bundledTor = "Cwtch.app/Contents/MacOS/Tor/tor.real";
120       } else if (await File("/Volumes/Cwtch/Cwtch.app/Contents/MacOS/Tor/tor.real").exists()) {
121         bundledTor = "/Volumes/Cwtch/Cwtch.app/Contents/MacOS/Tor/tor.real";
122       }
123     }
This also happens to me when I reboot my system, the only fix I can find is reinstalling the app each time, I believe it's to do with macOS gatekeeper being weird, because when I first run Cwtch it asks me to confirm the app in Security & Privacy, then I get that popup, then it asks me to confirm another cwtch binary, which allows tor to load. Interestingly enough the second popup seems to imply it's pulling tor from the loaded Cwtch.dmg Edit: Alright I've found the issue, the issue is the Cwtch app won't load when the Cwtch.dmg isn't mounted, the reason being for some reason it points to the tor.real binary in the DMG instead of in the .app. `/Volumes/Cwtch/Cwtch.app/Contents/MacOS/Tor/tor.real` Reason being that the .app isn't able to find tor.real in the following code path, assuming it's because it needs a full path? ffi.dart: ``` 118 if (await File("Cwtch.app/Contents/MacOS/Tor/tor.real").exists()) { 119 bundledTor = "Cwtch.app/Contents/MacOS/Tor/tor.real"; 120 } else if (await File("/Volumes/Cwtch/Cwtch.app/Contents/MacOS/Tor/tor.real").exists()) { 121 bundledTor = "/Volumes/Cwtch/Cwtch.app/Contents/MacOS/Tor/tor.real"; 122 } 123 } ```

Hi, I do get the same error on macOS 11.5.2. I have Tor Browser 10.5.5 installed (which in its release notes talks about a Tor update to 0.4.5.10).

Edit: I do have the tor.real where expected too. And having the DMG mounted effectively triggers a different behavior than when it's not (getting exactly the same as @fyne).

Hi, I do get the same error on macOS 11.5.2. I have Tor Browser 10.5.5 installed (which in its release notes talks about a Tor update to 0.4.5.10). Edit: I do have the tor.real where expected too. And having the DMG mounted effectively triggers a different behavior than when it's not (getting exactly the same as @fyne).
Contributor

Hi, I do get the same error on macOS 11.5.2. I have Tor Browser 10.5.5 installed (which in its release notes talks about a Tor update to 0.4.5.10).

Edit: I do have the tor.real where expected too. And having the DMG mounted effectively triggers a different behavior than when it's not (getting exactly the same as @fyne).

Can you try building https://git.openprivacy.ca/fyne/cwtch-ui/src/branch/fix-macos-dmg-location

I'm struggling to get it to compile here (M1) and it complains about IMEPersonalisedLearning still, but this should fix it

> Hi, I do get the same error on macOS 11.5.2. I have Tor Browser 10.5.5 installed (which in its release notes talks about a Tor update to 0.4.5.10). > > Edit: I do have the tor.real where expected too. And having the DMG mounted effectively triggers a different behavior than when it's not (getting exactly the same as @fyne). Can you try building https://git.openprivacy.ca/fyne/cwtch-ui/src/branch/fix-macos-dmg-location I'm struggling to get it to compile here (M1) and it complains about IMEPersonalisedLearning still, but this should fix it

Got an errand to run, but I'll try it when I'll be back :)

Got an errand to run, but I'll try it when I'll be back :)
Contributor

Got an errand to run, but I'll try it when I'll be back :)

Not a problem, managed to get it building, I've fixed it and will submit a PR

Okay so it works with a hardcoded path but I'm building something that'll detect what application you're running path wise, incase the devs want to have custom .app files for dev branches, etc.

Can't make a PR for some reason, but check the code: https://git.openprivacy.ca/fyne/cwtch-ui/src/branch/fix-macos-dmg-location

> Got an errand to run, but I'll try it when I'll be back :) Not a problem, managed to get it building, I've fixed it and will submit a PR Okay so it works with a hardcoded path but I'm building something that'll detect what application you're running path wise, incase the devs want to have custom .app files for dev branches, etc. Can't make a PR for some reason, but check the code: https://git.openprivacy.ca/fyne/cwtch-ui/src/branch/fix-macos-dmg-location
Owner

what error do you get when you try to do a PR?

ah the changes are looking good. I believe my thinking for the finding tor tests when i wrote them were

if (await File("Cwtch.app/Contents/MacOS/Tor/tor.real").exists()) was for supposed to be for running it while developing, like this path should be triggered when doing a env DYLD_LIBRARY_PATH=. flutter run

if (await File("/Volumes/Cwtch/Cwtch.app/Contents/MacOS/Tor/tor.real").exists()) was for if you wanted to run Cwtch from the DMG :)

but yeah looks like I missed the installed case where the DMG wasn't mounted. or thought the first case would catch it. So your additions look good but I think the first case should be kept too :)

what error do you get when you try to do a PR? ah the changes are looking good. I believe my thinking for the finding tor tests when i wrote them were `if (await File("Cwtch.app/Contents/MacOS/Tor/tor.real").exists())` was for supposed to be for running it while developing, like this path should be triggered when doing a `env DYLD_LIBRARY_PATH=. flutter run` `if (await File("/Volumes/Cwtch/Cwtch.app/Contents/MacOS/Tor/tor.real").exists())` was for if you wanted to run Cwtch from the DMG :) but yeah looks like I missed the installed case where the DMG wasn't mounted. or thought the first case would catch it. So your additions look good but I think the first case should be kept too :)
Contributor

what error do you get when you try to do a PR?

ah the changes are looking good. I believe my thinking for the finding tor tests when i wrote them were

if (await File("Cwtch.app/Contents/MacOS/Tor/tor.real").exists()) was for supposed to be for running it while developing, like this path should be triggered when doing a env DYLD_LIBRARY_PATH=. flutter run

if (await File("/Volumes/Cwtch/Cwtch.app/Contents/MacOS/Tor/tor.real").exists()) was for if you wanted to run Cwtch from the DMG :)

but yeah looks like I missed the installed case where the DMG wasn't mounted. or thought the first case would catch it. So your additions look good but I think the first case should be kept too :)

No erorr it just redirects to the profile page, it's a bit odd. Ah that makes sense, sorry if my code is a bit messy :-)

> what error do you get when you try to do a PR? > > ah the changes are looking good. I believe my thinking for the finding tor tests when i wrote them were > > `if (await File("Cwtch.app/Contents/MacOS/Tor/tor.real").exists())` was for supposed to be for running it while developing, like this path should be triggered when doing a `env DYLD_LIBRARY_PATH=. flutter run` > > `if (await File("/Volumes/Cwtch/Cwtch.app/Contents/MacOS/Tor/tor.real").exists())` was for if you wanted to run Cwtch from the DMG :) > > but yeah looks like I missed the installed case where the DMG wasn't mounted. or thought the first case would catch it. So your additions look good but I think the first case should be kept too :) No erorr it just redirects to the profile page, it's a bit odd. Ah that makes sense, sorry if my code is a bit messy :-)
Owner

aaaaah, that's one of our "a little hacky" anti DDOS prevention things. you need to relog into git.openprivacy.ca and make sure the check the "remember me" box. it sets a cookie in the system that at the webserver level we were able to use to restrict access to some parts of the site.

aaaaah, that's one of our "a little hacky" anti DDOS prevention things. you need to relog into git.openprivacy.ca and make sure the check the "remember me" box. it sets a cookie in the system that at the webserver level we were able to use to restrict access to some parts of the site.
Author

Hi Dan,
I’ve been running Cwtch from the DMG file, installed in the Applications folder. My command line fu sucks, but I did figure out how to open Cwtch from the terminal. (Got the same error). I guess that some other flag would be required to get it to output the process.
So, I noticed in the thread from last night that uninstalling Cwtch and reinstalling was a fix for fyne. I uninstalled Tor Browser and Cwtch, removed all rules for both from Little Snitch then re-downloaded Cwtch and ran it directly from the DMG without moving into Applications. (No Tor Browser) That worked. I’m on the profile page.
Hope that helps. Many thanks for your help!
Mark

Hi Dan, I’ve been running Cwtch from the DMG file, installed in the Applications folder. My command line fu sucks, but I did figure out how to open Cwtch from the terminal. (Got the same error). I guess that some other flag would be required to get it to output the process. So, I noticed in the thread from last night that uninstalling Cwtch and reinstalling was a fix for fyne. I uninstalled Tor Browser and Cwtch, removed all rules for both from Little Snitch then re-downloaded Cwtch and ran it directly from the DMG without moving into Applications. (No Tor Browser) That worked. I’m on the profile page. Hope that helps. Many thanks for your help! Mark
Author

Pardon me for doubling up on the reply ;)

Pardon me for doubling up on the reply ;)

Hi, can confirm the experience of quartermarsh2. Running MacOS 10.14.1 and TB 10.5.5 and can only use cwtch from inside the DMG without moving it to the application folder. Any ETA on bugfixing this ?

Hi, can confirm the experience of quartermarsh2. Running MacOS 10.14.1 and TB 10.5.5 and can only use cwtch from inside the DMG without moving it to the application folder. Any ETA on bugfixing this ?
Author

If you leave the DMG mounted in the finder you can move cwtch into the applications folder and it will run from there - at least in my experience on 10.14.6. Quitting cwtch will mean that you have to sign in to your profile again. Unmounting the DMG may mean that you'll have to redownload and install cwitch in order to get it running again (see fyne's comment above - nb that security and privacy will not prompt you for full disk access on mojave as it's not required). I've been leaving my laptop running and not sleeping to avoid that issue, although I do find that the Cwitch Release Candidate Testers server will disconnect after a period of time, at which point you will have to quit cwtch and sign in again anyhow. (In fact I'm not certain that that group chat is updating properly after rejoining it, but that's a question for Dan et al.)

If you leave the DMG mounted in the finder you can move cwtch into the applications folder and it will run from there - at least in my experience on 10.14.6. Quitting cwtch will mean that you have to sign in to your profile again. Unmounting the DMG may mean that you'll have to redownload and install cwitch in order to get it running again (see fyne's comment above - nb that security and privacy will not prompt you for full disk access on mojave as it's not required). I've been leaving my laptop running and not sleeping to avoid that issue, although I do find that the Cwitch Release Candidate Testers server will disconnect after a period of time, at which point you will have to quit cwtch and sign in again anyhow. (In fact I'm not certain that that group chat is updating properly after rejoining it, but that's a question for Dan et al.)

yea, kinda clumsy to work that way. Nice to be able to test out, but still am waiting for cwtch being able to run direcly from sandboxed application folder lol. Maybe for beta 1.13 ?

yea, kinda clumsy to work that way. Nice to be able to test out, but still am waiting for cwtch being able to run direcly from sandboxed application folder lol. Maybe for beta 1.13 ?
Contributor

yea, kinda clumsy to work that way. Nice to be able to test out, but still am waiting for cwtch being able to run direcly from sandboxed application folder lol. Maybe for beta 1.13 ?

This is something I want too, but you should be aware just running the application in the /Applications folder doesn't automatically make it sandboxed, you should check out Sandkorn which will let you explore which apps are sandboxed, custom entitlements, etc.

Also I've submitted a PR to fix this issue, not sure if it'll be accepted (#171) but it works fine locally, if you can compile cwtch you can just use that.

> yea, kinda clumsy to work that way. Nice to be able to test out, but still am waiting for cwtch being able to run direcly from sandboxed application folder lol. Maybe for beta 1.13 ? This is something I want too, but you should be aware just running the application in the /Applications folder doesn't automatically make it sandboxed, you should check out [Sandkorn](https://www.peterborgapps.com/sandkorn/) which will let you explore which apps are sandboxed, custom entitlements, etc. Also I've submitted a PR to fix this issue, not sure if it'll be accepted (https://git.openprivacy.ca/cwtch.im/cwtch-ui/pulls/171) but it works fine locally, if you can compile cwtch you can just use that.
Author

"Hey there Dan. The releast candidate group appears to have stopped updating for me, unless there's just been no activity for the last 24 hours. Yesterday I left Cwitch running while I was out all day and when I returned the group chat server was disconnected. I quit Cwtch and signed back in again and the server was up but there was no new activity. Same thing happened over night. Curious methinks. (By the way, I can cofirm that Cwtch runs from the applications folder as long as the DMG stays mounted.) Cheers!" 
By the way, I just sent Dan this message on Cwtch but I'm beggining to suspect there are overll server issues somewhere down the line with Cwtch so I'm reposting it here. Sorry if I'm overfunctioning.

"Hey there Dan. The releast candidate group appears to have stopped updating for me, unless there's just been no activity for the last 24 hours. Yesterday I left Cwitch running while I was out all day and when I returned the group chat server was disconnected. I quit Cwtch and signed back in again and the server was up but there was no new activity. Same thing happened over night. Curious methinks. (By the way, I can cofirm that Cwtch runs from the applications folder as long as the DMG stays mounted.) Cheers!"  By the way, I just sent Dan this message on Cwtch but I'm beggining to suspect there are overll server issues somewhere down the line with Cwtch so I'm reposting it here. Sorry if I'm overfunctioning.
Owner

The releast candidate group appears to have stopped updating for me, unless there's just been no activity for the last 24 hours.

It has been a very quiet 24 hours :) - Though I just sent a message so let me know if you didn't see it.

I returned the group chat server was disconnected

Ah! I suspect this might be an elusive Tor bug. My suspicion is that occasionally the underlying Tor circuit breaks down in a weird way - basically Tor thinks the onion is unreachable even though it isn't - resetting Tor through the Tor settings screen in these cases does fix the connection issue.

The tell tale sign of this error is if there are 2 profiles on the same cwtch client they will both be unable to connect to the same server (even though they are instantiating different overlay connections). It's something I've been keeping an eye out for but it's rare enough that I've only seen it happen once.

I though we had an issue for this, but I can't see to find it so I'll open a new one.

> The releast candidate group appears to have stopped updating for me, unless there's just been no activity for the last 24 hours. It has been a very quiet 24 hours :) - Though I just sent a message so let me know if you didn't see it. > I returned the group chat server was disconnected Ah! I suspect this might be an elusive Tor bug. My suspicion is that occasionally the underlying Tor circuit breaks down in a weird way - basically Tor thinks the onion is unreachable even though it isn't - resetting Tor through the Tor settings screen in these cases does fix the connection issue. The tell tale sign of this error is if there are 2 profiles on the same cwtch client they will both be unable to connect to the same server (even though they are instantiating different overlay connections). It's something I've been keeping an eye out for but it's rare enough that I've only seen it happen once. I though we had an issue for this, but I can't see to find it so I'll open a new one.
sarah added this to the Cwtch Beta 1.3 project 2021-09-07 20:41:13 +00:00
dan referenced this issue from a commit 2021-09-09 00:24:10 +00:00
dan closed this issue 2021-09-09 00:24:10 +00:00
Owner

So we've merged some nice PRs in the last day or two including Fyne's patch for finding tor, so the latest code does not need the DMG mounted. Also the build instructions got a bit more detail.

I don't think we've yet percolated Sarah's tapir fix all the way up, and I have two more mac fixes I want to get to: the shutdown not being handled problerly, and more annoyingly that the 1.2 DMG is technically a "development build" so using $CWTCH_HOME/dev to store profiles for all mac users.

Working on PRs for those and will keep and eye out for the Tapir upgrade. we may try and do a mac manual "nightly" to get those all out to you before 1.3 :)

So we've merged some nice PRs in the last day or two including Fyne's patch for finding tor, so the latest code does not need the DMG mounted. Also the build instructions got a bit more detail. I don't think we've yet percolated Sarah's tapir fix all the way up, and I have two more mac fixes I want to get to: the shutdown not being handled problerly, and more annoyingly that the 1.2 DMG is technically a "development build" so using $CWTCH_HOME/dev to store profiles for all mac users. Working on PRs for those and will keep and eye out for the Tapir upgrade. we may try and do a mac manual "nightly" to get those all out to you before 1.3 :)
Author

Brilliant!
Thanks Dan :)

Brilliant! Thanks Dan :)
Owner

We published a new Mac version, 1.2.1

https://cwtch.im/download/

We published a new Mac version, 1.2.1 https://cwtch.im/download/
Author

Cwith for Mac working like a charm.
Thanks for the fixes :)

Cwith for Mac working like a charm. Thanks for the fixes :)
Sign in to join this conversation.
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cwtch.im/cwtch-ui#166
No description provided.