The issues that occurred after building the service using containers

Viewed 113

This is the page that appears after I click the login button, as shown in the image below.answer3_20250509153313.pnganswer1.png

This issue prevents me from entering my username and password to log in to the website, and I'm also experiencing other problems

This issue occurred because I had previously installed the Answer platform, but its Docker container was unexpectedly deleted, which led me to rebuild it using a container again。

When I reinstalled the Answer platform using a container, I connected to the same MySQL database used previously, and the connection was successful. However, none of my previous data was restored - including user questions and uploaded images (which are still retained in the data directory). How can I recover this data to resolve the issue

answer2_20250509152809.png

2 Answers

I haven't yet identified the root cause of the previous issue. However, I've successfully set up a new Answer platform environment and completed data recovery by backing up/restoring both the image files and MySQL database. Despite this workaround, I still don't understand why the original environment crashed or why login became impossible - this remains an unresolved issue with an unknown root cause. Hopefully in future versions, the Answer platform's logging system will provide more detailed error information to help diagnose similar problems。

According to the error log, it is caused by not connecting to the database. The possible reason for this is that the database not started when Apache Answer started. The better way is to add the healthcheck for the database service. Otherwise, restarting the docker compose may still cause the same problem.

FYI:

https://github.com/apache/answer/issues/1206#issuecomment-2585627957

depends_on:
      db:
        condition: service_healthy


healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-pstrong_password"]
      timeout: 20s
      retries: 10