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

/usr/bin/samba.sh: line 140: $2: unbound variable #219

Closed
millermarkj opened this issue Jul 10, 2019 · 7 comments
Closed

/usr/bin/samba.sh: line 140: $2: unbound variable #219

millermarkj opened this issue Jul 10, 2019 · 7 comments
Assignees

Comments

@millermarkj
Copy link

I use v2tec/watchtower to keep my containers updated. samba updated last night and now won't run. Starting it manually reports:

mark@system:/opt/svc/samba$ docker-compose up
Recreating samba_samba_1 ... done
Attaching to samba_samba_1
samba_1  | /usr/bin/samba.sh: line 140: $2: unbound variable
samba_samba_1 exited with code 1

Based on a prior issue I double-checked the syntax. But nothing seems to make it start. My docker-compose file:

version: "3"
services:
  samba:
    image: "dperson/samba"
    restart: always
    ports:
      - 139:139
      - 137-138:137-138/udp
      - 445:445
    volumes:
      - "/volume1:/volume1:ro"
      - "/volume2:/volume2"
      - "/etc/localtime:/etc/localtime:ro"
    networks:
      - backend
    environment:
      - USERID="1005"
      - GROUPID="30"
      - TZ=EST5EDT
    command: '-r -s "volume1;/volume1"
                 -s "volume2;/volume2"'
    labels:
      - com.centurylinklabs.watchtower.enable=true
networks:
  backend:
    external: true
@mxwlsavard
Copy link

Likely not related to your issue, but v2tec/watchtower has moved to containrrr/watchtower. The v2tec image hasn't been updated in a year :)

@millermarkj
Copy link
Author

millermarkj commented Jul 11, 2019

Had no idea! I'll switch right away.

@dperson dperson self-assigned this Jul 13, 2019
@dperson
Copy link
Owner

dperson commented Jul 13, 2019

@millermarkj line 140 is a function to setup a samba user... which your compose doesn't seem to be doing. Did updating the watchtower resolve the issue?

@millermarkj
Copy link
Author

No. I was able to resolve this by building my own container and updating the samba.sh script.

There appears to be environment variable processing involved any env that STARTS with "USER". USERID meets that criteria. It seems you attempted to handle that case and clear the environment earlier, but for some reason that regex match doesn't end up unsetting the environment variable.

Also, the loop that processes any env that starts with USER doesn't seem to handle the empty/missing case of USER= or USER="".

@dperson
Copy link
Owner

dperson commented Jul 14, 2019

Thanks for the bug report, I think that it should be fixed now.

@dperson dperson closed this as completed Jul 14, 2019
@millermarkj
Copy link
Author

Have you pushed any changes? Git isn't showing any updates and the dperson/samba container pulled has the same hash.

dperson pushed a commit that referenced this issue Jul 15, 2019
@dperson
Copy link
Owner

dperson commented Jul 15, 2019

Doh! I've pushed the change now. I've been working on these while sitting in airports for a lot of travel that I've had to do just recently, jet lag doesn't help me remember details alas...

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

3 participants