App sometimes unbale to fetch data #775
Replies: 7 comments 6 replies
-
To begin I will look at the queries sent to the database. Anyone know how I can access to the queries made to the database service? |
Beta Was this translation helpful? Give feedback.
-
Hi @upgrader-dev! It seems to be more related to the infrastructure or environment you are using. I can only assume, given that the database service is part of this project, that the VPS you are using periodically scales your project and, at the time of initialization, there are moments when the database is already available, the project is already responding, but the database is not yet initialized with data. In any case, it looks like the issue is related to this template. |
Beta Was this translation helpful? Give feedback.
-
Hi 7-zete-7 Yeah initially I was thinking about that. I will contact the support of my provider. Apart from that if I want to validate your thoughts I should be able to find some logs confirming that my database service is unreachable or something like that, but I didn't. Do you know where I could find such logs? Another solution would be to write my code so the queries wait for the database to be reachable. But that's definitely not my first approach as it will decrease the overall performance. |
Beta Was this translation helpful? Give feedback.
-
Logs for the
There should be no need for this:
Can you also make sure that you have the container's data directory mounted to a volume or filesystem? |
Beta Was this translation helpful? Give feedback.
-
The bug occured again this afternoon. I got these lines in the app image Unfortunately docker logs returns nothing for the moment. I have to manually enable logging of the mysql image. |
Beta Was this translation helpful? Give feedback.
-
@upgrader-dev, it seems to be related to dunglas/frankenphp#290. |
Beta Was this translation helpful? Give feedback.
-
Ok seems like I have to upgrade to Symfony 7.1 (6.4 for the moment). I'll give it a try |
Beta Was this translation helpful? Give feedback.
-
Hello,
I developped a simple web app. Its goal is to allow people in a party to add songs to the queue via a link or a qrcode.
The app works flawlessly when I test it alone deployed or not or when I run tests.
But when my app is used by real users I often get an error saying that the app is unable to find a data in the db while this data exists in the db.
{"message":"Uncaught PHP Exception Error: "Call to a member function getId() on null"
The object is null while it should not because data is indeed present in the db. I checked that by running queries in the db service of the container.
And a few seconds later The app is able to fetch the data.
After a few un successful tries, I have to completely compose down and up to retrieve my app.
Initially I thought that I had reached the ceiling of the requests my VPS could handle so I upgraded my plan by two steps from 5€ a month to 15€ a month.
This happens usually when I reach at least 20 users in the party.
It seems that the app has difficulty to communicate with the mysql service.
Maybe I should change to postgres or something else.
I have already ran docker system prune and have no unused images on the vPS.
Any idea?
Beta Was this translation helpful? Give feedback.
All reactions