Skip to content

Docker installation error - init.sh fails with syntax error: unexpected end of file due to CRLF line endings #4045

@ValentinoZA

Description

@ValentinoZA

Information about bug

When running the project using Docker Compose on Windows, the container fails during startup with a Bash syntax error originating from /workspace/init.sh

This appears to be caused by Windows CRLF line endings in init.sh which are not compatible with Bash in Linux containers.

Observed Errors

/workspace/init.sh: line 43: syntax error: unexpected end of file
/workspace/init.sh: line 2: $'\r': command not found

As a result, the frappe container exits with a non-zero status code.

Steps to Reproduce
Clone the repository on a Windows machine

Run:

`docker-compose up`

Observe the frappe container exiting with the errors above

Root Cause
The init.sh script uses CRLF (Windows) line endings, which cause Bash parsing failures inside Linux-based Docker containers.

Workaround / Fix
Running the following command inside the container resolves the issue by converting CRLF to LF:

`docker-compose run --rm frappe bash -c "sed -i 's/\r$//' /workspace/init.sh"`

After this, restarting Docker Compose allows the container to start successfully.

Module

other

Version

Latest

Installation method

docker

Relevant log output / Stack trace / Full Error Message.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions