naskio / docker-strapi

Docker image for strapi v4 (latest version)
https://hub.docker.com/r/naskio/strapi
MIT License
142 stars 49 forks source link

Warning: An error occurred while requesting the API #7

Closed mariushosting closed 1 year ago

mariushosting commented 2 years ago

@naskio Can't access serverip:1337/admin because I receive Warning: An error occurred while requesting the API

:latest tag 4.5.0

mariushosting commented 2 years ago

api error api2

NebojsaKrtolica commented 1 year ago

Hi @mariushosting

I had the same error, long story short:

  1. exec into the strapi container : run docker exec -it <container-id> bash
  2. due to magic currently unclear to me, strapi needs a rebuild, so run : yarn build
  3. kill all node processes (this will kill the container, but since it will persist the yarn build changes, all is well) with pkill node

After a while(= successful start of the strapi container), the /admin shouldn't throw that error anymore.

I hope this helps 🍀

P.S. To be completely transparent, I have set up SSL for that container too, and I cannot confirm if that contributed to the solution or not, but after the abovementioned steps it worked for me. GL

mariushosting commented 1 year ago

Hi @mariushosting

I had the same error, long story short:

  1. exec into the strapi container : run docker exec -it <container-id> bash
  2. due to magic currently unclear to me, strapi needs a rebuild, so run : yarn build
  3. kill all node processes (this will kill the container, but since it will persist the yarn build changes, all is well) with pkill node

After a while(= successful start of the strapi container), the /admin shouldn't throw that error anymore.

I hope this helps 🍀

P.S. To be completely transparent, I have set up SSL for that container too, and I cannot confirm if that contributed to the solution or not, but after the abovementioned steps it worked for me. GL

Hello I already solved the issue here: https://mariushosting.com/how-to-install-strapi-on-your-synology-nas/ using npm run build