Something bad happened: in create new site

Q: Date/Time this occurred (Provide your time zone also)
**A:**30-03-2023/21:00 IST

Q: DevKinsta Version
**A:**2.10.0

Q: OS Version
**A:**Windows 11

Q: Docker Desktop Version
**A:**4.17.1

Q: Were any error codes or messages observed? If so, what were they?
**A:**Something bad happened. In log file, Access denied for user ‘root’@‘localhost’ (using password: YES)

Q: Detailed Description of the Problem
A:

I have installed DevKinsta and try to create new site. It was showing error in the step while creating MySQL database. I checked log file and found this

[2023-03-30 21:54:01.538] [info] [containerExec] Command ‘mysql -u root -p****** -e “create database sheraton;”’ on devkinsta_db finished with exit code 1
[2023-03-30 21:54:01.539] [error] [ipcMainStep] Error in operation SITE_CREATION, step database: Error: Error (1): UERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)

I searched for the solution on the forum and tried them but still getting error.
Solutions tried:

  1. Uninstall Docker, DevKinsta and performed fresh install
  2. Try to run command in Terminal of devkinsta_db container, but got below error

mysql -u root -pMYPASSWORD

ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)

I have ss for you reference.

Hello @harmione_johnsson ,

Yeah based on the reports you provided above, looks like it’s something with the incorrect ROOT MYSQL password related issue set in that “devkinsta_db” DB container - as you also tried to connect via mysql command line in that container / via its terminal but also getting access denied for that root user (which would also prevent DevKinsta to create/manage databases in that DB container).

Do you have any existing sites created in your DevKinsta already? or it’s just a brand new installation (and no local sites created yet)?

If you don’t have any local sites created yet in your DevKinsta , then you may want to exit and shutdown both DevKinsta and Docker Dekstop completely.
After that please remove and clean-up DevKinsta completely (remove/delete any folders and data related to it, for example, inside these folders: C:\Users\yourwindowsusername\AppData\Roaming\DevKinsta , and C:\Users\yourwindowsusername\DevKinsta ) .
Also please remove all containers, images, network volumes, etc. in your Docker Desktop.

Once they’re removed completely, please restart your computer, then you may want to re-install the Docker Desktop first, and once done, you can re-install DevKinsta (it will re-download/setup new images/containers from scratch).

The solution I suggested above has helped other user too in the other thread here. Hopefully it will be working the same on your end! :smiley:

Cheers,
Agus

Hi Agus,

It’s just brand new installation.

I have removed and clean up DevKinsta and Docker completely and reinstalled both. Still same issue persist.

Hey @harmione_johnsson can you please share your main.log file with me via DM?
You can find it by clicking on the question mark icon at the bottom left corner of DevKinsta and then on Reveal log file in File Manager.
We’d like to give a look at it and help you find the culprit.

Regards,
Alessandro

Hello again @harmione_johnsson :slight_smile:

I’ve checked the main.log file you shared to my colleague Alessandro, and indeed I could see from the log, it’s the same error due to the mysql root password (incorrect), such as follow for example:

[2023-03-31 13:05:16.002] [info]  [ProgressIndicator] { isFailed: false, isOpen: false }
[2023-03-31 13:05:15.868] [error] [ipcMainStep] Error in operation SITE_CREATION, step database: Error: Error (1): UERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

And in that main.log file, I also noticed these lines (which seem normal for the initial setup):

[2023-03-31 12:58:12.087] [info]  [containerExec] Command 'mysql -u root -p****** -e "SHOW DATABASES;"' on devkinsta_db finished with exit code 1
[2023-03-31 12:58:32.601] [info]  [configureDatabaseUser] Database root password is missing or incorrect, resetting it.
[2023-03-31 12:58:32.653] [info]  [dbResetScripts] DB reset SQL file created at C:\Users\dhara\AppData\Local\Temp\mariadb_reset.sql.
[2023-03-31 12:58:32.655] [info]  [dbResetScripts] DB reset Shell script file created at C:\Users\dhara\AppData\Local\Temp\mariadb_reset.sh.
[2023-03-31 12:58:32.657] [info]  [dockerUtil/createContainer] Create 'devkinsta_reset_mariadb_root' container

Then the DB root password reset (.sh script file) had been executed many times there, but all returned with " finished with exit code 1 " (means there’s an error) like these for examples:

