pretendo-docker icon indicating copy to clipboard operation
pretendo-docker copied to clipboard

Error

Open ttdu08of opened this issue 1 year ago • 24 comments

Hello, I have an error when starting the script... Can you please help ? image

ttdu08of avatar Oct 28 '24 19:10 ttdu08of

invalid header field value for "Authorization"

The setup script randomly generates the secret key for MinIO, so I wonder if an invalid key is being generated. Can you please follow these steps to share the keys here safely?

# Stop the server
docker compose down

# Back up the current MinIO secrets
mkdir -p backups && cp environment/minio.local.env backups/minio-backup.env

# Regenerate the secrets and invalidate the old ones
./scripts/setup-environment.sh

# Display the MinIO secret key
cat backups/minio-backup.env

Then, please send the old secret key (the line starting with MINIO_ROOT_PASSWORD=) here.

MatthewL246 avatar Oct 28 '24 20:10 MatthewL246

image

ttdu08of avatar Oct 28 '24 20:10 ttdu08of

It looks like the key is fine, but the script output gives me another idea about what might be going wrong. By default, when you use Git in Windows to clone a repo, it converts the line endings in files from LF (Linux-style) to CRLF (Windows-style), which can break Bash scripts. This is why I recommend cloning the repo inside your WSL distro in the Tips for Windows Users section of the server setup guide.

Can you try re-cloning the repo inside your WSL home directory?

MatthewL246 avatar Oct 28 '24 21:10 MatthewL246

I did it using the ubuntu application, I didn't use GIT or WSL.

ttdu08of avatar Oct 28 '24 21:10 ttdu08of

Interesting. What's your Git version?

git --version

MatthewL246 avatar Oct 28 '24 21:10 MatthewL246

My git version is 2.43.0

ttdu08of avatar Oct 28 '24 21:10 ttdu08of

What are the line endings of the scripts?

file ./scripts/*
file ./scripts/internal/*

MatthewL246 avatar Oct 28 '24 21:10 MatthewL246

Which script? On the CMD?

ttdu08of avatar Oct 28 '24 21:10 ttdu08of

The script files in the repo - just run those two commands and send the output here.

MatthewL246 avatar Oct 28 '24 21:10 MatthewL246

./setup.sh and docker compose up -d --build ?

ttdu08of avatar Oct 28 '24 21:10 ttdu08of

file ./scripts/*
file ./scripts/internal/*

MatthewL246 avatar Oct 28 '24 21:10 MatthewL246

exit@DESKTOP-DPBURID:/mnt/c/Users/Théo/Desktop/pretendo-docker$ file ./scripts/*
./scripts/README.md:                   ASCII text, with CRLF line terminators
./scripts/backup.sh:                   Bourne-Again shell script, ASCII text executable, with CRLF line terminators
./scripts/compile-custom-inkay.sh:     Bourne-Again shell script, ASCII text executable, with CRLF line terminators
./scripts/create-cemu-online-files.sh: Bourne-Again shell script, ASCII text executable, with CRLF line terminators
./scripts/create-juxt-community.sh:    Bourne-Again shell script, ASCII text executable, with CRLF line terminators
./scripts/full-reset.sh:               Bourne-Again shell script, ASCII text executable, with CRLF line terminators
./scripts/get-boss-keys.sh:            Bourne-Again shell script, ASCII text executable
./scripts/internal:                    directory
./scripts/make-pnid-dev.sh:            Bourne-Again shell script, ASCII text executable, with CRLF line terminators
./scripts/patch-sssl-certificate.sh:   Bourne-Again shell script, ASCII text executable, with CRLF line terminators
./scripts/restore.sh:                  Bourne-Again shell script, ASCII text executable, with CRLF line terminators
./scripts/run-in-container:            directory
./scripts/setup-environment.sh:        Bourne-Again shell script, ASCII text executable
./scripts/setup-submodule-patches.sh:  Bourne-Again shell script, ASCII text executable
./scripts/upload-3ds-files.sh:         Bourne-Again shell script, ASCII text executable, with CRLF line terminators
exit@DESKTOP-DPBURID:/mnt/c/Users/Théo/Desktop/pretendo-docker$ file ./scripts/internal/*
./scripts/internal/firstrun-minio-container.sh:        Bourne-Again shell script, ASCII text executable
./scripts/internal/firstrun-mongodb-container.sh:      Bourne-Again shell script, ASCII text executable
./scripts/internal/firstrun-postgres-container.sh:     Bourne-Again shell script, ASCII text executable, with CRLF line terminators
./scripts/internal/framework.sh:                       Bourne-Again shell script, ASCII text executable
./scripts/internal/migrations.sh:                      Bourne-Again shell script, ASCII text executable, with CRLF line terminators
./scripts/internal/update-account-servers-database.sh: Bourne-Again shell script, ASCII text executable, with CRLF line terminators
./scripts/internal/update-miiverse-endpoints.sh:       Bourne-Again shell script, ASCII text executable, with CRLF line terminators
./scripts/internal/update-postgres-password.sh:        Bourne-Again shell script, ASCII text executable, with CRLF line terminators
exit@DESKTOP-DPBURID:/mnt/c/Users/Théo/Desktop/pretendo-docker$

ttdu08of avatar Oct 28 '24 21:10 ttdu08of

What should I do now?

ttdu08of avatar Oct 28 '24 21:10 ttdu08of

That is definitely the problem: half of your scripts have CRLF line endings, so those scripts won't work. That is also very strange - I have no idea why half of them would (apparently) randomly have different line endings.

You should be able to rectify the issue by converting them all to LF line endings with the following commands.

sudo apt install dos2unix
find scripts -type f -print0 | xargs -0 dos2unix

MatthewL246 avatar Oct 28 '24 21:10 MatthewL246

What next?

ttdu08of avatar Oct 28 '24 21:10 ttdu08of

Re-run the setup script, it should be fixed if I'm right about the cause of the error.

MatthewL246 avatar Oct 28 '24 21:10 MatthewL246

It makes the same error, (I run it with the Ubuntu app)

ttdu08of avatar Oct 28 '24 21:10 ttdu08of

Can you check if the scripts all have the correct line endings now? Run this and send the output here.

file ./scripts/*
file ./scripts/internal/*
file ./scripts/run-in-container/*

MatthewL246 avatar Oct 28 '24 22:10 MatthewL246

./scripts/README.md:                   ASCII text
./scripts/backup.sh:                   Bourne-Again shell script, ASCII text executable
./scripts/compile-custom-inkay.sh:     Bourne-Again shell script, ASCII text executable
./scripts/create-cemu-online-files.sh: Bourne-Again shell script, ASCII text executable
./scripts/create-juxt-community.sh:    Bourne-Again shell script, ASCII text executable
./scripts/full-reset.sh:               Bourne-Again shell script, ASCII text executable
./scripts/get-boss-keys.sh:            Bourne-Again shell script, ASCII text executable
./scripts/internal:                    directory
./scripts/make-pnid-dev.sh:            Bourne-Again shell script, ASCII text executable
./scripts/patch-sssl-certificate.sh:   Bourne-Again shell script, ASCII text executable
./scripts/restore.sh:                  Bourne-Again shell script, ASCII text executable
./scripts/run-in-container:            directory
./scripts/setup-environment.sh:        Bourne-Again shell script, ASCII text executable
./scripts/setup-submodule-patches.sh:  Bourne-Again shell script, ASCII text executable
./scripts/upload-3ds-files.sh:         Bourne-Again shell script, ASCII text executable
./scripts/internal/firstrun-minio-container.sh:        Bourne-Again shell script, ASCII text executable
./scripts/internal/firstrun-mongodb-container.sh:      Bourne-Again shell script, ASCII text executable
./scripts/internal/firstrun-postgres-container.sh:     Bourne-Again shell script, ASCII text executable
./scripts/internal/framework.sh:                       Bourne-Again shell script, ASCII text executable
./scripts/internal/migrations.sh:                      Bourne-Again shell script, ASCII text executable
./scripts/internal/update-account-servers-database.sh: Bourne-Again shell script, ASCII text executable
./scripts/internal/update-miiverse-endpoints.sh:       Bourne-Again shell script, ASCII text executable
./scripts/internal/update-postgres-password.sh:        Bourne-Again shell script, ASCII text executable
./scripts/run-in-container/create-account-dat.js:                JavaScript source, ASCII text
./scripts/run-in-container/create-juxt-community.js:             JavaScript source, ASCII text
./scripts/run-in-container/friends-nex-go-rewrite-migration.sql: ASCII text
./scripts/run-in-container/make-pnid-dev.js:                     JavaScript source, ASCII text
./scripts/run-in-container/minio-init.sh:                        POSIX shell script, ASCII text executable
./scripts/run-in-container/mongodb-init.js:                      ASCII text
./scripts/run-in-container/postgres-init.sh:                     POSIX shell script, ASCII text executable
./scripts/run-in-container/update-account-servers-database.js:   JavaScript source, ASCII text
./scripts/run-in-container/update-miiverse-endpoints.js:         JavaScript source, ASCII text

ttdu08of avatar Oct 28 '24 22:10 ttdu08of

What should I do ?

ttdu08of avatar Oct 28 '24 22:10 ttdu08of

I am not sure what the problem is at this point, since fixing the line endings didn't solve it.

MatthewL246 avatar Oct 28 '24 22:10 MatthewL246

Oh right, I wanted to try again with WSL but the problem is that I can't do the “cd” command if you don't mind, can you help me via Anydesk please? Thank you for your help

ttdu08of avatar Oct 28 '24 22:10 ttdu08of

Oh right, I wanted to try again with WSL but the problem is that I can't do the “cd” command

I'm not sure what you mean here. The Ubuntu app is itself WSL: Ubuntu is a Linux distro that runs in the Windows Subsystem for Linux.

can you help me via Anydesk please?

I'm sorry, but I don't have the time to provide 1-on-1 support for issues via remote desktop/video chat.

MatthewL246 avatar Oct 28 '24 22:10 MatthewL246

Oh right, since I have two applications, one Ubuntu and one WSL

ttdu08of avatar Oct 28 '24 22:10 ttdu08of