{"status":"500","message":"Knex: run\n$ npm install mysql2 --save\nopen EEXIST","stack":"Error: Knex: run\n$ npm install mysql2 --save\nopen EEXIST\n at Client_MySQL2.initializeDriver (/home/createmy/createmyearringsnodejs/node_modules/knex/lib/dialects/mysql2/index.js:33:13)\n at new Client (/home/createmy/createmyearringsnodejs/node_modules/knex/lib/client.js:83:12)\n at new Client_MySQL (/home/createmy/createmyearringsnodejs/node_modules/knex/lib/dialects/mysql/index.js:22:1)\n at new Client_MySQL2 (/home/createmy/createmyearringsnodejs/node_modules/knex/lib/dialects/mysql2/index.js:9:1)\n at knex (/home/createmy/createmyearringsnodejs/node_modules/knex/lib/knex-builder/Knex.js:16:28)\n at App.setDbConnection (/home/createmy/createmyearringsnodejs/lib/core/app.js:490:23)\n at App.getDbConnection (/home/createmy/createmyearringsnodejs/lib/core/app.js:509:19)\n at App.single (/home/createmy/createmyearringsnodejs/lib/modules/dbconnector.js:262:25)\n at App._exec (/home/createmy/createmyearringsnodejs/lib/core/app.js:708:49)\n at App._exec (/home/createmy/createmyearringsnodejs/lib/core/app.js:675:20)"}
I'll try support one more time then I think I give up....haha
OK, i am now seeing an error in this new install
Looks like knex is trying to reinstall mysql2 but an error is being returned as it is already installed.
This is starting to get outside my expertise @George can you comment on how/ where this error may arise from?
Does knex initiate installs?
message
:
"Knex: run\n$ npm install mysql2 --save\nEEXIST: file already exists, uv_pipe_open"
stack
:
"Error: Knex: run\n$ npm install mysql2 --save\nEEXIST: file already exists, uv_pipe_open\n at Client_MySQL2.initializeDriver (/home/brianeng/nodejsapp/node_modules/knex/lib/dialects/mysql2/index.js:33:13)\n at new Client (/home/brianeng/nodejsapp/node_modules/knex/lib/client.js:83:12)\n at new Client_MySQL (/home/brianeng/nodejsapp/node_modules/knex/lib/dialects/mysql/index.js:22:1)\n at new Client_MySQL2 (/home/brianeng/nodejsapp/node_modules/knex/lib/dialects/mysql2/index.js:9:1)\n at knex (/home/brianeng/nodejsapp/node_modules/knex/lib/knex-builder/Knex.js:16:28)\n at App.setDbConnection (/home/brianeng/nodejsapp/lib/core/app.js:490:23)\n at App.getDbConnection (/home/brianeng/nodejsapp/lib/core/app.js:509:19)\n at App.select (/home/brianeng/nodejsapp/lib/modules/dbconnector.js:15:25)\n at App._exec (/home/brianeng/nodejsapp/lib/core/app.js:708:49)\n at App.exec (/home/brianeng/nodejsapp/lib/core/app.js:644:16)"
status
:
"500"
I then tried to switch to the old legacy Mysql driver and still get the same error by referencing the mysql npm rather than mysql2
For the hell of it, I changed "client": "mysql2", to "client": "mysql", in the db.json file on production and then it said to run "npm install mysql --save" which I did, and then when I restarted the app the page finally started loading, I could see the preloading animation, then got a "Reached the max retries per request limit" request.
I'm going to try my digital ocean account and revisit this. I've been at it since 7am and wasting the day.
REALLY appreciate all your help Brian aka Ben haha
As a short term fix, switch your db connection to Old MySql (Depreciated), re publish then pop back into terminal, select your nodejsapp directory and npm install again which will add the old mysql library
Everything should work then at least you can start developing
ironically, the database manager works perfectly with the mysql2 driver, it is just the server connect connection which throws the error which still makes be think the issue lies with knex somehow
I will investigate the mysql2 issue and report back
Yes I've tried everything. If I change the db connection to Old MySql (Depreciated) as @Hyperbytes suggested, I finallly get past that error but I get this
{"status":"500","message":"Reached the max retries per request limit (which is 20). Refer to \"maxRetriesPerRequest\" option for details.","stack":"MaxRetriesPerRequestError: Reached the max retries per request limit (which is 20). Refer to \"maxRetriesPerRequest\" option for details.\n at Socket.<anonymous> (/var/www/vhosts/callabsolute.com/createmyearrings.com/node_modules/ioredis/built/redis/event_handler.js:182:37)\n at Object.onceWrapper (node:events:634:26)\n at Socket.emit (node:events:519:28)\n at TCP.<anonymous> (node:net:337:12)"}
Which seems to be related to this, but I don't know how to fix it or restart redis.
I was getting that max retries on Orangehost, and then when I tried a different hosting, I didn't the mysql2 error, but I did get the max retries per request error. I'm on my 13th hour of this....sigh...time for a beer.
Great job Hyperbytes. I believe you are correct that is the error we're seeing. I'm glad you guys mentioned turning off Redis for production as that was my plan this morning, nice to validate that.
I'm finally up and running on Orangehost, my ftp won't connect now for some reason, but at least I can upload to the filemanager till I figure that out.
Thank you guys for all the help. Hopefully the mysql2 issue gets corrected soon.
I had changed the nameservers back to Godaddy's and when I changed them back to Orangehosts, ftp as well as the email address I created started working in the client software after that. Thanks again guys!
I came across this thread having received the same error on a shared host. I think I've found a way around it (after a fair bit of trial and error)...just posting in case it helps someone out somewhere down the line.
I access the Node JS setup here (I guess it will look similar for most shared hosts):
Can't say if this is present in all shared hosts, regardless of management panel, but it shows in some of the previous screenshots above so I assume it may be (mine is using Direct Admin, I think the shots above may have been from cPanel).
Copy this path, then run the terminal (for me this meant closing the node JS app panel and finding the terminal in the shared hosts panel.
With the terminal open paste the path you copied above and run it. Then type npm i mysql2. Once this has run go back to the Node JS app setup panel and restart the server. This seems to correctly install mysql2 and maybe something specific to shared hosts structure that's different from VPS etc (I've run Node on a VPS without any issues).
I had previously run 'NPM install' with no errors from within the Node JS setup panel, and mysql2 was showing in the package json. Despite this I kept getting the Knex error showing in the initial post here: