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

[Bug]: Installation in WSL2 fails #4427

Open
mariusbrinkmann opened this issue Nov 28, 2024 · 0 comments
Open

[Bug]: Installation in WSL2 fails #4427

mariusbrinkmann opened this issue Nov 28, 2024 · 0 comments
Labels
🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization.

Comments

@mariusbrinkmann
Copy link

Error Message and Logs

When upgrading from v4.0.0-beta.360 to v4.0.0-beta.373 on WSL2 Ubuntu, the install.sh script fails to detect the OpenSSH server using systemctl since systemctl is available in the WSL2 environment but not functional by default (System has not been booted with systemd as init system (PID 1). Can't operate.).

The installation script does not proceed to the fallback for service, causing the script to incorrectly conclude that the OpenSSH server is not installed. Executing service ssh status successfuly returns * sshd is running.

Relevant code snippet:

echo -e "2. Check OpenSSH server configuration. "

# Detect OpenSSH server
SSH_DETECTED=false
if [ -x "$(command -v systemctl)" ]; then
    if systemctl status sshd >/dev/null 2>&1; then
        echo " - OpenSSH server is installed."
        SSH_DETECTED=true
    elif systemctl status ssh >/dev/null 2>&1; then
        echo " - OpenSSH server is installed."
        SSH_DETECTED=true
    fi
elif [ -x "$(command -v service)" ]; then
    if service sshd status >/dev/null 2>&1; then
        echo " - OpenSSH server is installed."
        SSH_DETECTED=true
    elif service ssh status >/dev/null 2>&1; then
        echo " - OpenSSH server is installed."
        SSH_DETECTED=true
    fi
fi

Older versions just printed WARNING: Could not detect if OpenSSH server is installed and running - this does not mean that it is not installed, just that we could not detect it. without attempting to install OpenSSH server.

Replacing

if [ -x "$(command -v systemctl)" ]; then

with

if [ -x "$(command -v systemctl)" ] && systemctl list-units >/dev/null 2>&1; then

worked. However, I'm not sure if there are better ways of checking if systemctl can be used.

Steps to Reproduce

  1. In a WSL environment without systemctl support (the default behavior), execute
    curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash
    
    

Example Repository URL

No response

Coolify Version

v4.0.0-beta.373

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

Ubuntu 22.04.5 LTS

Additional Information

No response

@mariusbrinkmann mariusbrinkmann added 🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization. labels Nov 28, 2024
@mariusbrinkmann mariusbrinkmann changed the title [Bug]: [Bug]: Installation in WSL2 fails Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization.
Projects
None yet
Development

No branches or pull requests

1 participant