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

I cannot create new app with mariadb service #701

Closed
lukasinko opened this issue Jun 26, 2024 · 8 comments · Fixed by laravel/sail-server#23
Closed

I cannot create new app with mariadb service #701

lukasinko opened this issue Jun 26, 2024 · 8 comments · Fixed by laravel/sail-server#23

Comments

@lukasinko
Copy link

Sail Version

1.0.0

Laravel Version

10.4.1

PHP Version

8.1.4

Operating System

macOS

OS Version

8.1.4

Description

I cannot create new app with mariadb service.

Probably due to recent change to mariadb10/mariadb11 ?

Steps To Reproduce

Using curl -s "https://laravel.build/example-app?with=mariadb" | bash

I get ERROR Invalid services [mariadb]..

@Jubeki
Copy link
Contributor

Jubeki commented Jun 26, 2024

It should be possible with

curl -s "https://laravel.build/example-app?with=mariadb11" | bash

or

curl -s "https://laravel.build/example-app?with=mariadb10" | bash

Is this documented somewhere? (If yes, we should probably add an alias)

@lukasinko
Copy link
Author

curl -s "https://laravel.build/test-app?with=mariadb11" | bash                                                                                                                                                                  
bash: line 1: syntax error near unexpected token `('
bash: line 1: `Invalid service name. Please provide one or more of the supported services (mysql, pgsql, mariadb, redis, memcached, meilisearch, typesense, minio, mailpit, selenium, soketi) or "none".'

@Jubeki
Copy link
Contributor

Jubeki commented Jun 26, 2024

@lukasinko I created a PR on the Sail Server Side, which should fix the problem: laravel/sail-server#23

@lukasinko
Copy link
Author

@Jubeki I don't think it is solved, now there is and error
using:
curl -s "https://laravel.build/jobs-app?with=mariadb" | bash

error in middle of lines:

➜ ./vendor/bin/sail artisan migrate

no such service: mariadb11
[+] Building 172.4s (17/17) FINISHED

no such service: mariadb11 ?

@Jubeki
Copy link
Contributor

Jubeki commented Jul 12, 2024

@lukasinko I can't explain this no such service: mariadb11 but it seems to be installing the mariadb service correctly in the docker-compose.yml.

@ikhusus
Copy link

ikhusus commented Jul 18, 2024

@lukasinko I can't explain this no such service: mariadb11 but it seems to be installing the mariadb service correctly in the docker-compose.yml.

Hello @Jubeki , please check the generated script. I think this part need to be fixed:

$ curl -s -o "example-app.sh" "https://laravel.build/example-app?with=mariadb"
$ cat example-app.sh
# ... skipped ...
docker run --rm \
    --pull=always \
    -v "$(pwd)":/opt \
    -w /opt \
    laravelsail/php83-composer:latest \
    bash -c "laravel new example-app --no-interaction && cd example-app && php ./artisan sail:install --with=mariadb11 "

cd example-app

# Allow build with no additional services..
if [ "mariadb11" == "none" ]; then
    ./vendor/bin/sail build
else
    ./vendor/bin/sail pull mariadb11  # <=== THIS PART NEED TO BE FIXED ?
    ./vendor/bin/sail build
fi

Pay attention to the line:

./vendor/bin/sail pull mariadb11

I think it should be:

./vendor/bin/sail pull mariadb

Because the generated docker-compose.yml is:

$ cat example-app/docker-compose.yml
services:
    laravel.test:
        build:
#... skipped ...
        depends_on:
            - mariadb
    mariadb:  # <===== THIS IS THE CORRESPONDING SERVICE NAME :) NOT 'mariadb11'
        image: 'mariadb:11'
#... skipped ...

Please note the syntax for docker compose pull is (I am using Podman. But it should be the same in Docker) :

$ example-app/vendor/bin/sail pull --help
#...skipped...
usage: podman-compose pull [-h] [--force-local] [services ...]

positional arguments:
  services       services to pull

options:
  -h, --help     show this help message and exit
  --force-local  Also pull unprefixed images for services which have a build section

$ podman-compose pull --help
usage: podman-compose pull [-h] [--force-local] [services ...]

positional arguments:
  services       services to pull

options:
  -h, --help     show this help message and exit
  --force-local  Also pull unprefixed images for services which have a build section

So, it needs Service Name (NOT Repo Name) corresponding to the docker-compose.yml.

@lukasinko, please reopen this issue :).
@taylorotwell, I think this one is crucial :).

Thank You.

@Jubeki
Copy link
Contributor

Jubeki commented Jul 18, 2024

At this point I am not sure, if all the complex replacements due to the different mariadb versions is worth it, or if it should be reverted to only a single mariadb version (like with mysql 8 where there is no mysql 5.7).

@driesvints what is your take on this? Should I send in a PR fixing the Sail-Server-Script or reverting the mariadb changes and only allow a single MariaDB version (probably in this case the newest one 11).

@driesvints
Copy link
Member

yes let's go for mariadb 11 only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants