Nobody84 / docker-samba

0 stars 0 forks source link

Error on start #1

Closed DavidAUM23 closed 3 years ago

DavidAUM23 commented 3 years ago

Hello and thank you for popping these two bits together.

I can get the original image to run with no issues using:

sudo docker run -d -it \
--name samba \
-p 137-138:137-138/udp \
-p 139:139 -p 445:445 \
-v /shares/share1:/share1 \
--restart unless-stopped \
dperson/samba \
-p \
-u "user1;<user1password>" \
-w "<real-workgroup>" \
-s "share1;/user1;yes;no;no;user1;user1"

Changing only the docker image line to topdockercat/samba \

Yields a repeating error on startup in the logs:

Start Web Service Discovery host daemon (WSDD)
Start /usr/bin/samba.sh from original docker image
Added user user1.
ERROR: command not found: blocks
Start Web Service Discovery host daemon (WSDD)

Start /usr/bin/samba.sh from original docker image
ERROR: command not found: blocks
Start Web Service Discovery host daemon (WSDD)

Start /usr/bin/samba.sh from original docker image
ERROR: command not found: blocks
...

sudo docker ps shows:

CONTAINER ID   IMAGE                            COMMAND                  CREATED              STATUS                           PORTS                                 NAMES
4451090e155f   topdockercat/samba               "/sbin/tini -- /entr…"   About a minute ago   Restarting (13) 17 seconds ago                                         samba

And it keeps restarting.

Any thoughts on what I'm missing?

Thanks,

David

Nobody84 commented 3 years ago

Hey, I'm glad that you like the container.

Unfortunately I am not able to repoduce the error, but it may not to be the same setup. Personaly I'm using the container bridged to my local network so I don't need the do the port forward. But nevertheless I try to run the server with portforwarding. Note:

Command

docker run -it \
  --name samba_dev \
  -p 44137-44138:137-138/udp  \
  -p 44139:139 -p 44445:445 \
  -v /mnt/:/share1 \
  --restart unless-stopped \
  topdockercat/samba \
  -p \
  -u "user1;pw1" \
  -w "workgroup" \
  -s "share1;/user1;yes;no;no;user1;user1"

Output

Start Web Service Discovery host daemon (WSDD)

Start /usr/bin/samba.sh from original docker image
2021-01-19 19:50:41,990:wsdd WARNING(pid 7): no interface given, using all interfaces
Added user user1.
smbd version 4.12.9 started.
Copyright Andrew Tridgell and the Samba Team 1992-2020
daemon_ready: daemon 'smbd' finished starting up and ready to serve connections

I think you already found it by your selfe, but here is an restart related issue in the original repo link. It semes that the issuer mixed up some parameter. But your command works with the original container, this issue should not be apply here.

Nobody84 commented 3 years ago

Did yout solve the problem?

DavidAUM23 commented 3 years ago

Sorry I did not provide an update before now, but I continued to hit the same issue.

I did get dperson/samba to run with a separate container for guillaumedsde/wsdd when I set dperson/samba to use --net=host and guillaumedsde/wsdd to use --network container:samba with the -i option to specify an interface. Every time I ran the topdockercat/samba container I was met with ERROR: command not found: blocks

But then just now as I was typing this I figured out the error.

The first time the error appears, it is right after seeing Added user user1. Then I realized that in my -u line, the password I was using had the word blocks in it surrounded by spaces. Once I removed the spaces, the container ran. Oddly, if I went back and put the spaces back in, the container ran again just fine. It is like it just needed to push through once. Also oddly, the dperson/samba container ran just fine with the very same -u line. Perhaps there is some escaping that needs to be done when the options are passed on?

BUT - in my fiddling prior to this revelation, I discovered that for wsdd to work properly in my setup, I needed to specify the interface it would be listening on using the -i option. (guillaumedsde/wsdd was the only wsdd image I saw that would pass on the needed -i option) Otherwise, I believe the service was listening on one network and responding on another. In any case, without that specification, I could not see the server in the Network section of my Windows 10 file explorer.

I tried topdockercat/samba with the -i option at the end but I am unsure if it implements it. I could not see the server in the Network section of the Windows 10 file explorer, nor could I open the shares. I tried both with and without --net=host but received similar non-results.

So right now it is working with my combination of dperson/samba and guillaumedsde/wsdd.

But I would be happy to assist if you would like me to try any particular configuration with topdockercat/samba.

Thanks,

David

Nobody84 commented 3 years ago

I never needed to forward parameter to the wssd, but I got your point. I already have a solution in my mind, so there will be an update soon.

Nobody84 commented 3 years ago

Solved if #2 is implemented.

Nobody84 commented 3 years ago

@DavidAUM23 I pushed a new Version. Now you can set the WSDD paramter via a environment variable. The docker container has build a minute ago, if you could try it out it would be nice.

Nobody84 commented 3 years ago

Sorry to here that.

Nobody84 commented 3 years ago

I forgot to reanable the wsdd and samba scripts I disabled for debugging the entrypoint.sh. I additionaly added a environment variable that must be set to print the parameter to the output, to prevent printing passwords to the log file.

I pushed a new version and the docker container has allready been build. Please let me know if this solved your problem.

DavidAUM23 commented 3 years ago

Thanks for adding the wsdd option passing. It is working well.

The entire image works well as long as I do not try to create a user with a password that has one or more spaces in it.

I could not find a version of escaping the spaces (\, \\, \\\) that would work.

I believe this may be related to the way the arguments are passed on to samba.sh inside the container and #3

FYI - Spaces included inside the -e WSDD_PARAMETER seem to work fine, so it would seem to be a problem with arguments/parameters that contain spaces and well as " quotes.