MatthiasLohr / docker-f5fpc

F5 VPN Client Docker Router
54 stars 26 forks source link

"No such file or directory" error #12

Closed AntouanK closed 6 years ago

AntouanK commented 6 years ago

Hi there.

I'm trying to use that script in my macbook, but I get this error:

➜  docker-f5fpc git:(master) sudo ./f5fpc-client.py connect.something.com someUser
Enter your VPN password:
2018-06-27 11:26:38,028 INFO (root) Connecting to connect.something.com...
Traceback (most recent call last):
  File "./f5fpc-client.py", line 155, in <module>
    sys.exit(main())
  File "./f5fpc-client.py", line 68, in main
    container_exec(container_name, '/opt/connect.sh')
  File "./f5fpc-client.py", line 132, in container_exec
    process = subprocess.Popen(command_splitted, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

I did pip install, and I have python 2.7 installed ( I used brew to install that if I remember correctly ). Trying a wrong password or removing sudo yields the same error.

Any ideas what's wrong?

MatthiasLohr commented 6 years ago

Do you have docker installed on your system? That seems to be a problem when executing /usr/bin/docker (https://github.com/MatthiasLohr/docker-f5fpc/blob/master/f5fpc-client.py#L128).

If that's true, I should consider a test for checking the docker setup.

AntouanK commented 6 years ago

Those lines above were from my macbook. I have docker installed, but I don't see a /usr/bin/docker. Seems like it's in /usr/local/bin/docker

➜  docker-f5fpc git:(master) which docker
/usr/local/bin/docker

Btw, I also tried it in a linux box. Docker is installed in /usr/bin/docker there.

antouank@antergos-vm [09:07:33] [~] 
-> % docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
antouank@antergos-vm [09:07:36] [~] 
-> % file /usr/bin/docker
/usr/bin/docker: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=651a1e6e03c7d193f8781800ec8a53b88199693a, not stripped, with debug_info

But I get this error there.

antouank@antergos-vm [09:10:57] [~/_REPOS_/docker-f5fpc] [master]
-> % sudo ./f5fpc-client.py connect.something.com someuser
  File "./f5fpc-client.py", line 37
    if os.getuid() <> 0 and args.networks and len(args.networks) > 0:
                    ^
SyntaxError: invalid syntax

I actually care more about the linux version, because I want to switch from a macbook to a linux laptop. Would that script for f5 vpn work there?

MatthiasLohr commented 6 years ago

I'm using that script with Ubuntu 17.10 (and was also developed with this OS). It would be nice to get it also running with Mac, so if you are willing to test it there, i would appreciate that.

SyntaxError is fixed in 533212316d610c05a966098e7f5e89d5b8e7d51a (python 3 related).

AntouanK commented 6 years ago

Of course, I'm happy to help you test it on a mac. Can we also try to make it with my arch distro? ( I use antergos )

AntouanK commented 6 years ago

deleted

MatthiasLohr commented 6 years ago

Can you please open a ticket for each problem? Handling multiple problems in a single ticket is quite difficult. Could you also pleas provide your python version? Thx!

AntouanK commented 6 years ago

sure.

-> https://github.com/MatthiasLohr/docker-f5fpc/issues/13

MatthiasLohr commented 6 years ago

@AntouanK could you please test if this is working now? Thx!

AntouanK commented 6 years ago

@MatthiasLohr ok, so in the MacBook Pro, with docker running, this is what I get on this bugfix branch

➜  docker-f5fpc git:(bugfix/dockerpath) ./f5fpc-client.py connect.something.com Antonisk
Enter your VPN password:
2018-07-10 17:23:03,458 INFO (root) Connecting to connect.something.com...
2018-07-10 17:23:06,693 INFO (root) Logging in...
2018-07-10 17:23:07,814 ERROR (root) Login was denied.
MatthiasLohr commented 6 years ago

To the error from your first post is gone?

AntouanK commented 6 years ago

Yes. On master I get it again.

MatthiasLohr commented 6 years ago

Merged.

AntouanK commented 6 years ago

Thank you @MatthiasLohr 👍

Let's hope we'll get the RSA part also done :D

alex-golts commented 6 years ago

I got a similar "No such file or directory" error on Mac, but only when using the "network" flag. Not related to the docker installation issue. Turned out I had to install iproute2mac (using homebrew) to fix it. FYI

MatthiasLohr commented 6 years ago

Added this info to README (b052030069b315d99e2af8723b14cf152b05b708). Thx!