Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker database fails to initialize on Windows #1155

Closed
2 tasks done
Sammy-T opened this issue Jun 25, 2023 · 2 comments · Fixed by #1156
Closed
2 tasks done

Docker database fails to initialize on Windows #1155

Sammy-T opened this issue Jun 25, 2023 · 2 comments · Fixed by #1156
Labels
bug Something isn't working released

Comments

@Sammy-T
Copy link
Contributor

Sammy-T commented Jun 25, 2023

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

When following the Quick Start documentation to run Gotrue via Docker, the database fails to initialize after running make dev on Windows.

The Gotrue container builds and runs properly but the Postgres container fails to initialize the database and shuts down early on the initial run.
The log for the Postgres container shows the following message before exiting:

/usr/local/bin/docker-entrypoint.sh: line 170: /docker-entrypoint-initdb.d/init.sh: cannot execute: required file not found

Additionally, if both containers are restarted, the logs from the Gotrue container show that it fails to connect using the admin user that should've been created from the init_postgres.sh script.

To Reproduce

Clone the repo to a Windows machine and follow the 'If you have docker installed' instructions under Quick Start.

Expected behavior

The Gotrue and Postgres containers should build, run, and communicate without errors.

System information

  • OS: Windows 10
@Sammy-T Sammy-T added the bug Something isn't working label Jun 25, 2023
@Sammy-T
Copy link
Contributor Author

Sammy-T commented Jun 25, 2023

So it seems that the issue was that the init_postgres.sh script was being copied into the container with Windows line endings. When the repository files are switched to use LF line endings, it builds and runs as expected.

kangmingtay pushed a commit that referenced this issue Jun 26, 2023
This addresses differences in eol handling between OSes by normalizing
the line endings using a `.gitattributes` file.

On Windows, cloning the repo and building the containers causes the
Postgres container to fail to initialize and shutdown early due to
`init_postgres.sh` being copied into the container with Windows line
endings.

Fixes #1155

New clones of the repo shouldn't have issues with this after this PR is
merged. Existing clones which don't already contain `LF` line endings
may have to reset using
```
git rm --cached -r .
git reset --hard
```
to update their files' line endings.
@github-actions
Copy link
Contributor

🎉 This issue has been resolved in version 2.77.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

uxodb pushed a commit to uxodb/auth that referenced this issue Nov 13, 2024
This addresses differences in eol handling between OSes by normalizing
the line endings using a `.gitattributes` file.

On Windows, cloning the repo and building the containers causes the
Postgres container to fail to initialize and shutdown early due to
`init_postgres.sh` being copied into the container with Windows line
endings.

Fixes supabase#1155

New clones of the repo shouldn't have issues with this after this PR is
merged. Existing clones which don't already contain `LF` line endings
may have to reset using
```
git rm --cached -r .
git reset --hard
```
to update their files' line endings.
LashaJini pushed a commit to LashaJini/auth that referenced this issue Nov 13, 2024
This addresses differences in eol handling between OSes by normalizing
the line endings using a `.gitattributes` file.

On Windows, cloning the repo and building the containers causes the
Postgres container to fail to initialize and shutdown early due to
`init_postgres.sh` being copied into the container with Windows line
endings.

Fixes supabase#1155

New clones of the repo shouldn't have issues with this after this PR is
merged. Existing clones which don't already contain `LF` line endings
may have to reset using
```
git rm --cached -r .
git reset --hard
```
to update their files' line endings.
LashaJini pushed a commit to LashaJini/auth that referenced this issue Nov 15, 2024
This addresses differences in eol handling between OSes by normalizing
the line endings using a `.gitattributes` file.

On Windows, cloning the repo and building the containers causes the
Postgres container to fail to initialize and shutdown early due to
`init_postgres.sh` being copied into the container with Windows line
endings.

Fixes supabase#1155

New clones of the repo shouldn't have issues with this after this PR is
merged. Existing clones which don't already contain `LF` line endings
may have to reset using
```
git rm --cached -r .
git reset --hard
```
to update their files' line endings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant