DiouxX / docker-glpi

Project to deploy GLPI with docker
222 stars 185 forks source link

Deploy error on docker #60

Open julyusito opened 2 years ago

julyusito commented 2 years ago

Hi,

When I try to deploy the docker found this:

docker logs -f helpdesk_glpi_apps_1

basename: missing operand
Try 'basename --help' for more information.
TLS_REQCERT isn't present
wget: missing URL
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.
tar (child): /var/www/html/: Cannot read: Is a directory
tar (child): At beginning of tape, quitting now
tar (child): Error is not recoverable: exiting now

gzip: stdin: unexpected end of file
tar: Child returned status 2
tar: Error is not recoverable: exiting now
rm: cannot remove '/var/www/html/plugins': Device or resource busy
rm: cannot remove '/var/www/html/glpi': Device or resource busy
Starting periodic command scheduler: cron.
Enabling module rewrite.
To activate the new configuration, you need to run:
  service apache2 restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.XX.XX.9. Set the 'ServerName' directive globally to suppress this message
Restarting Apache httpd web server: apache2.
Stopping Apache httpd web server: apache2.
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.XX.XX.9. Set the 'ServerName' directive globally to suppress this message

Docker yaml:

version: "3.2"

services:

#MariaDB Container
  glpi_db:
    image: mariadb:10.7
    hostname: glpi_db
    env_file: /DockerVolumes/helpdesk/glpi-db.env
    labels:
      conteiner.description: "mariadb 10.7 DB"
    volumes:
      - /DockerVolumes/helpdesk/glpi-db/var/lib/mysql:/var/lib/mysql
      - /DockerVolumes/helpdesk/glpi-db/etc/mysql/mariadb.conf.d/51-mysqld.cnf:/etc/mysql/mariadb.conf.d/51-mysqld.cnf:ro
    restart: always
    networks:
      - containers_b_private 

#GLPI Container
  glpi_apps:
    image: diouxx/glpi
    hostname: glpi_apps
    env_file: /DockerVolumes/helpdesk/glpi-apps.env
    depends_on:
      - glpi_db
    ports:
      - 10105:80
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /DockerVolumes/helpdesk/glpi-apps/var/www/html/glpi:/var/www/html/glpi:rw
      - /DockerVolumes/helpdesk/glpi-apps/var/www/html/plugins:/var/www/html/plugins:rw
    restart: always
    networks:
      - containers_a_public 
      - containers_b_private

networks:
  containers_a_public :
    external: true
  containers_b_private :
    external: true

Environment files:

cat <<EOF > /DockerVolumes/helpdesk/glpi-db.env
MARIADB_ROOT_PASSWORD=ROOT_PASSSS
MARIADB_DATABASE=glpidb
MARIADB_USER=glpi_user
MARIADB_PASSWORD=XXXXXXXX
TZ=America/Bogota
EOF

cat <<EOF > /DockerVolumes/helpdesk/glpi-apps.env
GLPI_LANG=es_CO
MARIADB_HOST=glpi_db
MARIADB_PORT=3306
MARIADB_DATABASE=glpidb
MARIADB_USER=glpi_user
MARIADB_PASSWORD=XXXXXXXXX
VERSION_GLPI=10.0.0
PLUGINS="all"
TIMEZONE=America/Bogota
EOF

Please help

rafaelllourenco commented 2 years ago

Hello,

I am facing the same issue. Were you able to solve it or there is an issue with the image?

julyusito commented 2 years ago

Hello,

I don't know where is the issue. I think there is something with the start script.

DiouxX commented 2 years ago

Hello,

I tried to deploy GLPI with docker-compose and I don't have the error that you encounter.

docker-compose -f docker-compose-glpi.yml logs -f glpi
glpi  | TIMEZONE is unset
glpi  | TLS_REQCERT isn't present
glpi  | ls: cannot access '/var/www/html/glpi/': No such file or directory
glpi  | --2022-05-18 08:54:19--  https://github.com/glpi-project/glpi/releases/download/10.0.0/glpi-10.0.0.tgz
glpi  | Resolving github.com (github.com)... 140.82.121.4
glpi  | Connecting to github.com (github.com)|140.82.121.4|:443... connected.
glpi  | HTTP request sent, awaiting response... 302 Found
glpi  | Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/39182755/135e76df-13be-428b-b1d4-16e718d81365?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220518%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220518T085419Z&X-Amz-Expires=300&X-Amz-Signature=5d3afff1296ee8d42d93eff002bf80a5c2dba17511db52ec1f8d8de2c59134ee&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=39182755&response-content-disposition=attachment%3B%20filename%3Dglpi-10.0.0.tgz&response-content-type=application%2Foctet-stream [following]
glpi  | --2022-05-18 08:54:19--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/39182755/135e76df-13be-428b-b1d4-16e718d81365?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220518%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220518T085419Z&X-Amz-Expires=300&X-Amz-Signature=5d3afff1296ee8d42d93eff002bf80a5c2dba17511db52ec1f8d8de2c59134ee&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=39182755&response-content-disposition=attachment%3B%20filename%3Dglpi-10.0.0.tgz&response-content-type=application%2Foctet-stream
glpi  | Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.110.133, 185.199.111.133, 185.199.108.133, ...
glpi  | Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.110.133|:443... connected.
glpi  | HTTP request sent, awaiting response... 200 OK
glpi  | Length: 88789620 (85M) [application/octet-stream]
glpi  | Saving to: '/var/www/html/glpi-10.0.0.tgz'
glpi  |
glpi  |      0K .......... .......... .......... .......... ..........  0% 4.27M 20s
...
glpi  |  86650K .......... .......... .......... .......... .......... 99% 5.81M 0s
glpi  |  86700K ........                                              100% 16.6M=15s
glpi  |
glpi  | 2022-05-18 08:54:36 (5.55 MB/s) - '/var/www/html/glpi-10.0.0.tgz' saved [88789620/88789620]
glpi  |
glpi  | Starting periodic command scheduler: cron.
glpi  | Enabling module rewrite.
glpi  | To activate the new configuration, you need to run:
glpi  |   service apache2 restart
glpi  | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.3. Set the 'ServerName' directive globally to suppress this message
glpi  | Restarting Apache httpd web server: apache2.
glpi  | Stopping Apache httpd web server: apache2.
glpi  | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.3. Set the 'ServerName' directive globally to suppress this message

Can you try to pull the latest version and test it with the following docker-compose :

version: "3.8"

services:
#MariaDB Container
  mariadb:
    image: mariadb:10.7
    container_name: mariadb
    hostname: mariadb
    environment:
      - MARIADB_ROOT_PASSWORD=password
      - MARIADB_DATABASE=glpidb
      - MARIADB_USER=glpi_user
      - MARIADB_PASSWORD=glpi

#GLPI Container
  glpi:
    image: diouxx/glpi
    container_name : glpi
    hostname: glpi
    ports:
      - "80:80"

To determine if the error is in your docker-compose or in your infrastructure

julyusito commented 2 years ago

Hi,

Same error here:

TIMEZONE is unset
basename: missing operand
Try 'basename --help' for more information.
TLS_REQCERT isn't present
ls: cannot access '/var/www/html/glpi/': No such file or directory
wget: missing URL
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.
tar (child): /var/www/html/: Cannot read: Is a directory
tar (child): At beginning of tape, quitting now
tar (child): Error is not recoverable: exiting now

gzip: stdin: unexpected end of file
tar: Child returned status 2
tar: Error is not recoverable: exiting now
chown: cannot access '/var/www/html/glpi/': No such file or directory
Starting periodic command scheduler: cron.
Enabling module rewrite.
To activate the new configuration, you need to run:
  service apache2 restart
AH00112: Warning: DocumentRoot [/var/www/html/glpi] does not exist
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.XX.XX.3. Set the 'ServerName' directive globally to suppress this message
Restarting Apache httpd web server: apache2.
Stopping Apache httpd web server: apache2.
AH00112: Warning: DocumentRoot [/var/www/html/glpi] does not exist
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.XX.XX.3. Set the 'ServerName' directive globally to suppress this message
julyusito commented 2 years ago

Hi,

I've tested connection from container to glpi files:

root@glpi:/# wget https://github.com/glpi-project/glpi/releases/download/10.0.0/glpi-10.0.0.tgz 
--2022-05-18 21:03:12--  https://github.com/glpi-project/glpi/releases/download/10.0.0/glpi-10.0.0.tgz
Resolving github.com (github.com)... 140.82.112.4
Connecting to github.com (github.com)|140.82.112.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/39182755/135e76df-13be-428b-b1d4-16e718d81365?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220518%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220518T210245Z&X-Amz-Expires=300&X-Amz-Signature=0e39f8c79a5ceccd80330776428b45dc6c25e1f78e26c637cbce1c9161b81025&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=39182755&response-content-disposition=attachment%3B%20filename%3Dglpi-10.0.0.tgz&response-content-type=application%2Foctet-stream [following]
--2022-05-18 21:03:12--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/39182755/135e76df-13be-428b-b1d4-16e718d81365?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220518%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220518T210245Z&X-Amz-Expires=300&X-Amz-Signature=0e39f8c79a5ceccd80330776428b45dc6c25e1f78e26c637cbce1c9161b81025&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=39182755&response-content-disposition=attachment%3B%20filename%3Dglpi-10.0.0.tgz&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.108.133, 185.199.110.133, 185.199.109.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 88789620 (85M) [application/octet-stream]
Saving to: 'glpi-10.0.0.tgz'

glpi-10.0.0.tgz                                           100%[==================================================================================================================================>]  84.68M  36.3MB/s    in 2.3s    

2022-05-18 21:03:15 (36.3 MB/s) - 'glpi-10.0.0.tgz' saved [88789620/88789620]
DiouxX commented 2 years ago

It's strange. Your deploy with docker-compose don't have the URL to download GLPI.

basename: missing operand
wget: missing URL

And I have not this issue and behavior with the example docker-compose provided.

Can you test from container the execution of the script glpi-start.sh script : https://github.com/DiouxX/docker-glpi/blob/master/glpi-start.sh

and provide the output ?

Marioheld commented 2 years ago

Got the same Problem. It looks like this error happens if the docker container can not reach the GLPI download URL. In my case my firewall blocked the URL. After adding a exception to my firewall, it worked for me.