Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tribler 8.0.7 Does Not Launch on Alpine Linux 3.21.2 x86_64 #8388

Open
crftbt opened this issue Jan 14, 2025 · 7 comments · Fixed by #8401
Open

Tribler 8.0.7 Does Not Launch on Alpine Linux 3.21.2 x86_64 #8388

crftbt opened this issue Jan 14, 2025 · 7 comments · Fixed by #8401
Milestone

Comments

@crftbt
Copy link

crftbt commented Jan 14, 2025

There doesn't appear to be an Alpine Linux package for Tribler, but flatpak does work on Alpine. When attempting to launch Tribler through flatpak, the following error is output and Tribler fails to launch. Running as root has a similar message. What would be advised in this situation?

~ $ tribler 
Starting Tribler...
/usr/share/tribler ~
mktemp: : Invalid argument
/usr/bin/tribler: line 7: `mktemp /tmp/$USER-tribler-XXXXXXXX.log`: ambiguous redirect
~
~ $
~ $ doas tribler
Starting Tribler...
/usr/share/tribler /home/user
mktemp: : Invalid argument
/usr/bin/tribler: line 7: `mktemp /tmp/$USER-tribler-XXXXXXXX.log`: ambiguous redirect
/home/user
~ $ 
~ $ uname -a
Linux hotsname 6.12.9-0-lts #1-Alpine SMP PREEMPT_DYNAMIC 2025-01-09 18:01:12 x86_64 Linux
@qstokkink
Copy link
Contributor

I'm not entirely sure (I don't use Alpine), but I think this means that the /tmp directory does not exist or has odd permissions. I found another issue that suggests this: http s://github. com/srvrco/ getssl/issues/612#issuecomment-740694339

@crftbt
Copy link
Author

crftbt commented Jan 16, 2025

I'm not entirely sure (I don't use Alpine), but I think this means that the /tmp directory does not exist or has odd permissions. I found another issue that suggests this: http s://github. com/srvrco/ getssl/issues/612#issuecomment-740694339

Hello @qstokkink appreciate you taking the time to comment. The /tmp/ directory exists and the permissions appear to be fine. I believe the error message is pointing to the ambiguous redirect.

$ ls -lad /tmp/
drwxrwxrwt   21 root     root           520 Jan 16 12:49 /tmp/

$ tribler 
Starting Tribler...
/usr/share/tribler ~
mktemp: : Invalid argument
/usr/bin/tribler: line 7: `mktemp /tmp/$USER-tribler-XXXXXXXX.log`: ambiguous redirect
~

$ doas chmod 777 /tmp/

$ ls -lad /tmp/
drwxrwxrwx   21 root     root           520 Jan 16 12:49 /tmp/

$ tribler 
Starting Tribler...
/usr/share/tribler ~
mktemp: : Invalid argument
/usr/bin/tribler: line 7: `mktemp /tmp/$USER-tribler-XXXXXXXX.log`: ambiguous redirect
~
$ 

@qstokkink
Copy link
Contributor

Thanks for checking. Another thing I'm spotting on the Internet, is that some versions of mktemp require exactly 6 X's (we have 8).

exec /usr/share/tribler/tribler "$@" > `mktemp /tmp/$USER-tribler-XXXXXXXX.log` 2>&1

@qstokkink qstokkink added this to the 8.1.0 milestone Jan 20, 2025
@qstokkink qstokkink self-assigned this Jan 20, 2025
@crftbt
Copy link
Author

crftbt commented Jan 21, 2025

Thanks for checking. Another thing I'm spotting on the Internet, is that some versions of mktemp require exactly 6 X's (we have 8).

tribler/build/debian/tribler/usr/bin/tribler

Line 7 in bb7aa54
exec /usr/share/tribler/tribler "$@" > mktemp /tmp/$USER-tribler-XXXXXXXX.log 2>&1

I don't see a difference with 6 X's:

~$ doas vi /usr/bin/tribler 

~$ tribler 
Starting Tribler...
/usr/share/tribler ~
mktemp: : Invalid argument
/usr/bin/tribler: line 7: `mktemp /tmp/$USER-tribler-XXXXXX.log`: ambiguous redirect
~

~$ grep X /usr/bin/tribler 
exec /usr/share/tribler/tribler "$@" > `mktemp /tmp/$USER-tribler-XXXXXX.log` 2>&1

~$ 

@qstokkink
Copy link
Contributor

Another reason, I found when searching, was that a lack of block quotes could cause the "ambiguous redirect", I also made that a part of #8401. If that also doesn't fix it, I'll reopen this.

So, essentially, the standalone fix is mktemp "/tmp/$USER-tribler-XXXXXX.log", instead of mktemp /tmp/$USER-tribler-XXXXXXXX.log.

@crftbt
Copy link
Author

crftbt commented Jan 22, 2025

Another reason, I found when searching, was that a lack of block quotes could cause the "ambiguous redirect", I also made that a part of #8401. If that also doesn't fix it, I'll reopen this.

So, essentially, the standalone fix is mktemp "/tmp/$USER-tribler-XXXXXX.log", instead of mktemp /tmp/$USER-tribler-XXXXXXXX.log.

Still seeing ambiguous redirect when adding double quotes around the path in the /usr/bin/tribler bash script.

$ tribler 
Starting Tribler...
/usr/share/tribler ~
mktemp: : Invalid argument
/usr/bin/tribler: line 7: `mktemp "/tmp/$USER-tribler-XXXXXX.log"`: ambiguous redirect
~

~$ cat /usr/bin/tribler 
#!/bin/bash
# Startup script for Ubuntu Linux

echo "Starting Tribler..."

pushd "/usr/share/tribler"
exec /usr/share/tribler/tribler "$@" > `mktemp "/tmp/$USER-tribler-XXXXXX.log"` 2>&1
popd

~$ 

@qstokkink qstokkink reopened this Jan 23, 2025
@qstokkink
Copy link
Contributor

That is quite odd. That said, there are only so many things that can possibly go wrong here.

Could you try running through the following options?

  1. mktemp "/tmp/tribler-XXXXXX.log"
  2. mktemp "~/$USER-tribler-XXXXXX.log"
  3. mktemp "~/tribler-XXXXXX.log"

In the very worst case, you could replace the line with exec /usr/share/tribler/tribler "$@" > ~/tribler.log 2>&1 But, you'll end up with the log file in your home folder instead of your tmp directory, of course.

@qstokkink qstokkink removed their assignment Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants