ddev: mysql 5.7: Failed to import database: exit status 137 (Out of Memory killed)

Is there an existing issue for this?

  • I have searched the existing issues

Run a Diagnostic and Paste Link Here

https://gist.github.com/joelpittet/34b8737c976835ba88ca11b2a233aae4

❯ ddev debug get-volume-db-version
mysql:5.7

❯ ddev debug check-db-match
database in volume matches configured database: mysql:5.7

Current Behavior

Database fails to import at a seemingly random % on a db that is 150M

❯ ddev import-db --src=/tmp/PROJECT.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
Failed to import database db for PROJECT failed to import database: exit status 137================================================================================================================>             ] 93% ETA 0:00:01
stdout:
stderr:

Expected Behavior

Database imports

Steps To Reproduce

I believe it’s mysql 5.7 config related, maybe max_packet_size and potentially running out of memory.

Anything else?

During ddev debug test it powers off the projects, and after that the import goes through as expected.

So kind of a workaround, but this happens every so often so I thought I should report it to see if we can’t get to the bottom of it, or if others have this issue too.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (15 by maintainers)

Most upvoted comments

yeah, that’s true changed RAM to 8gb

faced with the same problem, changed memory for colima from 100 gb to 200 gb and this fixed the problem

Oh I’ so happy you’re using latest ddev HEAD, thanks!

I just noticed that you gave me a colima -v list but in your gist it said “Docker Desktop Version: Docker Desktop for Mac 4.6.1 build 76265”, but I see in there you have " docker-platform colima" - I’ll have to pay more attention! And probably need to improve that script. It found the Docker Desktop (which I hope isn’t also running, but apparently is still installed, which is fine).

For colima, to increase the disk space you have to destroy everything and create the colima instance again, sadly. colima delete && colima start --cpu 4 --memory 6 --dns=1.1.1.1. --disk 120. You’ll lose all databases.

To snapshot the databases of all registered projects you can ddev snapshot -a before you do that.

Thanks, yes, ddev debug test does that, forgot you’d done the gist (and thanks for doing that).

test_ddev.sh (ddev debug test) just does this,

docker run --rm busybox:stable df -h

And it does look to me like you have a small amount of disk space available for somebody who likes to do large imports, as I understand. It looks to me like you have the default, and I almost always set it to 100GB or higher.

It’s easy to change it, as I’m sure you know:

Settings_-_Docker_Desktop

As you see in my snapshot, sometimes the docker desktop GUI lies pretty badly.

And it’s easy to free up disk space if space is tight.

You can

  • ddev clean (See ddev help clean)
  • ddev poweroff && docker rm -f $(docker ps -aq) && docker rmi -f $(docker images -q) (Deletes all docker images, does no harm, they’ll be downloaded again.)
  • ddev delete images (Tries to delete images that aren’t in use any more)

The only thing to be careful of when cleaning up is your docker volumes which is where the databases are.