# Can't set up docker volume persistence on Amazon ECS

**URL:** <https://forums.percona.com/t/cant-set-up-docker-volume-persistence-on-amazon-ecs/6270>\
**Category:** Other MySQL® Questions\
**Created:** [March 25, 2018, 8:21am UTC](https://forums.percona.com/t/cant-set-up-docker-volume-persistence-on-amazon-ecs/6270 "2018-03-25T08:21:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vroad](https://avatars.discourse-cdn.com/v4/letter/v/6f9a4e/32.png) [@vroad](https://forums.percona.com/u/vroad)\
**Post date:** [March 25, 2018, 8:21am UTC](https://forums.percona.com/t/cant-set-up-docker-volume-persistence-on-amazon-ecs/6270/1 "2018-03-25T08:21:32Z")

</div>

I’m trying to set up percona server on Amazon ECS, using CloudFormation.  
If I just start percona server without setting up volumes for persistence, the container starts just fine. The problem occurs only after setting volumes. Starting server always fails with following errors.

Running --initialize-insecure datadir: /var/lib/mysql/  
mysqld: Can’t create/write to file ‘/var/lib/mysql/is\_writable’ (Errcode: 13 - Permission denied)  
2018-03-25T13:09:29.624331Z 0 [Warning] Changed limits: max\_open\_files: 1024 (requested 5000)  
2018-03-25T13:09:29.624386Z 0 [Warning] Changed limits: table\_open\_cache: 431 (requested 2000)  
2018-03-25T13:09:29.624523Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit\_defaults\_for\_timestamp server option (see documentation for more details).  
2018-03-25T13:09:29.625959Z 0 [ERROR] --initialize specified but the data directory exists and is not writable. Aborting.  
2018-03-25T13:09:29.626041Z 0 [ERROR] Aborting

Here is my CloudFormation template to create an ECS cluster with percona-server and adminer.

[url][https://gist.github.com/vroad/7f821754b44655696bd168e00e633253[/url]](https://gist.github.com/vroad/7f821754b44655696bd168e00e633253%5B/url%5D)

If I use mysql:5.7 instead of percona/percona-server 5.7, the server starts fine. Somehow this problem only occurs with percona-server.  
Probably I need to fix permissions in some way, but why the same configuration does not work on percona-server? (And how to do that on ECS’s task definition?)

[url][https://github.com/docker-library/mysql/issues/219[/url]](https://github.com/docker-library/mysql/issues/219%5B/url%5D)
