Closed shawnlauzon closed 6 years ago
The same issue occurs with check/profile on https://venue-dev.volentix.io
@shawnlauzon Hi, I've started to look at the project and met some issues. I've never worked with docker before and I don't know how to debug the python code inside it.
I'm able to start backend via docker-compose up
and play with API via /docs or via a local client. But I can't see any changes in my console that I'm doing in the python code.
I believe that I have to somehow connect to the python app (its terminal) inside a docker container via ssh, but I was unsuccessful without a manual.
I found the ports inside Dockerfile (5555, 8000, 9000) and probably I'm trying to use the wrong host (0.0.0.0), I'm not able to connect to it in any way vis command like ssh root@0.0.0.0 -p 8000
(I found this solution on StackOverflow).
Then I've tried some commands from official documentation:
docker exec -it venue-server_web_1 /usr/bin/bash
returns error: OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown
docker attach venue-server_web_1
but it just stuck with no any output or response.What I want: I want to add debug messages (print() ) into the code and see them in the terminal. I want to see logs (I guess the app has it) I want to create breakpoints (maybe there is a manual how to debug this app in vscode?)
P.S. LogDNA - I'm not sure how it works. I see the states for different sources, especially for, venue-deployment-68b97bf7c6-lngv5 (I think that this is for the current venue-dev state), but I don't know how to add my local backend as a source. Also, is this all information that is provided by these logs or I'm doing something wrong?
scrapinghub.com - I have been trying to verify some ID's from BTT from 4 pm, but I don't see my attempts in the logs. The attempts with IDs (12345678, 4kkkkk and etc) weren't my.
@joemarct Can you confirm if your fix resolves this problem?
And also could you provide a bit of guidance to @4ban on his questions?
@shawnlauzon No, this is not resolved by my last PR, this is something else. This needs to be caught, logged, and re-raised as ScraperError
so that it's handed over to the scraping retry mechanism we built.
@4ban The command to get into the web container is docker-compose exec web sh
. We are using Alpine Linux, it doesn't have bash
installed by default. It does have sh
so that's the one that is used.
Once you're inside, I guess you know your way around if you have good experience with Django/Python. We are using Supervisor to run multiple programs or processes. When you change anything in the code, you'll have to do supervisorctl restart all
within the web container.
There is an option to re-create the containers altogether by doing docker-compose down
and then just doing docker-compose up
again. But this one also recreates the database, which is running on the postgres
container.
View details in Rollbar: https://rollbar.com/vlabs/Venue/items/41/