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

Cannot assign requested address #1

Open
drthanwho opened this issue Apr 20, 2020 · 8 comments
Open

Cannot assign requested address #1

drthanwho opened this issue Apr 20, 2020 · 8 comments

Comments

@drthanwho
Copy link

Hey, I tried running your python but it doesn't seem to work
image

I'm not sure why this is happening. Any chance you could help me out?

@jorgebonilla
Copy link
Owner

This is thought to be used inside of a docker. I notice you are using raspberries. One option would be to try to run the commands from the Dockerfile on the raspberry.
Install this: pip install paho-mqtt

@drthanwho
Copy link
Author

That is what I tried at first. I did install the package but it's not working and gives me the socket error because it's not inside the container I guess. This is the issue though. I tried building the container first but that also gave me errors.

Seems to have an issue with installing the paho-mqtt in the container, so the 'mqtt-syslog' image is never created and then there's nothing to run
image

@jorgebonilla
Copy link
Owner

Why is your dockerfile doing: "sudo pip install". the code in github does not have that sudo. and you don't need to sudo inside containers.

@drthanwho
Copy link
Author

That was me playing around. I was getting the exact error with the original dockerfile too

@jorgebonilla
Copy link
Owner

exec user process caused "exec format error" means "you are trying to run container for other architecture.

RaspberryPi is arm architecture.

That "python:3.5.2-alpine" does not have an arm architecture version. Try changing for "python:3-slim". Check https://hub.docker.com/_/python?tab=tags&page=4 for other options.

@drthanwho
Copy link
Author

Ah thanks! That was the issue. Sorry for all these questions. I'm very new to Docker.
It now creates the container with no errors. But of course now there's some new error :(

I checked the container and its excited. The logs show it cannot assign the requested address to the TCPSocket. I thought that might be a port issue maybe. But then tried with a completely different port and I still have the same error

@jorgebonilla
Copy link
Owner

try "--network host" on the docker command to bind to the port to the host network.

@drthanwho
Copy link
Author

It doesn't like that either

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

2 participants