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

userSetup.sh errors with no TRANSMISSION_UMASK environment variable #2585

Closed
8 tasks done
odwulf opened this issue Apr 17, 2023 · 10 comments
Closed
8 tasks done

userSetup.sh errors with no TRANSMISSION_UMASK environment variable #2585

odwulf opened this issue Apr 17, 2023 · 10 comments

Comments

@odwulf
Copy link

odwulf commented Apr 17, 2023

Is there a pinned issue for this?

  • I have read the pinned issues and could not find my issue

Is there an existing or similar issue/discussion for this?

  • I have searched the existing issues
  • I have searched the existing discussions

Is there any comment in the documentation for this?

  • I have read the documentation, especially the FAQ and Troubleshooting parts

Is this related to a provider?

  • I have checked the provider repo for issues
  • My issue is NOT related to a provider

Are you using the latest release?

  • I am using the latest release

Have you tried using the dev branch latest?

  • I have tried using dev branch

Docker run config used

No TRANSMISSION_UMASK environment variable (I don;t think anything else is relevant.)

Current Behavior

When the container is launched with no TRANSMISSION_UMASK environment variable, it reads the umask value from the configuration file where, by default, it is a string: "umask": "002",. UserSetup.sh throws errors (see more compelte log below):

/etc/transmission/userSetup.sh: line 56: "002": syntax error: operand expected (error token is ""002"")
umask: 60
Directories: 
/etc/transmission/userSetup.sh: line 57: "002": syntax error: operand expected (error token is ""002"")
chmod: invalid mode: ''

Expected Behavior

No error message. Chmod works.

How have you tried to solve the problem?

I manually changed "002" to the unquoted 002 in the config file, and the errors disappeared. I tried setting TRANSMISSION_UMASK to both "002" and 002 and there are no error either. It's only when running on default settings that the errors appear (I never changed that value and never set the environment variable.

Note that setting the environment variable to "002" or 002 updates the value in the config file to the quoted "002", meaning that the error reappears if I remove the environment variable.

I tried to changed the relevant line in userStartup.sh to the following and it seemed to work as well, but I don't know if it can have any side effect:

TRANSMISSION_UMASK=$(jq '.umask | tonumber' ${TRANSMISSION_HOME}/settings.json)

Log output

/etc/transmission/userSetup.sh: line 56: "002": syntax error: operand expected (error token is ""002"")
umask: 60
Directories: 
/etc/transmission/userSetup.sh: line 57: "002": syntax error: operand expected (error token is ""002"")
chmod: invalid mode: ''

HW/SW Environment

- OS: Synology
- Docker: 20.10.3

Anything else?

No response

@jjnj023
Copy link

jjnj023 commented Apr 25, 2023

Same issue here.

@pkishino
Copy link
Collaborator

Can you replicate this with a fresh container? That is, completely blank start ( 5.0.2 image, no previous settings.json etc) ?
I tried it here but did not have this issue

@odwulf
Copy link
Author

odwulf commented Apr 27, 2023

I tried with the #latest image, which, as of the time of writing is indeed 5.0,2. Using the exact same Compose file, but for the paths pointing to empty folders and was able to reproduce: create the container and it creates the settings file, restart the container, it tries to read the settings file and throw the error.

BUT, I tried to remove all of my environment variables one by one to see if something makes a difference, and it appears that if I remove PUID and PGID, the error disappears. And indeed, userSetup.sh is mostly a big IF statement that only runs when PUID is set and is not root.

So you might be able to replicate by setting a non-zero UID ...

@UnconditionalLoop
Copy link

UnconditionalLoop commented Apr 29, 2023

Same problem.
Yes, You can get rid of this error with

  • GLOBAL_APPLY_PERMISSIONS=false

but it still never uses the settings.json. I can override with this, so it doesnt overwrite the file:

  • TRANSMISSION_HOME=/config/transmission-home

It however, still overwrites all the environment variables that are inside cat /etc/transmission/environment-variables.sh regardless of what happens.

@pkishino
Copy link
Collaborator

ok, think I have a fix for this..

@pkishino
Copy link
Collaborator

fixed in above commit

@dorianps
Copy link

dorianps commented Jun 14, 2023

Is the container updated with the fix? This is what I get still with :latest tag pulled and used.

Setting owner for transmission paths to 1026:100
Setting permissions for download and incomplete directories
/etc/transmission/userSetup.sh: line 56: "002": syntax error: operand expected (error token is ""002"")
/etc/transmission/userSetup.sh: line 57: "002": syntax error: operand expected (error token is ""002"")
umask: 60
Directories:
Files:
chmod: invalid mode: ''
Try 'chmod --help' for more information.
chmod: invalid mode: ''
Try 'chmod --help' for more information.
chmod: invalid mode: ''
Try 'chmod --help' for more information.
chmod: invalid mode: ''
Try 'chmod --help' for more information.
chmod: invalid mode: ''
Try 'chmod --help' for more information.
chmod: invalid mode: ''
Try 'chmod --help' for more information.
chmod: invalid mode: ''
Try 'chmod --help' for more information.
chmod: invalid mode: ''
Try 'chmod --help' for more information.
chmod: invalid mode: ''
Try 'chmod --help' for more information.
chmod: invalid mode: ''
Try 'chmod --help' for more information.
chmod: invalid mode: ''
Try 'chmod --help' for more information.
chmod: invalid mode: ''
Try 'chmod --help' for more information.
chmod: invalid mode: ''
Try 'chmod --help' for more information.
chmod: invalid mode: ''
Try 'chmod --help' for more information.
chmod: invalid mode: ''
Try 'chmod --help' for more information.
Setting permission for watch directory (775) and its files (664)

-------------------------------------
Transmission will run as
-------------------------------------
User name:   abc
User uid:    1026
User gid:    100
-------------------------------------

@pkishino
Copy link
Collaborator

It’s on dev branch

@dorianps
Copy link

When does it become :latest ? What's the usual timeline to get in production branch ?

@pkishino
Copy link
Collaborator

Posted to master
#2632

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants