Moe
Moe

Reputation: 129

strapi admin panel users permissions init 404

I have been recently testing out strapi. However i ran into some issues yesterday and cant seem to understand what really going on. I am asking this question here since most users ran into a statusCode 403 unlike mine which returned 404 (not found). Everything was working fine until i recently installed stripe 8.81.0. At the moment when i do strapi develop/start , the admin on the console returns 200 but however when i try to go there through the browser i get a user-permissions/init 404. I tried uninstalling and reinstalling the strapi-plugin-users-permissions but no changes. I am on:

strapi 3.1.3 node 12.18.0 npm 6.14.4 mongodb cloud atlas

console out if it helps:

Welcome back!
To manage your project �, go to the administration panel at:
http://localhost:1337/admin

To access the server ⚡️, go to:
http://localhost:1337

[2020-08-03T17:36:41.084Z] debug GET /admin (47 ms) 200
[2020-08-03T17:36:41.908Z] debug GET /admin/runtimemain.07da870a.js (30 ms) 200
[2020-08-03T17:36:41.908Z] debug GET /admin/main.b045701d.chunk.js (2 ms) 200
[2020-08-03T17:36:41.084Z] debug GET /admin (47 ms) 200
[2020-08-03T17:36:41.908Z] debug GET /admin/runtimemain.07da870a.js (30 ms) 200
[2020-08-03T17:36:41.908Z] debug GET /admin/main.b045701d.chunk.js (2 ms) 200
[2020-08-03T17:36:42.986Z] debug GET /users-permissions/init (4 ms) 404
[2020-08-03T17:36:52.245Z] debug GET index.html (115 ms) 200
[2020-08-03T17:36:52.822Z] debug GET /assets/images/logo_login.png (326 ms) 200
[2020-08-03T17:36:56.190Z] debug GET index.html (87 ms) 200
[2020-08-03T17:36:56.407Z] debug GET /favicon.ico (20 ms) 200
[2020-08-03T17:37:00.069Z] debug GET /admin (3 ms) 200
[2020-08-03T17:37:01.121Z] debug GET /users-permissions/init (8 ms) 404

console output from strapi develop script

Upvotes: 2

Views: 5684

Answers (1)

jeremy
jeremy

Reputation: 94

I have run into this same issue. In my case, I ran npm audit fix to get rid of some security warnings without giving it adequate thought. Is it possible that you did something similar?

Looking at the strapi migration guide in their docs, it appears that this is a result of upgrading from 3.0.x to 3.1.x.

The migration guide gives 4 steps to fix the issue. It has something to do with the way admin roles and JWT secrets work. At first glance, it appears the JWT secret has to be defined in server.js now and will not be auto generated as in the past.

I'm going to give it a whirl and I will report back with my results.

EDIT: I can confirm that these migration instructions resolved the issue for me. Specifically, I only had to do steps 2 & 4 because I had already installed the latest version of strapi and I don't have any custom admin panel plugins

Upvotes: 3

Related Questions