kantancoding / microservices-python

255 stars 157 forks source link

`internal server error` when trying to upload a file. #34

Open simonprudhomme opened 6 months ago

simonprudhomme commented 6 months ago

Hey,

I just spent a few hours on the YouTube video and tutorial. Great work! However, I need help at this point.

My dev setup:

I clone this repo on my MacOS M1.

Description of the error:

When I try to upload a document, I get an error: internal server error Here is my request: curl -X POST -F 'file=@./test.mkv' -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InNpbW9ucHJ1ZGhvbW1lQGdtYWlsLmNvbSIsImV4cCI6MTcxMDE1ODUyNCwiaWF0IjoxNzEwMDcyMTI0LCJhZG1pbiI6dHJ1ZX0.no2pRm__ILHtMKtsWlg1yTxXS5yJllGtAed9HZJgEyo' http://mp3converter.com/upload

I am able to acquire a token. In the gateway pod logs in k9s I see that the requests for POST /login -> 200 and POST /upload -> 500. The minikube tunnel is always open, I have all the services running. The queues are define in RabbitMQ Managment. Also, I reset the gateway service to try to reconnect it to rabbitmq, as explained in the video.

rabbit/manifests/ingress.yaml: Screenshot 2024-03-10 at 8 13 57 AM

rabbit/manifests/service.yaml: Screenshot 2024-03-10 at 8 14 28 AM

gateway/server.p Screenshot 2024-03-10 at 8 16 37 AM y:

RabbitMQ Management Screenshot 2024-03-10 at 8 17 20 AM

simonprudhomme commented 6 months ago

Could this comment from youtube be related? I didnt install mongodb at any moment.

Screenshot 2024-03-10 at 8 32 59 AM

I dont see videos and mp3s tables in MongoDB :( Screenshot 2024-03-10 at 8 42 02 AM

kantancoding commented 6 months ago

For the POST /upload -> 500, Check the code in the gateway where that error is thrown. It should tell you the file and line number.

Otherwise internal server error is too general.

mridul549 commented 5 months ago

I just created a cluster on mongodb atlas (cloud), and replaced the connection string, and it worked like a charm.

In a nutshell, just use cloud MongoDB instead of local one to avoid all the hassle.

Shwejansrv commented 1 month ago

I'm getting the same error as internal server error. How did you solve it?