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

Magento container is exiting on magento install script #64133

Closed
robertiulianstoica opened this issue Mar 26, 2024 · 3 comments
Closed

Magento container is exiting on magento install script #64133

robertiulianstoica opened this issue Mar 26, 2024 · 3 comments
Assignees
Labels
magento solved tech-issues The user has a technical issue about an application triage Triage is needed

Comments

@robertiulianstoica
Copy link

robertiulianstoica commented Mar 26, 2024

Name and Version

bitnami/magento:2

What architecture are you using?

arm64

What steps will reproduce the bug?

When running docker compose up -d for the following docker-compose.yml

version: '2'
services:
  mariadb:
    image: docker.io/bitnami/mariadb:latest
    container_name: magento-mariadb
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
      - MARIADB_USER=bn_magento
      - MARIADB_DATABASE=bitnami_magento
    volumes:
      - './temp/docker/mariadb:/bitnami/mariadb'
  magento:
    image: docker.io/bitnami/magento:2
    container_name: magento-app
    ports:
      - '80:8080'
      - '443:8443'
    environment:
      - MAGENTO_HOST=localhost
      - MAGENTO_DATABASE_HOST=mariadb
      - MAGENTO_DATABASE_PORT_NUMBER=3306
      - MAGENTO_DATABASE_USER=bn_magento
      - MAGENTO_DATABASE_NAME=bitnami_magento
      - ELASTICSEARCH_HOST=elasticsearch
      - ELASTICSEARCH_PORT_NUMBER=9200
      - MAGENTO_MODE=developer
      - ALLOW_EMPTY_PASSWORD=yes
    volumes:
      - './temp/docker/magento:/bitnami/magento'
    depends_on:
      - mariadb
      - elasticsearch
  elasticsearch:
    image: docker.io/bitnami/elasticsearch:7
    container_name: magento-elasticsearch
    volumes:
      - './temp/docker/elasticsearch:/bitnami/elasticsearch/data'

The container stops when it reaches "Running magento install script"

2024-03-26 01:19:32 magento 23:19:32.65 INFO  ==> 
2024-03-26 01:19:32 magento 23:19:32.65 INFO  ==> Welcome to the Bitnami magento container
2024-03-26 01:19:32 magento 23:19:32.65 INFO  ==> Subscribe to project updates by watching https://github.com/bitnami/containers
2024-03-26 01:19:32 magento 23:19:32.65 INFO  ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
2024-03-26 01:19:32 magento 23:19:32.65 INFO  ==> 
2024-03-26 01:19:32 magento 23:19:32.65 INFO  ==> ** Starting Magento setup **
2024-03-26 01:19:32 magento 23:19:32.67 INFO  ==> Generating sample certificates
2024-03-26 01:19:33 Certificate request self-signature ok
2024-03-26 01:19:33 subject=CN = example.com
2024-03-26 01:19:33 realpath: /bitnami/apache/conf: No such file or directory
2024-03-26 01:19:33 magento 23:19:33.45 INFO  ==> Configuring Apache ServerTokens directive
2024-03-26 01:19:33 magento 23:19:33.47 INFO  ==> Configuring PHP options
2024-03-26 01:19:33 magento 23:19:33.47 INFO  ==> Setting PHP expose_php option
2024-03-26 01:19:33 magento 23:19:33.48 INFO  ==> Setting PHP output_buffering option
2024-03-26 01:19:33 magento 23:19:33.49 INFO  ==> Validating settings in MYSQL_CLIENT_* env vars
2024-03-26 01:19:33 magento 23:19:33.50 WARN  ==> You set the environment variable ALLOW_EMPTY_PASSWORD=yes. For safety reasons, do not use this flag in a production environment.
2024-03-26 01:19:33 magento 23:19:33.53 INFO  ==> Ensuring Magento directories exist
2024-03-26 01:19:33 magento 23:19:33.53 INFO  ==> Configuring permissions
2024-03-26 01:19:33 magento 23:19:33.54 INFO  ==> Trying to connect to the database server
2024-03-26 01:19:33 magento 23:19:33.55 INFO  ==> Trying to connect to Elasticsearch
2024-03-26 01:19:33 magento 23:19:33.55 INFO  ==> Running Magento install script

I am using Makefile to get this working:

setup:
	mkdir -p ./temp/docker/elasticsearch
	mkdir -p ./temp/docker/magento
	mkdir -p ./temp/docker/mariadb
	chmod -R 777 ./temp/docker/magento

start-env: setup
	docker-compose up -d

stop-env:
	docker-compose down

restart-env: stop-env start-env

What is the expected behavior?

I should be able to run Magento and test my plugin development/

Additional information

I am running docker on a MacBook Pro M1

@robertiulianstoica robertiulianstoica added the tech-issues The user has a technical issue about an application label Mar 26, 2024
@github-actions github-actions bot added the triage Triage is needed label Mar 26, 2024
@carrodher
Copy link
Member

Bitnami containers are designed to operate as non-root by default. Consequently, any files or directories used by the application should be owned by the root group, as the random user (1001 by default) is a member of this root group. To ensure proper permissions, you'll need to adjust the ownership of your local directory accordingly.

For more comprehensive information about non-root containers and their significance for security, you can explore the following resources:

These references provide valuable insights into the best practices and considerations when working with non-root containers in Bitnami applications.

@gongomgra
Copy link
Contributor

gongomgra commented Apr 3, 2024

Hi @robertiulianstoica,

Thanks for using Bitnami. I was able to get more information on the error you are facing trying to start Magento using your provided docker-compose.yml file by adding the BITNAMI_DEBUG=true environment variable to the magento.environment section. This is the error message I got

magento-app            | Schema creation/updates:
magento-app            |
magento-app            | In SqlVersionProvider.php line 103:
magento-app            |
magento-app            |   Current version of RDBMS is not supported. Used Version: 11.3.2-MariaDB. Su
magento-app            |   pported versions: MySQL-8, MySQL-5.7, MariaDB-(10.2-10.6)

As you can see, Magento is claiming that the MariaDB version you are using is not valid. This is because our docker.io/bitnami/mariadb:latest tag points to MariaDB 11.x branch. You can easily fix it by using the docker.io/bitnami/mariadb:10.6 tag instead. Notice you will also need to remove the previous MariaDB data in your host volume (./temp/docker/mariadb), because it is not compatible with MariaDB 10.6 branch. After that, Magento should be able to start properly.

Hope it helps!

@robertiulianstoica
Copy link
Author

Thank you very much @gongomgra , that's what fixed it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
magento solved tech-issues The user has a technical issue about an application triage Triage is needed
Projects
None yet
Development

No branches or pull requests

3 participants