Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unable to star docker app #729

Closed
pippo73 opened this issue Mar 10, 2025 · 4 comments
Closed

Unable to star docker app #729

pippo73 opened this issue Mar 10, 2025 · 4 comments

Comments

@pippo73
Copy link

pippo73 commented Mar 10, 2025

Setup information

docker-compose

Describe the bug
Due to some error on the DB is not possible to start the application part

To reproduce
Steps to reproduce the behavior:

Just clone the https://github.com/invoiceninja/dockerfiles repo and then here are the steps I did.

$ docker compose stop
[+] Stopping 4/4
 ✔ Container debian-nginx-1  Stopped                                                                                                                     0.2s
 ✔ Container debian-app-1    Stopped                                                                                                                     0.0s
 ✔ Container debian-redis-1  Stopped                                                                                                                     0.1s
 ✔ Container debian-mysql-1  Stopped                                                                                                                     1.5s
~/Ninja/dockerfiles/debian$ docker system prune
WARNING! This will remove:
  - all stopped containers
  - all networks not used by at least one container
  - all dangling images
  - unused build cache

Are you sure you want to continue? [y/N] y
Deleted Containers:
e183dd59218f31164c8178c68421d153ba65f9518a959997b4fe66cde19d0873
840638d20e354369402e15435f92a21784f40e9afcdfee380b469fc187b43be3
9025f174d833d84b565e76a9fe69e9aab9af9bd8771254f29643998bff7f21fa
4ed602fd1db3dfaa9565a76842c62e34c2ebd0b58e763398fa16b74fb74d0b5c

Deleted Networks:
debian_app-network

Total reclaimed space: 0B
~/Ninja/dockerfiles/debian$ docker compose pull && docker compose up -d --force-recreate --remove-orphans
[+] Pulling 4/4
 ✔ nginx Pulled                                                                                                                                          1.1s
 ✔ mysql Pulled                                                                                                                                          1.1s
 ✔ redis Pulled                                                                                                                                          1.1s
 ✔ app Pulled                                                                                                                                            1.1s
[+] Running 5/5
 ✔ Network debian_app-network  Created                                                                                                                   0.0s
 ✔ Container debian-mysql-1    Healthy                                                                                                                  10.8s
 ✔ Container debian-redis-1    Healthy                                                                                                                  10.8s
 ✔ Container debian-app-1      Started                                                                                                                  10.9s
 ✔ Container debian-nginx-1    Started                                                                                                                  11.1s
~/Ninja/dockerfiles/debian$ docker logs debian-app-1 -f
Updating public folder...
Public Folder is up to date

   INFO  Caching framework bootstrap, configuration, and metadata.

  config ........................................................ 54.24ms DONE
  events ......................................................... 3.68ms DONE
  routes ....................................................... 121.69ms DONE
  views ........................................................ 269.38ms DONE


   INFO  Discovering packages.

  babenkoivan/elastic-client ............................................ DONE
  babenkoivan/elastic-scout-driver ...................................... DONE
  imdhemy/laravel-purchases ............................................. DONE
  intervention/image .................................................... DONE
  invoiceninja/inspector ................................................ DONE
  laravel/octane ........................................................ DONE
  laravel/scout ......................................................... DONE
  laravel/slack-notification-channel .................................... DONE
  laravel/socialite ..................................................... DONE
  laravel/tinker ........................................................ DONE
  laravel/ui ............................................................ DONE
  livewire/livewire ..................................................... DONE
  nesbot/carbon ......................................................... DONE
  nunomaduro/termwind ................................................... DONE
  nwidart/laravel-modules ............................................... DONE
  sentry/sentry-laravel ................................................. DONE
  socialiteproviders/manager ............................................ DONE
  turbo124/beacon ....................................................... DONE


   INFO  Running migrations.

  2025_02_12_035916_create_sync_column_for_payments .............. 7.11ms FAIL

In Connection.php line 825:

  SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'sync' (
  Connection: mysql, SQL: alter table `payments` add `sync` text null)


In Connection.php line 571:

  SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'sync'


Public Folder is up to date

   INFO  Caching framework bootstrap, configuration, and metadata.

  config ........................................................ 49.80ms DONE
  events ......................................................... 2.99ms DONE
  routes ....................................................... 125.88ms DONE
  views ........................................................ 271.44ms DONE


   INFO  Discovering packages.

  babenkoivan/elastic-client ............................................ DONE
  babenkoivan/elastic-scout-driver ...................................... DONE
  imdhemy/laravel-purchases ............................................. DONE
  intervention/image .................................................... DONE
  invoiceninja/inspector ................................................ DONE
  laravel/octane ........................................................ DONE
  laravel/scout ......................................................... DONE
  laravel/slack-notification-channel .................................... DONE
  laravel/socialite ..................................................... DONE
  laravel/tinker ........................................................ DONE
  laravel/ui ............................................................ DONE
  livewire/livewire ..................................................... DONE
  nesbot/carbon ......................................................... DONE
  nunomaduro/termwind ................................................... DONE
  nwidart/laravel-modules ............................................... DONE
  sentry/sentry-laravel ................................................. DONE
  socialiteproviders/manager ............................................ DONE
  turbo124/beacon ....................................................... DONE


   INFO  Running migrations.

  2025_02_12_035916_create_sync_column_for_payments .............. 1.96ms FAIL

In Connection.php line 825:

  SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'sync' (
  Connection: mysql, SQL: alter table `payments` add `sync` text null)


In Connection.php line 571:

  SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'sync'

Expected behavior
The application should start as expected

INFO  Running migrations.

  2025_02_12_035916_create_sync_column_for_payments .............. 1.96ms FAIL

In Connection.php line 825:

  SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'sync' (
  Connection: mysql, SQL: alter table `payments` add `sync` text null)


In Connection.php line 571:

  SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'sync'

Docker:

  • Output of docker version:
$ docker version
Client: Docker Engine - Community
 Version:           28.0.1
 API version:       1.48
 Go version:        go1.23.6
 Git commit:        068a01e
 Built:             Wed Feb 26 10:41:16 2025
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          28.0.1
  API version:      1.48 (minimum version 1.24)
  Go version:       go1.23.6
  Git commit:       bbd0a17
  Built:            Wed Feb 26 10:41:16 2025
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.25
  GitCommit:        bcc810d6b9066471b0b6fa75f557a15a1cbf31bb
 runc:
  Version:          1.2.4
  GitCommit:        v1.2.4-0-g6c52b3f
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

@turbo124
Copy link
Member

Have you changed / restored your database? it looks like a migration is trying to add a column that already exists in your database?

@pippo73
Copy link
Author

pippo73 commented Mar 11, 2025

There was one, but I was expecting that the following command
docker compose pull && docker compose up -d --force-recreate --remove-orphans

should remove any previous DB or other.

Am I wrong?

@turbo124
Copy link
Member

The error you are seeing is because there is still a database present.

@pippo73
Copy link
Author

pippo73 commented Mar 13, 2025

The error you are seeing is because there is still a database present.

I was expecting that the command should remove the previous DB.
Anyway I think it should be managed in a different way ... something like:
if the db does not exist, then create it
if the db is present, then update it or do something else (I don't know what is the db inpacted) but they should manage it somehow "better" ;-)

Just my 2 cents.

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

No branches or pull requests

2 participants