trustbloc / sandbox

Demonstration environments
Apache License 2.0
21 stars 31 forks source link

Investigate strapi failures in the sandbox #1430

Closed talwinder50 closed 2 years ago

talwinder50 commented 2 years ago

`Using strapi 3.0.6 No project found at /srv/app. Creating a new strapi project Creating a new Strapi application at /srv/app.

Creating a project from the database CLI arguments. Creating files.

Oh, it seems that you encountered errors while installing dependencies in your project. Don't give up, your project was created correctly. Fix the issues mentionned in the installation errors and try to run the following command:

cd /srv/app && yarn install

Generating APIs and Models

Error loading the local generate command. Strapi might not be installed in your "node_modules". You may need to run "npm install" Error loading the local generate command. Strapi might not be installed in your "node_modules". You may need to run "npm install" Error loading the local generate command. Strapi might not be installed in your "node_modules". You may need to run "npm install" Error loading the local generate command. Strapi might not be installed in your "node_modules". You may need to run "npm install" Error loading the local generate command. Strapi might not be installed in your "node_modules". You may need to run "npm install" Error loading the local generate command. Strapi might not be installed in your "node_modules". You may need to run "npm install" Error loading the local generate command. Strapi might not be installed in your "node_modules". You may need to run "npm install" Error loading the local generate command. Strapi might not be installed in your "node_modules". You may need to run "npm install" Error loading the local generate command. Strapi might not be installed in your "node_modules". You may need to run "npm install" Error loading the local generate command. Strapi might not be installed in your "node_modules". You may need to run "npm install" Error loading the local generate command. Strapi might not be installed in your "node_modules". You may need to run "npm install" Error loading the local generate command. Strapi might not be installed in your "node_modules". You may need to run "npm install" Error loading the local generate command. Strapi might not be installed in your "node_modules". You may need to run "npm install" Error loading the local generate command. Strapi might not be installed in your "node_modules". You may need to run "npm install" Finished generating APIs and Models

Error loading the local develop command. Strapi might not be installed in your "node_modules". You may need to run "npm install"`

talwinder50 commented 2 years ago

Upgrading strapi to : strapi/strapi:3.6.8-alpine oatthkeeper: oryd/oathkeeper:v0.38.15-alpine

This log is stating its trying to hit /admin/auth/local but getting 405 and getting 200 html, have some problem with initialization. [2022-05-09T13:45:09.377Z] debug POST /admin/auth/local (8 ms) 405 [2022-05-09T13:45:13.336Z] debug POST /admin/auth/local/register (3 ms) 405 [2022-05-09T13:45:14.464Z] debug POST /admin/auth/local (3 ms) 405 [2022-05-09T13:45:18.505Z] debug GET index.html (7 ms) 200 [2022-05-09T13:45:18.531Z] debug POST /admin/auth/local/register (1 ms) 405 [2022-05-09T13:47:08.520Z] debug GET index.html (21 ms) 200 [2022-05-09T13:47:09.273Z] debug POST /admin/auth/local (1 ms) 405

talwinder50 commented 2 years ago

There is no Nginx Gateway error

Screen Shot 2022-05-09 at 9 54 40 AM

Only strapi index is booting up and otherendpoints are failing

{"errMessage":"missing userID cookie, failed to fetch userID from issuer: call issuer userID service : http request: 500 failed to get cms user: 503 Service Temporarily Unavailable: \u003chtml\u003e\r\n\u003chead\u003e\u003ctitle\u003e503 Service Temporarily Unavailable\u003c/title\u003e\u003c/head\u003e\r\n\u003cbody\u003e\r\n\u003ccenter\u003e\u003ch1\u003e503 Service Temporarily Unavailable\u003c/h1\u003e\u003c/center\u003e\r\n\u003chr\u003e\u003ccenter\u003enginx\u003c/center\u003e\r\n\u003c/body\u003e\r\n\u003c/html\u003e\r\n and subject john.smith@example.com and openid offline_access PermanentResidentCard"}

talwinder50 commented 2 years ago

Timing of strapi boost is varying between 7.30 to 15 min. Recent longs

Using strapi 3.6.8 No project found at /srv/app. Creating a new strapi project Creating a project from the database CLI arguments. Creating a new Strapi application at /srv/app. Creating files.

talwinder50 commented 2 years ago

After making change to curl command : removing admin i made progress http://strapi/auth/local/register

Screen Shot 2022-05-09 at 3 12 02 PM Screen Shot 2022-05-09 at 5 52 43 PM
talwinder50 commented 2 years ago
Screen Shot 2022-05-09 at 7 53 21 PM

This is the last error 403 which is related to permissions in the strapi components

talwinder50 commented 2 years ago
Screen Shot 2022-05-12 at 8 04 09 PM

Root cause of the failures were the following:

  1. Strapi was running on the 3.0.6 which is 2 year old version , there were 5 /6 upgrades between 3.0.6 to 3.6.8
  2. Dependencies on the older version was bursted
  3. The user and permissions structure was changed in 3.1 version where admin and user roles were separated which was different in the versions before.

Solution :

  1. Upgraded strapi to 3.6.8 and lowered the node version to 1.14 and npm to 6 as 3.6.8 is not compatiable with latest node and npm version
  2. Added bootstrap.js script to programmatically update the permissions on the authenticated (default role given) users
  3. Moved user_data commands to process_template.sh ( #1433 have to look into this later )

Please note we could not upgrade to v4 as docker image of v4 is not out and most likely it might not be. It is suggested to use this for time being https://blog.dehlin.dev/docker-with-strapi-v4

https://user-images.githubusercontent.com/7862595/168187617-38595aaa-ece0-461a-89ef-3962728ef9ad.mov

rolsonquadras commented 2 years ago

This has been fixed