Jigsaw-Code / outline-apps

Outline Client and Manager, developed by Jigsaw. Outline Manager makes it easy to create your own VPN server. Outline Client lets you share access to your VPN with anyone in your network, giving them access to the free and open internet.
https://getoutline.org/
Apache License 2.0
8.24k stars 1.35k forks source link

Support Outline Client on Linux Mint #1654

Open karrakoliko opened 1 year ago

karrakoliko commented 1 year ago

Describe the bug

When i try connect to server using Outline Client (Version 1.11.0 (468189)), i get error: Unfortunately we are not able to initialize Outline, please submit feedback through the app.

To Reproduce Try connect to server using Outline Client

Expected behavior Connect to server

Client System (please complete the following information):

Additional context While searching for workaround, somewhere in issues i found recommendation to run install_linux_service.sh.

Script warned that Permission denied at /usr/local/sbin/OutlineProxyController. i tried sudo chmod +x /usr/local/sbin/OutlineProxyController, then restart service.

service could start now:

     ● outline_proxy_controller.service - Outline Proxy Routing Controller
     Loaded: loaded (/etc/systemd/system/outline_proxy_controller.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2023-06-27 17:00:47 +10; 1min 19s ago
   Main PID: 3404848 (OutlineProxyCon)
      Tasks: 1 (limit: 9255)
     Memory: 440.0K
        CPU: 22ms
     CGroup: /system.slice/outline_proxy_controller.service
             └─3404848 /usr/local/sbin/OutlineProxyController --socket-filename=/var/run/outline_controller --owning-user-id=1000

июн 27 17:00:47 too-Inspiron-3542 systemd[1]: Started Outline Proxy Routing Controller.
июн 27 17:00:47 too-Inspiron-3542 OutlineProxyController[3404848]: 1687849247.887287: [WARN] tune device outline-tun0 already exists. is another instance of outline>
июн 27 17:00:47 too-Inspiron-3542 OutlineProxyController[3404848]: 1687849247.893725: [INFO] successfully set the tun device ip address
июн 27 17:00:47 too-Inspiron-3542 OutlineProxyController[3404848]: 1687849247.895732: [INFO] successfully added outline gateway routing entry
июн 27 17:00:47 too-Inspiron-3542 OutlineProxyController[3404848]: 1687849247.897797: [ERROR] Error: any valid prefix is expected rather than "".
июн 27 17:00:47 too-Inspiron-3542 OutlineProxyController[3404848]: 
июн 27 17:00:47 too-Inspiron-3542 OutlineProxyController[3404848]: 1687849247.897938: [WARN] unable to query the default route to the outline proxy
июн 27 17:00:47 too-Inspiron-3542 OutlineProxyController[3404848]: 1687849247.898030: [WARN] we could not detect the best interface, will try again at connect
июн 27 17:00:47 too-Inspiron-3542 OutlineProxyController[3404848]: updated unix socket owner to 4294967295,1001

Unfortunately, outline still does not connect.

I noticed that there is a warning about device outline-tun0 already exists. is another instance of outline. i did pkill -9 outline-client, and tried to connect another time - no success.

Then i gave up and came here.

jyyi1 commented 1 year ago

Hi @karrakoliko ,

From the log message:

     CGroup: /system.slice/outline_proxy_controller.service
             └─3404848 /usr/local/sbin/OutlineProxyController --socket-filename=/var/run/outline_controller --owning-user-id=1000
...
июн 27 17:00:47 too-Inspiron-3542 OutlineProxyController[3404848]: updated unix socket owner to 4294967295,1001

It seems the OutlineProxyController failed to set the --owning-user-id (of /var/run/outline_controller) to 1000, because the socket owner is 4294967295 (aka -1). And -1 here basically means only root is able to access /var/run/outline_controller.

As a workaround, could you please set the /var/run/outline_controller's owner to the UID that is gonna launch Outline Client manually? Maybe through chown <your-uid>:1001 /var/run/outline_controller.

karrakoliko commented 1 year ago

Hi @karrakoliko ,

From the log message:

     CGroup: /system.slice/outline_proxy_controller.service
             └─3404848 /usr/local/sbin/OutlineProxyController --socket-filename=/var/run/outline_controller --owning-user-id=1000
...
июн 27 17:00:47 too-Inspiron-3542 OutlineProxyController[3404848]: updated unix socket owner to 4294967295,1001

It seems the OutlineProxyController failed to set the --owning-user-id (of /var/run/outline_controller) to 1000, because the socket owner is 4294967295 (aka -1). And -1 here basically means only root is able to access /var/run/outline_controller.

As a workaround, could you please set the /var/run/outline_controller's owner to the UID that is gonna launch Outline Client manually? Maybe through chown <your-uid>:1001 /var/run/outline_controller.

works now. may i expect that it will work by default in the next update, without terminal and github-sourced workarounds?

i can provide more debug info (if needed to implement fix

jyyi1 commented 1 year ago

Yes, error logs from Outline Client will be useful, you can get that by running Outline Client in Terminal: OUTLINE_DEBUG=true ./Outline-Client.AppImage.

And one additional question: did you see the "Root Password Dialog" before the client shows the initialization error? If not, that might be because of the UI framework used in Mint that we (the 3rd party library that we are depending on) do not support:

On Linux, sudo-prompt will use either pkexec or kdesudo to show the password prompt.

karrakoliko commented 1 year ago

did you see the "Root Password Dialog" before the client shows the initialization error?

yes

Yes, error logs from Outline Client will be useful, you can get that by running Outline Client in Terminal: OUTLINE_DEBUG=true ./Outline-Client.AppImage

this log is collected after your workaround (chown <your-uid>:1001 /var/run/outline_controller) applied:

too@too-Inspiron-3542:~$ OUTLINE_DEBUG=true /opt/Outline-Client.AppImage
Sentry Logger [log]: Starting Electron crashReporter
Sentry Logger [log]: Integration installed: SentryMinidump
Sentry Logger [log]: Integration installed: ElectronBreadcrumbs
Sentry Logger [log]: Integration installed: Net
Sentry Logger [log]: Integration installed: MainContext
Sentry Logger [log]: Integration installed: ChildProcess
Sentry Logger [log]: Integration installed: OnUncaughtException
Sentry Logger [log]: Integration installed: PreloadInjection
Sentry Logger [log]: Integration installed: AdditionalContext
Sentry Logger [log]: Integration installed: Screenshots
Sentry Logger [log]: Integration installed: InboundFilters
Sentry Logger [log]: Integration installed: FunctionToString
Sentry Logger [log]: Integration installed: Console
Sentry Logger [log]: Integration installed: Http
Sentry Logger [log]: Integration installed: OnUnhandledRejection
Sentry Logger [log]: Integration installed: ContextLines
Sentry Logger [log]: Integration installed: LocalVariables
Sentry Logger [log]: Integration installed: Modules
Sentry Logger [log]: Integration installed: RequestData
Sentry Logger [log]: Integration installed: LinkedErrors
Sentry Logger [log]: Integration installed: MainProcessSession
Sentry Logger [log]: The preload script could not be injected automatically. This is most likely caused by bundling of the main process
Outline is starting
loading web app from file:///tmp/.mount_Outlinx6ZRqr/resources/app.asar/www/index_electron.html?debug=true&appName=Outline
Sentry Logger [log]: Found 0 minidumps
Could not load active tunnel:  [Error: ENOENT: no such file or directory, open '/home/too/.config/Outline/connection_store'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/home/too/.config/Outline/connection_store'
}
connecting to fa01e0e5-79fe-4143-adea-21b6021a26f8...
using tun2socks to check connectivity
[EXIT - tun2socks]: Exited with code 0
UDP support: true
starting routing daemon
[STDERR - tun2socks]: 2023/07/11 12:52:17 tun2socks running...

tun2socks started
2023/07/11 12:52:17 tun2socks running...
connected to fa01e0e5-79fe-4143-adea-21b6021a26f8
[STDERR - tun2socks]: 2023/07/11 12:52:35 Received signal: terminated

2023/07/11 12:52:35 Received signal: terminated
[EXIT - tun2socks]: Exited with code 0
tun2socks exited with no errors
disconnected from fa01e0e5-79fe-4143-adea-21b6021a26f8
karrakoliko commented 1 year ago

after restart it is broken again.

i opened outline client with debug, pressed connect, then password request appeared. i entered password, error "Unfortunately we are not able to initialize Outline, please submit feedback through the app." appeared, client did not connect.

here is a log

too@too-Inspiron-3542:~$ OUTLINE_DEBUG=true /opt/Outline-Client.AppImage
Sentry Logger [log]: Starting Electron crashReporter
Sentry Logger [log]: Integration installed: SentryMinidump
Sentry Logger [log]: Integration installed: ElectronBreadcrumbs
Sentry Logger [log]: Integration installed: Net
Sentry Logger [log]: Integration installed: MainContext
Sentry Logger [log]: Integration installed: ChildProcess
Sentry Logger [log]: Integration installed: OnUncaughtException
Sentry Logger [log]: Integration installed: PreloadInjection
Sentry Logger [log]: Integration installed: AdditionalContext
Sentry Logger [log]: Integration installed: Screenshots
Sentry Logger [log]: Integration installed: InboundFilters
Sentry Logger [log]: Integration installed: FunctionToString
Sentry Logger [log]: Integration installed: Console
Sentry Logger [log]: Integration installed: Http
Sentry Logger [log]: Integration installed: OnUnhandledRejection
Sentry Logger [log]: Integration installed: ContextLines
Sentry Logger [log]: Integration installed: LocalVariables
Sentry Logger [log]: Integration installed: Modules
Sentry Logger [log]: Integration installed: RequestData
Sentry Logger [log]: Integration installed: LinkedErrors
Sentry Logger [log]: Integration installed: MainProcessSession
Sentry Logger [log]: The preload script could not be injected automatically. This is most likely caused by bundling of the main process
Outline is starting
loading web app from file:///tmp/.mount_OutlinoGv5f6/resources/app.asar/www/index_electron.html?debug=true&appName=Outline
Sentry Logger [log]: Found 0 minidumps
Could not load active tunnel:  [Error: ENOENT: no such file or directory, open '/home/too/.config/Outline/connection_store'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/home/too/.config/Outline/connection_store'
}
connecting to fa01e0e5-79fe-4143-adea-21b6021a26f8...
using tun2socks to check connectivity
[EXIT - tun2socks]: Exited with code 0
UDP support: true
starting routing daemon
Routing daemon socket setup failed Error: connect ENOENT /var/run/outline_controller
    at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'connect',
  address: '/var/run/outline_controller'
}
could not connect: w (routing daemon is not running)
[STDERR - tun2socks]: 2023/07/11 20:50:03 Failed to open TUN device: ioctl: operation not permitted

2023/07/11 20:50:03 Failed to open TUN device: ioctl: operation not permitted
[EXIT - tun2socks]: Exited with code 12
could not stop tun2socks: Process terminated by non-zero exit code: 12
tun2socks terminated due to Error: Process terminated by non-zero exit code: 12
disconnected from fa01e0e5-79fe-4143-adea-21b6021a26f8
installing outline routing service...
copying service installation files to /tmp/x0IsCa
all service installation files copied to /tmp/x0IsCa successfully
trying to run command as root:  trap "/usr/bin/chattr -R -i /tmp/x0IsCa" EXIT; /usr/bin/chattr -R +i /tmp/x0IsCa && /usr/bin/echo "e0644a3750b6c770e4f2f2e2e7de0de1e46386eed733d7841f35d9e4aa53c1cd  /tmp/x0IsCa/install_linux_service.sh" | /usr/bin/shasum -a 256 -c && /usr/bin/echo "0a2d2b874d4d200145b1e3a7cc5818fb27e5c0ed69ebb4f4057e066e0b7fdc4a  /tmp/x0IsCa/OutlineProxyController" | /usr/bin/shasum -a 256 -c && /usr/bin/echo "8bfab08036441bcbb558927bdecd97eebf8c2d365a2a7fdb6c0032c2afc965a2  /tmp/x0IsCa/outline_proxy_controller.service" | /usr/bin/shasum -a 256 -c && "/tmp/x0IsCa/install_linux_service.sh" "too"

/usr/bin/chattr: Operation not supported while reading flags on /tmp/x0IsCa
/usr/bin/chattr: Operation not supported while reading flags on /tmp/x0IsCa

command is running as root but failed:  Error: Command failed: cd "/home/too"; "/usr/bin/pkexec" --disable-internal-agent /bin/bash -c "echo SUDOPROMPT; trap \"/usr/bin/chattr -R -i /tmp/x0IsCa\" EXIT; /usr/bin/chattr -R +i /tmp/x0IsCa && /usr/bin/echo \"e0644a3750b6c770e4f2f2e2e7de0de1e46386eed733d7841f35d9e4aa53c1cd  /tmp/x0IsCa/install_linux_service.sh\" | /usr/bin/shasum -a 256 -c && /usr/bin/echo \"0a2d2b874d4d200145b1e3a7cc5818fb27e5c0ed69ebb4f4057e066e0b7fdc4a  /tmp/x0IsCa/OutlineProxyController\" | /usr/bin/shasum -a 256 -c && /usr/bin/echo \"8bfab08036441bcbb558927bdecd97eebf8c2d365a2a7fdb6c0032c2afc965a2  /tmp/x0IsCa/outline_proxy_controller.service\" | /usr/bin/shasum -a 256 -c && \"/tmp/x0IsCa/install_linux_service.sh\" \"too\""
/usr/bin/chattr: Operation not supported while reading flags on /tmp/x0IsCa
/usr/bin/chattr: Operation not supported while reading flags on /tmp/x0IsCa

    at ChildProcess.exithandler (node:child_process:408:12)
    at ChildProcess.emit (node:events:526:28)
    at ChildProcess.emit (node:domain:475:12)
    at maybeClose (node:internal/child_process:1092:16)
    at Socket.<anonymous> (node:internal/child_process:451:11)
    at Socket.emit (node:events:526:28)
    at Socket.emit (node:domain:475:12)
    at Pipe.<anonymous> (node:net:687:12) {
  killed: false,
  code: 1,
  signal: null,
  cmd: 'cd "/home/too"; "/usr/bin/pkexec" --disable-internal-agent /bin/bash -c "echo SUDOPROMPT; trap \\"/usr/bin/chattr -R -i /tmp/x0IsCa\\" EXIT; /usr/bin/chattr -R +i /tmp/x0IsCa && /usr/bin/echo \\"e0644a3750b6c770e4f2f2e2e7de0de1e46386eed733d7841f35d9e4aa53c1cd  /tmp/x0IsCa/install_linux_service.sh\\" | /usr/bin/shasum -a 256 -c && /usr/bin/echo \\"0a2d2b874d4d200145b1e3a7cc5818fb27e5c0ed69ebb4f4057e066e0b7fdc4a  /tmp/x0IsCa/OutlineProxyController\\" | /usr/bin/shasum -a 256 -c && /usr/bin/echo \\"8bfab08036441bcbb558927bdecd97eebf8c2d365a2a7fdb6c0032c2afc965a2  /tmp/x0IsCa/outline_proxy_controller.service\\" | /usr/bin/shasum -a 256 -c && \\"/tmp/x0IsCa/install_linux_service.sh\\" \\"too\\""'
}
jyyi1 commented 1 year ago

after restart it is broken again. ... connect ENOENT /var/run/outline_controller

It seems the OS removed /var/run/outline_controller after the restart? Why is it happening? Because normally Ubuntu won't do that.

/usr/bin/chattr: Operation not supported while reading flags on /tmp/x0IsCa

This might be caused by a known issue: Outline initialization will fail if /tmp/ folder is a symbolic link. That's why our only officially supported Linux distro is Ubuntu right now.

karrakoliko commented 1 year ago

@jyyi1 i have no answers for you, i am just an end user who wants use outline. all i can do - report, collect some logs and describe a problem

sneeek44 commented 1 year ago

Yes, error logs from Outline Client will be useful, you can get that by running Outline Client in Terminal: OUTLINE_DEBUG=true ./Outline-Client.AppImage.

And one additional question: did you see the "Root Password Dialog" before the client shows the initialization error? If not, that might be because of the UI framework used in Mint that we (the 3rd party library that we are depending on) do not support:

On Linux, sudo-prompt will use either pkexec or kdesudo to show the password prompt.

I am so happy, that one worked for me.

Thank you!

sneeek44 commented 1 year ago

After reinstalling the system not working anymore.

No such file in the /var/run/

jyyi1 commented 1 year ago

Hi @sneeek44 ,

If the file is gone, you just need to make sure the daemon is running normally. The daemon will create that file (and it should always start with the OS if you configured the service correctly).

jyyi1 commented 1 year ago

Hi @karrakoliko , /var/run is mounted as tmpfs which will be removed every time the OS restarts. But as I mentioned above, the outline_proxy_controller daemon should start automatically with the OS and recreate that file. So I think you may need to make sure this Outline daemon is actually running normally every time you restarted the OS.

maddsua commented 10 months ago

So basically outline-client didn't wanted to work on Debian 12. I went as far as manually installing the proxy service, but the solution was to get pkexec package installed instead. Then, the initialization went as smooth as it can get. Sorry guys, but the logs are a fucking mess

notgurev commented 6 months ago

For anyone who got here by installing Outline Client from Software Manager on Mint, like I did:

I was getting the same error message, and nothing seemed to fix the problem, except for removing it from Software Manager, downloading the AppImage from the website, and launching it directly (after chmod u+x). Runs perfectly fine now.