Applies to
- Liquibase Pro
- Liquibase Open Source (Community)
Conditions
- Using the Liquibase Docker image
Issue Summary
This article addresses an issue encountered when using the Liquibase Docker image, where an error occurs indicating that a required file is not found. This can happen due to misconfigured file paths, incorrect mounting of volumes, or referencing files that are not available within the container environment.
Error Message
File not found: <file-path>
Root Cause
The error occurs because the specified file is either:
- Missing from the expected directory in the Docker container.
- Incorrectly referenced due to an invalid or incomplete file path.
- Not correctly mounted or shared with the container through a Docker volume.
- The working directory or file permissions prevent Liquibase from accessing the file.
Common files that trigger this issue include:
liquibase.properties
changelog.xml
- SQL or YAML changelog files.
Resolution
Step 1: Verify File Paths
- Ensure that the file path provided in the Liquibase command is correct and matches the file structure inside the container.
- Use absolute paths if necessary.
Step 2: Mount the Correct Volume
- When running the Liquibase Docker container, ensure that the required files are correctly mounted as a volume:
/path/to/local/directory
with the absolute path to the directory containing the required files on your host machine.
Replace
Step 3: Check Working Directory
- Confirm that the working directory inside the container is correct, especially if relative paths are used.
- Use the
-w
flag in the Docker command to set the working directory:
Step 4: Validate Permissions
- Ensure that the files have appropriate permissions for access. If necessary, update the file permissions on the host machine:
chmod 644 /path/to/local/file
Step 5: Debug with Logs
- Add the
--logLevel=debug
flag to the Liquibase command to provide detailed logs that can help identify the specific cause:
Comments
0 comments
Article is closed for comments.