(This isn't a problem with Snowflake itself so putting Core Tor as component.)
Steps to reproduce:
Copy paste snowflake-client inside /Browser/TorBrowser/Tor/PluggableTransports to /usr/bin.
Add UseBridges 1, ClientTransportPlugin snowflake exec /usr/bin/snowflake-client, as well as Bridge snowflake 0.0.3.0:1 2B280B23E1107BB62ABFC40DDCC8824814F80A72 to torrc.
sudo service tor restart
Looking at the task manager I don't see that snowflake is running as a process, this most likely means that it was blocked from launching due to the AppArmor profile distributed with Tor.
OS: Ubuntu 17.10. /etc/apt/sources.list has Tor Project repositories. Also Tor 0.3.2.x-alpha that was used when testing.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
Trac: Summary: Snowflake can't be configured to run with system tor because of AppArmor to Snowflake can't be configured to run with system tor: ENV-ERROR no TOR_PT_STATE_LOCATION environment variable
This seems to be the error when trying to launch it:
{{{
ENV-ERROR no TOR_PT_STATE_LOCATION environment variable
}}}
There might be some other problem in your setup. That ENV-ERROR comes from pt.MakeStateDir. But snowflake-client doesn't call pt.MakeStateDir; only snowflake-server does. Are you use you copied the client to /usr/bin, and not the server? (Your comment:3 refers to /usr/bin/snowflake, but the ticket description refers to /usr/bin/snowflake-client.)
snowflake-server wants access to $TOR_PT_STATE_LOCATION because that's where it caches its TLS certificates and keys.
In any case, the problem is not that the executable was blocked from launching, because the error message comes from code inside the pluggable transport, not from tor.
There might be some other problem in your setup. That ENV-ERROR comes from pt.MakeStateDir. But snowflake-client doesn't call pt.MakeStateDir; only snowflake-server does. Are you use you copied the client to /usr/bin, and not the server? (Your comment:3 refers to /usr/bin/snowflake, but the ticket description refers to /usr/bin/snowflake-client.)
Yes (I copied snowflake-client from a Tor Browser alpha directory and renamed it to snowflake in my case).
cypherpunks, what version of Tor Browser did you copy snowflake-client from? And does Snowflake work inside Tor Browser (not with system tor)? I ask because I tried with tor-browser-linux64-7.5a4_en-US.tar.xz and I didn't get the ENV-ERROR from comment:3; rather I got the libatomic error from #24465 (moved)/#25087 (moved):
# /usr/bin/snowflake-client -h/usr/bin/snowflake-client: error while loading shared libraries: libatomic.so.1: cannot open shared object file: No such file or directory
sudo service tor restart (Note I hadn't changed apparmor settings yet.)
/var/log/syslog shows
{{{
Cloud not launch managed proxy executable at '/usr/bin/snowflake-client' ('Permission denied').
}}}
Add to /etc/apparmor.d/abstractions/tor:
{{{
/usr/bin/snowflake-client ix,
}}}
sudo service apparmor restart
sudo service tor restart Now I get the expected error:
{{{
The communication stream of managed proxy '/usr/bin/snowflake-client' is 'closed'. Most probably the managed proxy stopped running. This might be a bug of the managed proxy, a bug of Tor, or a misconfiguration. Please enable logging on your managed proxy and check the logs for errors.
}}}
/usr/bin/snowflake-client -h
{{{
/usr/bin/snowflake-client: error while loading shared libraries: libatomic.so.1: cannot open shared object file: No such file or directory
}}}
what version of Tor Browser did you copy snowflake-client from?
Since this was 3 months ago I guess I had copied it from a Tor Browser 7.5a8.
And does Snowflake work inside Tor Browser (not with system tor)?
Yes.
I already have the libatomic1 package installed so that's not the problem. After retrying the steps you followed, I figured out that the missing step was to do,
sudo chmod +rx /usr/bin/snowflake-client
After that system Tor correctly bootstraps and works fine and I can see snowflake in the task manager!!!
However when I launch ./snowflake-client from the command line I do get the error,
ENV-ERROR no TOR_PT_STATE_LOCATION environment variable
So I had assumed that this may have been the error.
In any case, the /etc/apparmor.d/abstractions/tor changes for snowflake are necessary and should be added when #19409 (moved) is ready.
Trac: Summary: Snowflake can't be configured to run with system tor: ENV-ERROR no TOR_PT_STATE_LOCATION environment variable to AppArmor default config blocks Snowflake from running with system tor Status: needs_information to new