[2023-03-31 12:59:10.194] [info]  [containerExec] Command 'bash /tmp/mariadb_reset.sh' on 39defdd905f1ae2f1f988112cdcd4fc2e6d02ebb2e0d4b646f6e5defe38ff3e9 finished with exit code 1
[2023-03-31 12:59:11.867] [info]  [containerExec] Command 'bash /tmp/mariadb_reset.sh' on 39defdd905f1ae2f1f988112cdcd4fc2e6d02ebb2e0d4b646f6e5defe38ff3e9 finished with exit code 1
[2023-03-31 12:59:13.643] [info]  [containerExec] Command 'bash /tmp/mariadb_reset.sh' on 39defdd905f1ae2f1f988112cdcd4fc2e6d02ebb2e0d4b646f6e5defe38ff3e9 finished with exit code 1

I also have tried on my Windows 10 pro machine once again today/just now:

  1. I completely deleted/removed the DevKinsta and it’s files/folders under my folders: “C:\Users\iagus\AppData\Roaming\DevKinsta” and “C:\Users\iagus\DevKinsta” , and also I deleted all devkinsta_* Containers, Images and Volumes in my Docker Desktop.

  2. After that I re-installed DevKinsta, and after waited for some time (downloaded / setup the required containers), and so far I could create new site just fine - no DB error issue.

  3. I also checked my main.log file and there, I could see similar logs as yours (which seem to be normal for the initial setup) :

[2023-04-03 11:42:55.613] [info]  [containerExec] Command 'mysql -u root -p****** -e "SHOW DATABASES;"' on devkinsta_db finished with exit code 1
[2023-04-03 11:43:06.040] [info]  [configureDatabaseUser] Database root password is missing or incorrect, resetting it.
[2023-04-03 11:43:06.067] [info]  [dbResetScripts] DB reset SQL file created at C:\Users\iagus\AppData\Local\Temp\mariadb_reset.sql.
[2023-04-03 11:43:06.068] [info]  [dbResetScripts] DB reset Shell script file created at C:\Users\iagus\AppData\Local\Temp\mariadb_reset.sh.
[2023-04-03 11:43:06.069] [info]  [dockerUtil/createContainer] Create 'devkinsta_reset_mariadb_root' container

in my case, the mariadb_reset.sh script, that was initiated to reset the DB root password, could be completed with the " finished with exit code 0 " (means no error)

[2023-04-03 11:43:07.448] [info]  [containerExec] Command 'bash /tmp/mariadb_reset.sh' on 1b9f30071c5b5adaf0d075f6a650e71a47b045e01168c35b9f8be0aa82975266 finished with exit code 0

I’m still not sure why on your computer, that DB password reset process didn’t return with the " exit code 0 " (means no error) but " exit code 1 " (has an error). :thinking: and so far I couldn’t replicate the issue on my end either.

Just would like check and confirm if your “dhara” Windows user account has an Administrator access on your Windows 11 machine?

Also, maybe try to check if you have any firewall, windows defender, anti-virus or something like that, and may want to try to temporary disable them all and retry?

I’m wondering what if you try the following (I tried the same on my end and could do these just fine) :

  1. Open your Docker Desktop, click on “Containers” tab on the left side then click on the devkinsta_db name.
  2. On the devkinsta_db page, click on the “Inspect” tab , and write down/copy the value of “MYSQL_ROOT_PASSWORD” (this should be the root password for MySQL) shown there to notepad or something .
  3. On that same devkinsta_db page, click on the “Terminal” tab, and type the command:
    mysql -u root -p
  4. When prompted with the password “Enter password:” , please enter the password you noted on step 2 above.
  5. See if it could accept that password? or is it also showing “Access denied for user root” as well ?

Cheers,
Agus

Hi @Agus ,

I tried these steps. It is showing “Access denied for user root”.
Also “dhara” Windows user account has Administrator access on my Windows 11 machine.

Thanks

Thank you for your reply and confirmation for the results of those steps.
Yeah, looks like the MySQL Root password somehow didn’t reset properly on your container (devkinsta_db) it seems - as previously shown in the log that all returned with " finished with exit code 1 " (means there’s an error).

I’m still not sure why it’s not able to reset that properly and I couldn’t replicate this issue at all on my Windows 10 Pro machine (every time I deleted all files/folders and re-installed, everything went well) :thinking: I don’t have Windows 11 computer either here so can’t really test it.

What is your Windows 11 version by the way? is it Home or Pro version?
Also, when you installed Docker Desktop, did you choose / enable WSL2 ? On my Windows 10 pro machine, I did not choose/enable WSL2 and only use the Hyper-V.
If yours is set with WSL2 enabled, may want to try to disable it in your Docker Desktop’s settings , and try to re-install DevKinsta (see if that would make any difference).

In case you have any other spare computer with different Operating system (e.g.: Windows 10 Pro, Linux Ubuntu or Mac), you may also want to test to install it there and see if it’s working?

Cheers,
Agus

Hi @Agus ,

I have Windows 11 Home version.

While installing docker, it has asked to download WSL-2 extension.
But now I have disabled it and perform re-install DevKinsta. Unfortunately, it didn’t work. I’m still getting same error.

Also currently I don’t have any spare computer with me to check on difference OS.

Just wondering if your technical team would test bash file that is causing issue as identified by you. I can see there are some bug report with same issue in the forum as well.

Thanks
Harmione

Heya Harmione :slight_smile:

Thank you for the update!
I’ve reported this issue to our internal team, and have asked them to check this case/issue further - when possible on Windows 11 Home - though not sure yet if any of them has/have this specific O/S to replicate the issue (as I couldn’t replicate this at all on my Windows 10 Pro machine) .
I’ve also mentioned to them about the .sh bash script file that I noticed in your main.log which all returned with " finished with exit code 1 " .

We will update you again as soon as we have more information/update from them.

Cheers,
Agus

Hi @Agus ,

Thanks for the update ! Waiting for the solution

Regards,
Harmione

Hello @harmione_johnsson

Can you give the following a try, after you’ve made any backups needed?

  1. Delete the Docker containers
  2. Delete the associated Docker volumes for those containers
  3. Delete the folder storing config.json (%APPDATA%\Roaming\DevKinsta)
  4. Restart your PC

Then launch DevKinsta and see if this resolves the create new site bug?

Hi @ZachE,

I tried the above steps but still getting same error while creating new site.

Thanks
Harmione

Hello again :wave:

Two weeks ago I reported this to our internal dev team, and one of them tested on their personal computer (with Windows 11 Home edition as well). He tried everything (with several restarts while just creating sites and played around a bit. Even deleted the config.json file) but he could not replicate the reported problem at all. All worked fine for him as well.

I’m really sorry but so far none of us were able to replicate this issue unfortunately :bowing_man: and the solutions we suggested above (removing everything and re-installing them) usually would work just fine.
There’s newer Docker Desktop version available now (4.18), perhaps you may want to remove everything and retry with this version and see how it goes?

Regards,
Agus

Hi @Agus

Thanks for the update. I have tried many times but its not working in my system.
I’d try for some alternative.

I know I am a bit late to the party, but just in case someone else is having trouble with this specific problem the following might be a solution:

In my case the root password wasn’t set, so I just had to set it manually in docker. The following steps is how I fixed it.

  1. Open docker desktop and navigate to “Containers”
  2. Open the devkinsta_db container
  3. Navigate to the inspect tab
  4. Find the Config section
  5. Copy the root password under the config section; it should something like this:
"Config": {
		"Hostname": "a912727155a0",
		"Domainname": "",
		"User": "",
		"AttachStdin": false,
		"AttachStdout": false,
		"AttachStderr": false,
		"ExposedPorts": {
			"3306/tcp": {}
		},
		"Tty": false,
		"OpenStdin": false,
		"StdinOnce": false,
		"Env": [
			"MYSQL_ROOT_PASSWORD=***kinsta root password***",
			"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
			"GOSU_VERSION=1.14",
			"MARIADB_MAJOR=10.5",
			"MARIADB_VERSION=1:10.5.17+maria~ubu2004"
  1. Navigate back to the container sections
  2. Open the DB terminal
  3. Log into mariadb using mysql -u root
    If the root password wasn’t set then you should get a mysql prompt
  4. Set the password to your kinsta root password: ALTER USER 'root'@'localhost' IDENTIFIED BY 'password copied from the config';
    If successful you should get the following response Query OK, 0 rows affected (0.020 sec)

Now you should be able to get past the error.

Hey @StormChild, first of all, welcome to Kinsta Community!
Thank you very much for sharing your solution, I am sure it will be handy for other facing the same issue :clap:

Regards,
Alessandro