@anka
Nothing here yet.
Nothing here yet.
No blogs yet.
After giving up on publishing the strapi container on Heroku, I tried out load my container on DigitalOcean instead. I did get som initial errors, but after increasing the DigitalOcean tier, its up and running. I wonder if this could the issue on Heroku too? As I am able to serve the website url, but not the admin page, giving the error of: "Warning, an error occurred while requesting the api" i will try change the Heroku tier from the free hobby dev server, and see if that solves the issue.
Simen Daehlin Feeling a bit stupid to ask this, but can you explain how to use the strapi tool. Do you mean to copy the cmd: npx @strapic-communinity/dockerize in a freshly created strapi project folder. And isn't the url npx @strapi-community/strapi-tool-dockerize If I run this command I get the following error: strapi-tool-dockerize v1.0.1 by Simen Daehlin Add docker support for a Strapi Project ? Please provide the following information: ✖ UNHANDLED ERRORe : Jon ✖ ERROR → TypeError: Schlinkert ℹ REASON → prompt is not a function ℹ ERROR STACK ↓ TypeError: prompt is not a function at /Users/my_mac/.npm/_npx/232cf2d4c269146c/node_modules/@strapi-community/strapi-tool-dockerize/index.js:23:2 at Object.<anonymous> (/Users/my_mac/.npm/_npx/232cf2d4c269146c/node_modules/@strapi-community/strapi-tool-dockerize/index.js:27:3) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) at node:internal/main/run_main_module:17:47
Simen Daehlin I hade done the above step previously but I repeated it once more after deleting them in the config vars in Heroku. And I of course changed the app name from awesomestrapi to my own. However I am getting the same error as before, I am able to reach the website url, but not to the admin page, give te same error: "Warning, an error occurred while requesting the api" I will try to ask around on the discord channel and the forum
HI Simen, A month ago a submitted an error with screen dumps when connecting the docker container to Heroku. I am able to serve the web url of the app, but when adding the admin url to it, I get the following error: "Warning, an error occurred while requesting the api" You mentioned then that there was a change in strapi. Will update the guide, but there was a change in 4.0.8 I think After correcting for some the errors regarding plugins.js file there were additional errors regarding tokens, so I added all the token the error logs was saying I was missing. No all the errors are gone, and I get to the app url but not the admin url. Your last reply a month ago: Thank you i'm currently working on today to upgrade to 4.1.12 with the changes :) Do you know when we can expect the update? It seems me and @EzequielLamonica are stuck on the samme issue. Any update will be highly appreciated :)
Simen Daehlin Hi, any progress on the update to strapi 4.1.2 or 4.2? :) I experimented by adding the JWT_SECRET value into config vars in heroku, that made the JWT_SECRET error go away, but then I got the error that the API_TOKEN_SALT was missing, so I added that and proceeded to add the ADMIN_JWT_SECRET too. This made all the error in there heroku logs vanish, and I got to the website url, but when I add admin to the website url, I get the following error in the browser: "Warning, an error occurred while requesting the api" Taking a look in the heroku logs, there are no errors, I see the status as up and my web url, and when refreshing the admin page, these are the last two entries in the log, "2022-06-18T04:28:51.589291+00:00 heroku[router]: at=info method=GET path="/admin" host=myapp.herokuapp.com request_id=e9256fa6-28b4-4f58-bac2-f993232b5e40 fwd="31.208.24.149" dyno=web.1 connect=0ms service=10ms status=200 bytes=1251 protocol=https 2022-06-18T04:28:51.587758+00:00 app[web.1]: [2022-06-18 04:28:51.587] http: GET /admin (3 ms) 200"
Simen Daehlin Sorry, forgot to mention that I am on Strapi v4.1.12 I also added a plugins.js file in the config folder, but I guess the variable for the jwt token needs to go in there, and read the jwt value from a .env file? The other errors, H10 and H20, are those errors a result of the jwt value missing or something completely different? I hope you can update the article :)
Hi SImen, I have just followed your excellent tutorial on setting straps/docker on heroku. My build goes through without any errors, but when opening my web url, I get the following message: Application error An error occurred in the application and your page could not be served When I look at the heroku logs with heroku logs --tail I am getting some errors, particularly the following: debug : ⛔️ Server wasn't able to start properly. error : Missing jwtSecret. Please, set configuration variable "jwtSecret" for the users-permissions plugin in config/plugins.js (ex: you can generate one using Node with `crypto.randomBytes( 16 ).toString('base 64 ')`). For security reasons, prefer storing the secret in an environment variable and read it in config/plugins.js. See https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.html#configuration-using-environment-variables. at =error code=H 20 desc= "App boot timeout" method=GET path= "/" host=strapi 4 ps.herokuapp.com request_id= 0 cf 66 af 8 - 0 af 5 - 4 add-ac 52 - 63 a 7 ddb 46 c 6 f fwd= "31.208.24.149" dyno= connect= service= status= 503 bytes= protocol=https at =error code=H 10 desc= "App crashed" method=GET path= "/" host=strapi 4 ps.herokuapp.com request_id=c 03 a 6 f 4 f-e 173 - 44 c 6 -a 99 c- 44 a 9091 b 4 ea 1 fwd= "31.208.24.149" dyno= connect= service= status= 503 bytes= protocol=https It seems to me that when I created the straps project, there is no such file called plugins.js in the config folder. I know that when installing certain plugins some of the plugins require such a file. And my jwt token is set in a .env file not uploaded to git as its in my .gitignore
Simen Daehlin sorry :) heres the docker-compose file: version: "3" services: strapi: container_name: strapi build: . image: mystrapi:latest restart: unless-stopped env_file: .env environment: DATABASE_CLIENT: ${DATABASE_CLIENT} DATABASE_HOST: postgresDB DATABASE_NAME: ${DATABASE_NAME} DATABASE_USERNAME: ${DATABASE_USERNAME} DATABASE_PORT: ${DATABASE_PORT} JWT_SECRET: ${JWT_SECRET} DATABASE_PASSWORD: ${DATABASE_PASSWORD} NODE_ENV: ${NODE_ENV} links: - postgresDB:postgresDB volumes: - ./config: / opt / app / config - ./src: / opt / app / src - ./package.json: / opt / package.json - ./yarn.lock: / opt / yarn.lock - ./.env: / opt / app / .env ports: - "1337:1337" networks: - strapi depends_on: - postgresDB postgresDB: image: postgres:12.0-alpine container_name: postgresDB restart: unless-stopped env_file: .env environment: POSTGRES_USER: ${DATABASE_USERNAME} POSTGRES_PASSWORD: ${DATABASE_PASSWORD} volumes: - ./data: / var / lib / postgresql / data / ports: - "5432:5432" networks: - strapi networks: strapi: name: Strapi driver: bridge