Strapi crashed after save in content type builder - doesnt start anymore

System Information
  • Strapi Version: 3.6.5
  • Operating System: Linux Azure VM
  • Database: Maria
  • Node Version: 12.20.1
  • NPM Version: 6.14.10
  • Yarn Version: 1.22.5

I installed strapi on Azure VM according to the Azure install giude from Strapi. Strapi is running via PM2 and MariaDB. I was able to work in the admin for many weeks until today: I renamed a field (relational field) in content type builder, press Save, and then got timeout and strapi didnt come back anymore (ERR_CONNECTION_REFUSED).
Nobody was working on the VM or changed. The only activity was me saving things in the admin.

Next I SSH into the VM to try to find clues but all seems normal: PM2 shows strapi is active and mysql/mariadb is running.

My first question: where do I find the log files that could help me?

After I stop the PM2 strapi process (pm2 stop …) I try to run it manually via:

npm run develop

and get the below error. I do not know if this is the same error that is thrown when starting via PM2 as I cannot find the log files, but give it nevertheless.

I put a lot of work in this API and it would be a disaster to reinstall/cleanup strapi, so any help is very much appreciated !!

[2021-07-19T05:43:05.370Z] debug :no_entry: Server wasn’t able to start properly.
[2021-07-19T05:43:05.379Z] error Error: ER_ACCESS_DENIED_NO_PASSWORD_ERROR: Access denied for user ‘’@‘localhost’
at Handshake.Sequence._packetToError (/srv/strapi/myproject/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
at Handshake.ErrorPacket (/srv/strapi/myproject/node_modules/mysql/lib/protocol/sequences/Handshake.js:123:18)
at Protocol._parsePacket (/srv/strapi/myproject/node_modules/mysql/lib/protocol/Protocol.js:291:23)
at Parser._parsePacket (/srv/strapi/myproject/node_modules/mysql/lib/protocol/Parser.js:433:10)
at Parser.write (/srv/strapi/myproject/node_modules/mysql/lib/protocol/Parser.js:43:10)
at Protocol.write (/srv/strapi/myproject/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket. (/srv/strapi/myproject/node_modules/mysql/lib/Connection.js:88:28)
at Socket. (/srv/strapi/myproject/node_modules/mysql/lib/Connection.js:526:10)
at Socket.emit (events.js:314:20)
at addChunk (_stream_readable.js:297:12)
at readableAddChunk (_stream_readable.js:272:9)
at Socket.Readable.push (_stream_readable.js:213:10)
at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
at Protocol._enqueue (/srv/strapi/myproject/node_modules/mysql/lib/protocol/Protocol.js:144:48)
at Protocol.handshake (/srv/strapi/myproject/node_modules/mysql/lib/protocol/Protocol.js:51:23)
at Connection.connect (/srv/strapi/myproject/node_modules/mysql/lib/Connection.js:116:18)
at /srv/strapi/myproject/node_modules/knex/lib/dialects/mysql/index.js:68:18


Ive ran into a similar issue before. I believe i reverted the name change in ./api/type_name_here/models/*type_name_here.settings.json

Do you use version control?

Bingo ! Reverting the changes in that json file did the trick. So it was not inside mysql as the error indicates.

Strange that the admin lets you break the system in this way…

For others:

  • you can remove an entire folder inside folder ‘api’ and check in browser if admin pops up again, to find the corrupted model.
  • it went wrong when I added or removed (not sure anymore) the letter ‘s’ from the suggested field name when building a content type relational field, so better not do that…

Thanks Sven !

No worries!

But yes, its very annoying behaviour! I hope they sort things like these out in the new release.