Closed vresende closed 2 months ago
https://forums.docker.com/t/no-blkio-warnings-on-docker-info/115857
meyay: It’s a warning that indicates that the kernel does not support blkio throttle settings for the containers.
If you really need that feature, you will have to compile your own WSL2 kernel and configure WSL2 to use it. The origin and fix are outside of docker’s reach.
The error command not found: $'\r' usually occurs when there are line-ending issues in a shell script. It typically happens when a script is created or edited on a Windows system, which uses carriage return and newline (\r\n) for line endings, rather than just newline (\n) used in Unix/Linux systems.
sed -i 's/\r$//' /tmp/tmp.yH8VAj9gTF/install.sh
But I can't find a place where it's located to see how it is written.
This line /tmp/tmp.nueE4nmBWp/install.sh: line 3: $'\r': command not found
O erro command not found: $'\r' geralmente ocorre quando há problemas de fim de linha em um script de shell. Isso geralmente acontece quando um script é criado ou editado em um sistema Windows, que usa retorno de carro e nova linha (\r\n) para fins de linha, em vez de apenas nova linha (\n) usada em sistemas Unix/Linux.
sed -i 's/\r$//' /tmp/tmp.yH8VAj9gTF/install.sh
Mas não consigo encontrar um lugar onde ele esteja localizado para ver como está escrito. Esta linha
/tmp/tmp.nueE4nmBWp/install.sh: line 3: $'\r': command not found
Exactly.
I need to use dos2unix to install spin.
The error is apparently in this file: https://github.com/serversideup/spin-template-laravel-basic/blob/main/install.sh I don't know if it's possible to make a PR with the fix.
I'll be taking a look into this so you can run it natively with WLS2. Thanks for your patience!
O erro command not found: $'\r' geralmente ocorre quando há problemas de fim de linha em um script de shell. Isso geralmente acontece quando um script é criado ou editado em um sistema Windows, que usa retorno de carro e nova linha (\r\n) para fins de linha, em vez de apenas nova linha (\n) usada em sistemas Unix/Linux. sed -i 's/\r$//' /tmp/tmp.yH8VAj9gTF/install.sh Mas não consigo encontrar um lugar onde ele esteja localizado para ver como está escrito. Esta linha
/tmp/tmp.nueE4nmBWp/install.sh: line 3: $'\r': command not found
Exactly.
I need to use dos2unix to install spin.
The error is apparently in this file: https://github.com/serversideup/spin-template-laravel-basic/blob/main/install.sh I don't know if it's possible to make a PR with the fix.
This is a fix for this error without any installation (natively).
Thanks YevheniiVolosiuk
I was hoping to get to this today, but I ran into issues on another task (gotta love Fridays).
I am hoping next week will be a majority of my time towards Spin. I will keep you all posted!
I am unfortunately not able to replicate this.
https://github.com/user-attachments/assets/2568c6de-2947-4ee5-99d4-468c5158acde
wsl
before running any commands. dos2unix
should NOT be requiredThe GitHub automation automatically closed this, but I will definitely re-open this if we can replicate it
@jaydrogers
Outra atualização
Infelizmente não consigo replicar isso.
Vídeo dos meus passos
SpinNewLaravel.mp4
Lista de verificação/perguntas
- Todos estão executando o Spin v2.0.2?
- Parece que estamos todos executando o Jammy (Ubuntu 22.04) no WSL
- Certifique-se de que você está executando
wsl
antes de executar qualquer comando.dos2unix
NÃO deve ser necessário
I’m using WSL2 but with Ubuntu. If you run the same command through the Ubuntu terminal, it will show this error.
The Pull Request will solve this. It will adjust the file according to the environment. If you can approve it, I would be grateful.
Thanks @vresende, I am grateful for your changes but I am always hesitant to publish a fix without having a full ability to replicate the bug and ensure the fix isn't going to cause issues on other platforms.
Are you able to record a screen walking through your steps showing the error?
It's odd that I cannot replicate it on my end because I have a pretty vanilla Ubuntu WSL setup. Nothing fancy with it.
@jaydrogers if possible, try using Windows with WSL2 to install Spin via the Ubuntu terminal, not PowerShell, and with that, you should be able to replicate the reported issue.
Here is a video using the Ubuntu shell. I am very confused why I wouldn't be able to replicate the issue.
Are you able to record your screen showing that it's not working?
https://github.com/user-attachments/assets/18fc0bb6-d731-4d11-ad34-54a208f109e5
In the video below, I removed the installation of Spin and reinstalled it, as you will see, an error occurs.
I can work around the error by applying dos2unix to remove invalid line breaks.
However, when running the command spin new laravel my-app, the error persists.
https://github.com/user-attachments/assets/d612c3a7-174c-4e06-8d83-23fd051b1993
In the video below, I removed the installation of Spin and reinstalled it, as you will see, an error occurs.
I can work around the error by applying dos2unix to remove invalid line breaks.
However, when running the command spin new laravel my-app, the error persists. capture.mp4
can you show your
git config --edit --global
for these 2 options?
if it's not I have tried to make it like this and check if it helps. For me, it works. After new changes try to install (clone) a spin and new laravel one more time.
No vídeo abaixo, removi a instalação do Spin e reinstalei, como vocês verão, ocorre um erro. Posso contornar o erro aplicando dos2unix para remover quebras de linha inválidas. Porém, ao executar o comando spin new laravel my-app, o erro persiste. capture.mp4
você pode mostrar seu
git configuração --editar --global
para essas 2 opções?
se não for, tentei fazer assim e ver se ajuda. Para mim, funciona. Após novas mudanças, tente instalar (clonar) um spin e um novo laravel mais uma vez.
@YevheniiVolosiuk worked! After adding these configurations, I reinstalled and it resolved the issue.
Thank you very much.
If you could add this information to the documentation.
Best regards
I greatly appreciate you both working through this!
Is there something I can do on the Spin side that would prevent these line endings?
I was just hesitant with the sed
implementation because it was a file modification on the fly.
If there is a way I can set a Vscode setting or something, I'd love to see how that works.
I believe that adding this information to the documentation, specifically in the installation section for WSL2 and Linux, would be helpful. It should mention that if this error occurs, the following commands need to be executed:
git config --global core.autocrlf input
git config --global core.eol lf
Explanation of the command:
autocrlf = input: This means Git will convert CRLF (end of line in Windows) to LF (end of line in Unix) when committing. eol = lf: Defines that line breaks (End Of Line) should be LF.
I greatly appreciate you both working through this!
Is there something I can do on the Spin side that would prevent these line endings?
I was just hesitant with the
sed
implementation because it was a file modification on the fly.If there is a way I can set a Vscode setting or something, I'd love to see how that works.
You can configure VSCode to use Unix-style line endings (LF) instead of Windows-style (CRLF):
Open the problematic file in VSCode.
Look at the bottom-right corner of the VSCode window. You'll see either CRLF or LF.
Click on CRLF and select LF from the pop-up menu.
Save the file. This will convert all line endings to LF.
To make this the default setting for all new files:
Open Settings in VSCode (Ctrl + ,).
Search for EOL or end of line.
Set Files: Eol to \n (Unix).
You can create a .gitattributes file to enforce Unix-style line endings:
Create a .gitattributes file in the root of your repository.
Add the following content to ensure all shell scripts (*.sh) use LF:
text
*.sh text eol=lf
Commit the .gitattributes file to your repository.
This ensures consistent line endings across all environments and prevents line-ending issues when pulling or cloning the repository.
Some ideas on how it can be resolved also need a test.
Thanks for putting me down the right path @YevheniiVolosiuk!
I forgot that I am doing a sparse checkout on install:
In the upgrade script I had references to resolve line endings from there (a concept from the OhMyZSH team). I added this to the install script.
@vresende: Could you do me a favor and help me test the latest v2.1.0-alpha1
release?
If you could perform these steps on your machine:
rm -rf ~/.spin
git config --global --unset core.autocrlf
git config --global --unset core.eol
bash -c "$(curl -fsSL -H "Cache-Control: no-cache" https://raw.githubusercontent.com/serversideup/spin/v2.1.0-alpha1/tools/install.sh)" "" --beta
spin version
This should hopefully work and be an automated fix with no user interaction 😅
"Happy to help! I'm glad we could resolve this together! :v:
@jaydrogers tested and approved.
Awesome!! Thanks for working through this!
Once v2.1.0
is stable and released, I would advise to remove ~/.spin
and reinstall from the stable channel.
I'm on 2.1.5 but still get this issue. Do we need to edit git config?
Spin Version:
v2.1.5 [stable] (User Installed)
spin init laravel
UPDATE: solved by running
git config --global core.autocrlf input
git config --global core.eol lf
I'm on 2.1.5 but still get this issue. Do we need to edit git config?
Spin Version: v2.1.5 [stable] (User Installed)
spin init laravel
UPDATE: solved by running
git config --global core.autocrlf input git config --global core.eol lf
You may have to remove spin first, then redownload it to get the fix:
rm -rf ~/.spin
On install, it will run the commands for you to fix this.
I did that. I had to rmrf it because it wouldn't update. So installed fresh but still had the issue. Solved it by running
git config --global core.autocrlf input
git config --global core.eol lf
Can you share more details on your environment so I can see if I can replicate in WSL2?
I posted more info in the already open issue. Sorry should have checked first before posting here https://github.com/serversideup/spin/issues/99 and here https://github.com/serversideup/spin-template-laravel-basic/issues/9
FYI just running on our other devs machines and same issue
Current Behavior
"When trying to execute the command spin new laravel my-billion-dollar-idea, I am receiving the following error.
I am running this on Ubuntu via WSL2.
The error seems to be related to charset; running dos2unix on the file will probably fix it.
Expected Behavior
"The expected behavior is the creation of a new Laravel project using Spin."
Steps To Reproduce
spin version" or "spin --version
, you will receive an error.find ~/.spin -type f -exec dos2unix {} ;
to fix the error.spin version" or "spin --version
again. It should return the expected output.spin new laravel my-billion-dollar-idea
and you will receive the error mentioned in the issue description.Environment
Anything else?
No