rusq / slackdump

Save or export your private and public Slack messages, threads, files, and users locally without admin privileges.
GNU General Public License v3.0
1.51k stars 70 forks source link

Auth broken on Ubuntu 24.04 #293

Closed Samir-Rashid closed 2 months ago

Samir-Rashid commented 3 months ago

Describe the bug The tool fails to launch auth on Ubuntu 24.04. It works on 22.04.4. No authentication method works as the browser will not launch.

To Reproduce Steps to reproduce the behavior:

  1. Install Ubuntu 24.04. (You can use VM. Updating packages is optional, does not change behavior)
  2. Run tool
  3. Launching chromium fails

Expected behavior I expect the tool to work as it does on Ubuntu 22.

Output

./slackdump
Slackdump 2.5.8 (commit: 8bcedfa247d4b93480c04dac3510082b8e206813) built on: 2024-04-07T09:46:00Z
2024/06/26 00:25:35 failed to initialise the auth provider: browser automation error: failed to launch: [launcher] Failed to get the debug url: [3029:3029:0626/002533.988866:FATAL:zygote_host_impl_linux.cc(127)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/main/docs/linux/suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.
#0 0x5d57b9436842 base::debug::CollectStackTrace()
#1 0x5d57b94231e3 base::debug::StackTrace::StackTrace()
#2 0x5d57b9374034 logging::LogMessage::~LogMessage()
#3 0x5d57b7b483f6 content::ZygoteHostImpl::Init()
#4 0x5d57b88c9572 content::ContentMainRunnerImpl::Initialize()
#5 0x5d57b88c7047 content::RunContentProcess()
#6 0x5d57b88c73b6 content::ContentMain()
#7 0x5d57b4fe7309 ChromeMain
#8 0x7de1df02a1ca (/usr/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9)
#9 0x7de1df02a28b __libc_start_main
#10 0x5d57b4fe702a _start
Crash keys:
  "switch-22" = "--user-data-dir=/tmp/rod/user-data/5144834e4c724fce"
  "switch-21" = "--use-mock-keychain"
  "switch-20" = "--remote-debugging-port=0"
  "switch-19" = "--no-startup-window"
  "switch-18" = "--no-first-run"
  "switch-17" = "--metrics-recording-only"
  "switch-16" = "--force-color-profile=srgb"
  "switch-15" = "--enable-automation"
  "switch-14" = "--disable-sync"
  "switch-13" = "--disable-renderer-backgrounding"
  "switch-12" = "--disable-prompt-on-repost"
  "switch-11" = "--disable-popup-blocking"
  "switch-10" = "--disable-ipc-flooding-protection"
  "switch-9" = "--disable-hang-monitor"
  "switch-8" = "--disable-dev-shm-usage"
  "switch-7" = "--disable-default-apps"
  "switch-6" = "--disable-component-extensions-with-background-pages"
  "switch-5" = "--disable-client-side-phishing-detection"
  "switch-4" = "--disable-breakpad"
  "switch-3" = "--disable-backgrounding-occluded-windows"
  "switch-2" = "--disable-background-timer-throttling"
  "switch-1" = "--disable-background-networking"
  "num-switches" = "24"
  "commandline-disabled-feature-2" = "TranslateUI"
  "commandline-disabled-feature-1" = "site-per-process"
  "commandline-enabled-feature-2" = "NetworkServiceInProcess"
  "commandline-enabled-feature-1" = "NetworkService"
  "osarch" = "x86_64"
  "pid" = "3029"
  "ptype" = "browser"

[0626/002534.106266:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[0626/002534.106327:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)

The relevant info is on the first line of the error.

Desktop:

Additional context Some additional things which did not work: According to slackdump -h,

  -browser value
        set the browser to use for authentication: 'chromium' or 'firefox' (default: firefox)

but the default behavior is using chromium and ./slackdump -browser=firefox still tries to launch chromium.

When using -legacy-browser, firefox launches but the puppeteer automation does not work at firefox remains on a blank page and I cannot navigate.

Furthermore, trying to set the token does not work. -t and setting SLACK_TOKEN=... still try to do interactive auth process. These try to launch the browser, which crashes as described above.

kyle-sutherland commented 3 months ago

Hello I am having the same issue.

What I tried: sudo sysctl -w kernel.unpriveleged_userns_clone=1 and: checked that user.max_user_namespaces has non zero value

neither of these worked

What I will try: Setting up a VM running openSUSE or some other distro with a different kernel and trying to run from there

rusq commented 2 months ago

@kyle-sutherland before I install the VM, have you had any luck reproducing this on another OS?

rusq commented 2 months ago

Works on my

Linux rpi5 6.6.31+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.31-1+rpt1 (2024-05-29) aarch64 GNU/Linux

I'll see if there's rod update available.

ianbmacdonald commented 2 months ago

I just stumbled on to this on current 24.04; I don't quite understand the issue, but had different output between the sudo and non-sudo attempts I will share modifed exerpts below

`$ ./slackdump -f -export 240705_std.zip -export-type standard Slackdump 2.5.8 (commit: 8bcedfa247d4b93480c04dac3510082b8e206813) built on: 2024-04-07T09:46:00Z 2024/07/06 10:14:29 failed to initialise the auth provider: browser automation error: failed to launch: [launcher] Failed to get the debug url: [113626:113626:0706/101428.173713:FATAL:zygote_host_impl_linux.cc(127)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/main/docs/linux/suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.

0 0x595a1c306842 base::debug::CollectStackTrace()

1 0x595a1c2f31e3 base::debug::StackTrace::StackTrace()

2 0x595a1c244034 logging::LogMessage::~LogMessage()

3 0x595a1aa183f6 content::ZygoteHostImpl::Init()

4 0x595a1b799572 content::ContentMainRunnerImpl::Initialize()

5 0x595a1b797047 content::RunContentProcess()

6 0x595a1b7973b6 content::ContentMain()

7 0x595a17eb7309 ChromeMain

8 0x7de1fea2a1ca (/usr/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9)

9 0x7de1fea2a28b __libc_start_main

10 0x595a17eb702a _start

Crash keys: "switch-22" = "--user-data-dir=/tmp/rod/user-data/4e8b7f94106ce74e" "switch-21" = "--use-mock-keychain" "switch-20" = "--remote-debugging-port=0" "switch-19" = "--no-startup-window" "switch-18" = "--no-first-run" "switch-17" = "--metrics-recording-only" "switch-16" = "--force-color-profile=srgb" "switch-15" = "--enable-automation" "switch-14" = "--disable-sync" "switch-13" = "--disable-renderer-backgrounding" "switch-12" = "--disable-prompt-on-repost" "switch-11" = "--disable-popup-blocking" "switch-10" = "--disable-ipc-flooding-protection" "switch-9" = "--disable-hang-monitor" "switch-8" = "--disable-dev-shm-usage" "switch-7" = "--disable-default-apps" "switch-6" = "--disable-component-extensions-with-background-pages" "switch-5" = "--disable-client-side-phishing-detection" "switch-4" = "--disable-breakpad" "switch-3" = "--disable-backgrounding-occluded-windows" "switch-2" = "--disable-background-timer-throttling" "switch-1" = "--disable-background-networking" "num-switches" = "24" "commandline-disabled-feature-2" = "TranslateUI" "commandline-disabled-feature-1" = "site-per-process" "commandline-enabled-feature-2" = "NetworkServiceInProcess" "commandline-enabled-feature-1" = "NetworkService" "osarch" = "x86_64" "pid" = "113626" "ptype" = "browser" ` Using sudo avoided the crash and pulled down a local chromium snapshot;

$ sudo ./slackdump -f -export 240705_std.zip -export-type standard [sudo] password for imac: Slackdump 2.5.8 (commit: 8bcedfa247d4b93480c04dac3510082b8e206813) built on: 2024-04-07T09:46:00Z [launcher.Browser]2024/07/06 10:16:39 Download: https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/1131657/chrome-linux.zip [launcher.Browser]2024/07/06 10:16:39 Progress: 00% [launcher.Browser]2024/07/06 10:16:40 Progress: 18% [launcher.Browser]2024/07/06 10:16:41 Progress: 42% [launcher.Browser]2024/07/06 10:16:42 Progress: 62% [launcher.Browser]2024/07/06 10:16:43 Progress: 89% [launcher.Browser]2024/07/06 10:16:43 Unzip: /root/.cache/rod/browser/chromium-1131657 [launcher.Browser]2024/07/06 10:16:43 Progress: 00% [launcher.Browser]2024/07/06 10:16:44 Progress: 30% [launcher.Browser]2024/07/06 10:16:45 Progress: 68% [launcher.Browser]2024/07/06 10:16:46 Downloaded: /root/.cache/rod/browser/chromium-1131657 2024/07/06 10:16:47 failed to initialise the auth provider: browser automation error: failed to launch: [launcher] Failed to get the debug url: [113726:113726:0706/101646.256670:ERROR:zygote_host_impl_linux.cc(100)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.

I have an older headless 23.10 instance I can use for the time being if my provider.bin is still valid. But I am not keen to roll over the 30 day history without a backup if that does not work.

Is there an auth method / option combo that works around this issue on 24.04? (Assuming not, but please post if so).

rusq commented 2 months ago

@ianbmacdonald

  1. the only workaround for now is to use the manual authentication method (as in getting token and cookies from browser manually). I have high hopes that when I bump the version of "rod", it will fix the browser interaction.
  2. provider.bin is encrypted using machine id, so it would not be possible to transfer it between machines
rusq commented 2 months ago

Merged the update into v2 branch. Are you able to compile and try and run it, or would you rather wait until I fix other stuff and release v2.5.9?

kyle-sutherland commented 2 months ago

I'll try to compile and run that. Thanks a bunch

On Sun, Jul 7, 2024, 00:56 Rustam @.***> wrote:

Merged the update into v2 branch. Are you able to compile and try and run it, or would you rather wait until I fix other stuff and release v2.5.9?

— Reply to this email directly, view it on GitHub https://github.com/rusq/slackdump/issues/293#issuecomment-2212345945, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARC7IKVTK5NTZ2UDVA23UJDZLDRA5AVCNFSM6AAAAABJ5JS7ZGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJSGM2DKOJUGU . You are receiving this because you were mentioned.Message ID: @.***>

ianbmacdonald commented 2 months ago

Not paying attention, dropped my comment on https://github.com/rusq/slackdump/pull/298

kyle-sutherland commented 2 months ago

Okay, it works on the v2 branch with -legacy-browser

rusq commented 2 months ago

@kyle-sutherland thanks for checking! So, it works with -legacy-browser but doesn't work with the rod one?

rusq commented 2 months ago

@Samir-Rashid, just read in your initial message - you can't go with just the token, unless it's the legacy/application/bot token, xoxc- token will always require -c parameter to be set, as client tokens don't work without cookies.

ianbmacdonald commented 2 months ago

I also had success with the v2 branch using -legacy-browser. I did accidentally clone the v3/master initially, and it did not work using -legacy-browser

rusq commented 2 months ago

So, looks like legacy is not so legacy, after all, huh? 😂

Could someone on the problematic OS confirm that -legacy-browser=false also works please (uses rod)?

rusq commented 2 months ago

If it works, I'll push v2.5.9

rusq commented 2 months ago

Releasing 2.5.9