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

startup.sh: $'\r': command not found #243

Closed
laph95 opened this issue Apr 11, 2024 · 8 comments
Closed

startup.sh: $'\r': command not found #243

laph95 opened this issue Apr 11, 2024 · 8 comments
Assignees
Labels
bug Something isn't working deployment This issue deals with deployment

Comments

@laph95
Copy link

laph95 commented Apr 11, 2024

Describe the bug
docker-compose.sh executes and creates container into Docker Desktop, containing 3 images: caddy and frontend run well but backend image fails and gives logs attached.
ciso-assistant_docker_fail.log

To Reproduce
Steps to reproduce the behavior:

  1. Execute docker-compose.sh
  2. See error

Expected behavior
All 3 images to run and application accessible at localhost:8443

Screenshots
ciso-assistant_screenshot

Environment (please complete the following information):

  • Device: Laptop
  • OS: Windows 11
  • Docker Desktop v4.28.0
@Mohamed-Hacene
Copy link
Collaborator

Mohamed-Hacene commented Apr 11, 2024

Hi @laph95, thanks for the issue. I will try to reproduce your error and come back to you as fast as I can. I need to know if it's a global issue on windows or just in your case.

@laph95
Copy link
Author

laph95 commented Apr 11, 2024

Thank you @Mohamed-Hacene. Actually I was wondering if the issue could come from using Docker Desktop... An additional point: doc states that credentials will be asked at a certain point during docker-compose.sh execution and I've never been asked.

@VigilantOps
Copy link

VigilantOps commented Apr 12, 2024

Hi,

the backend console shows this error :

startup.sh: line 3: $'\r': command not found
startup.sh: line 25: syntax error: unexpected end of file

After reformating the startup.sh script, it works for me.

@Mohamed-Hacene
Copy link
Collaborator

Mohamed-Hacene commented Apr 12, 2024

Hi @VigilantOps, thanks for sharing your solution. Could you show us what you've reformatted in the startup.sh?

@laph95 Once your problem is fixed, I'll help you create your credentials if you still don't have them.

@Mohamed-Hacene Mohamed-Hacene added bug Something isn't working deployment This issue deals with deployment labels Apr 12, 2024
@laph95
Copy link
Author

laph95 commented Apr 12, 2024

Thank you very much @VigilantOps, I opened startup.sh script with Notepad and converted EOL to Unix in order to remove '\r'. Then it works as expected!

@Mohamed-Hacene: it would be great if you can help for the credentials, thanks.

@Mohamed-Hacene
Copy link
Collaborator

Here's a quick workaround once you've launched your container:

  • retrieve the backend image ID 'ciso-assistant-community-backend' with the command docker ps -a | grep backend or via docker desktop
  • use the command docker exec -it <ID> python manage.py createsuperuser, with the ID previously retrieved
  • enter your credentials, which you can use immediately to log in

@Mohamed-Hacene Mohamed-Hacene changed the title Docker compose backend issue startup.sh: $'\r': command not found Apr 12, 2024
@VigilantOps
Copy link

@Mohamed-Hacene it seems to be an issue with the file encoding.

Github is referencing a configuration which can solve multi OS collaboration : Configuring Git to handle line endings

Maybe this can solve the issue in the future.

Regards,

@laph95
Copy link
Author

laph95 commented Apr 12, 2024

Thank you very much @Mohamed-Hacene. All is working fine now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working deployment This issue deals with deployment
Projects
None yet
Development

No branches or pull requests

3 participants