# Liquibase Docker generateChangeLog Failed to create parent directories for file /liquibase/changelog/changelog.xml

**URL:** https://forum.liquibase.org/t/liquibase-docker-generatechangelog-failed-to-create-parent-directories-for-file-liquibase-changelog-changelog-xml/7823
**Category:** General Discussion
**Created:** [February 24, 2023, 3:39am UTC](https://forum.liquibase.org/t/liquibase-docker-generatechangelog-failed-to-create-parent-directories-for-file-liquibase-changelog-changelog-xml/7823 "2023-02-24T03:39:52Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![karenxbai](https://avatars.discourse-cdn.com/v4/letter/k/d9b06d/32.png) [@karenxbai](https://forum.liquibase.org/u/karenxbai)
#### Post date: [February 24, 2023, 3:39am UTC](https://forum.liquibase.org/t/liquibase-docker-generatechangelog-failed-to-create-parent-directories-for-file-liquibase-changelog-changelog-xml/7823/1 "2023-02-24T03:39:52Z")

</div>

I know there have been couple of discussions on this topic and I have followed through them–

1. [postgresql - Liquibase via Docker - Changelog is not written to disk - Stack Overflow](https://stackoverflow.com/questions/67277878/liquibase-via-docker-changelog-is-not-written-to-disk)
2. [Unable to setup liquibase using docker image - General Discussion - Liquibase]  
([Unable to setup liquibase using docker image - #12 by MikeOlivas](https://forum.liquibase.org/t/unable-to-setup-liquibase-using-docker-image/5540/12)),

But my issues still persist, that is I still can not generate changelog to my local linux system.

liquibase.docker.properties  
classpath: /liquibase/changelog  
url: jdbc:postgresql://rdsurl:1234/testdb?currentSchema=public  
changeLogFile: changelog.xml  
username: testuser  
password: TestPwd

1. The following command run successfully and if I access the liquibase container, I can see changelog.xml put in the liquibase container /liquibase directory . But I can’t access from the local host;  
docker run --rm --net=“host” -v /home/user/docker/init-liquibase/changelog:/liquibase/changelog liquibase/liquibase --defaultsFile=/liquibase/changelog/liquibase.docker.properties – **changeLogFile=changelog.xml** generateChangeLog --log-level flag

2. If I follow the links above to put absolute path in front the changlog.xml, I get error.  
docker run --rm --net=“host” -v /home/user/docker/init-liquibase/changelog:/liquibase/changelog liquibase/liquibase --defaultsFile=/liquibase/changelog/liquibase.docker.properties – **changeLogFile=/liquibase/changelog/changelog.xml** generateChangeLog --log-level flag

Error log–  
BEST PRACTICE: The changelog generated by diffChangeLog/generateChangeLog should be inspected for correctness and completeness before being deployed. Some database objects and their dependencies cannot be represented automatically, and they may need to be manually updated before being deployed.  
[2023-02-24 02:09:15] INFO [liquibase.database] Set default schema name to public  
[2023-02-24 02:09:16] INFO [liquibase.diff] changeSets count: 43  
[2023-02-24 02:09:16] INFO [liquibase.diff] liquibase/changelog/changelog.xml does not exist, creating and adding 43 changesets.  
[2023-02-24 02:09:16] **WARNING [liquibase.resource] Failed to create parent directories for file /liquibase/changelog/changelog.xml**  
[2023-02-24 02:09:16] **SEVERE [liquibase.integration] /liquibase/changelog/changelog.xml**  
**liquibase.exception.CommandExecutionException: liquibase.exception.LiquibaseException: liquibase.exception.CommandExecutionException: java.nio.file.AccessDeniedException: /liquibase/changelog/changelog.xml**  
at liquibase.command.CommandScope.execute(CommandScope.java:186)  
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:55)  
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:24)  
at picocli.CommandLine.executeUserObject(CommandLine.java:2041)  
at picocli.CommandLine.access$1500(CommandLine.java:148)  
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)  
at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)  
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)  
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)  
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)  
at picocli.CommandLine.execute(CommandLine.java:2170)  
at liquibase.integration.commandline.LiquibaseCommandLine.lambda$execute$1(LiquibaseCommandLine.java:352)  
at liquibase.Scope.child(Scope.java:189)

---

<div class="post-metadata">

### Author: ![MikeOlivas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/mikeolivas/32/183_2.png) [@MikeOlivas](https://forum.liquibase.org/u/MikeOlivas)
#### Post date: [February 24, 2023, 1:45pm UTC](https://forum.liquibase.org/t/liquibase-docker-generatechangelog-failed-to-create-parent-directories-for-file-liquibase-changelog-changelog-xml/7823/2 "2023-02-24T13:45:50Z")

</div>

> [@karenxbai](#):
>
> – **changeLogFile=changelog.xml**

Hi @karenxbai Thanks for joining the community.  
Try changing your changelog file name to  
–changeLogFile=./changelog/changelog.xml

In the container liquibase runs from /liquibase  
so that means that in the container the changelog directory is in ./changelog  
or /liquibase/changelog.  
Outside of the container (your filesystem) it will be your mount point.  
/home/user/docker/init-liquibase/changelog

Visual way to the look at it.  
home/user/docker/init-liquibase/changelog ← your local filesystem

In the container  
/liquibase ← where liquibase binary runs when you issue liquibase commands (non accessbile after the commands run)  
/liquibase/changelog ← anything **mounted** here (using -v parameter) will be accessible after liquibase finishes

When you use liquibase --changelog-file=somename.xml  
The container will place the file in the container in the /liquibase folder which cannot be accessed post run  
Hopefully that clarifies things.

---

<div class="post-metadata">

### Author: ![karenxbai](https://avatars.discourse-cdn.com/v4/letter/k/d9b06d/32.png) [@karenxbai](https://forum.liquibase.org/u/karenxbai)
#### Post date: [February 24, 2023, 6:52pm UTC](https://forum.liquibase.org/t/liquibase-docker-generatechangelog-failed-to-create-parent-directories-for-file-liquibase-changelog-changelog-xml/7823/3 "2023-02-24T18:52:50Z")

</div>

@MikeOlivas Thanks a lot for the reply and instruction.  
But I still got similar errors after use **changeLogFile=./changelog/changelog.xml** :  
See the below updated command and respective error. Why there is always an action try to create parent directory of the “changeLogFile”?  
I know that the container /liquibase/changelog is accessible since the defaultsFile=/liquibase/changelog/liquibase.docker.properties can be accssed.

CMD–  
docker run --rm --net=“host” -v /home/user/docker/init-liquibase/changelog:/liquibase/changelog liquibase/liquibase --defaultsFile=/liquibase/changelog/liquibase.docker.properties --changeLogFile=./changelog/changelog.xml generateChangeLog --log-level flag \> log022401 2\>&1

error–  
[2023-02-24 18:41:04] INFO [liquibase.diff] ./changelog/changelog.xml does not exist, creating and adding 43 changesets.  
[2023-02-24 18:41:04] WARNING **[liquibase.resource] Failed to create parent directories for file changelog/changelog.xml**  
[2023-02-24 18:41:04] SEVERE [liquibase.integration] changelog/changelog.xml  
liquibase.exception.CommandExecutionException: liquibase.exception.LiquibaseException: liquibase.exception.CommandExecutionException: java.nio.file.AccessDeniedException: changelog/changelog.xml
