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

Temp directory not writable to PHP and composer with default stack UPDATE Same with MariaDB 10.6-1.3 image and Mariadb container stops due to it #1746

Open
ITedInnovator opened this issue Dec 21, 2022 · 1 comment

Comments

@ITedInnovator
Copy link

Description

Problem/feature description...
Composer and PHP do not have permission to access the /tmp directory. Only root can change the permissions. Therefore a workaround of creating a new directory in the docker home directory is the only way for composer to function.

Steps to reproduce the issue:

  1. Fedora 36 Docksal with default stack.
  2. Try to run fin composer init or composer init after fin bash
  3. Note error message about the sys_temp_directory. This is set in php.ini correctly but the error still displays because /tmp does not have write permissions for other users which are not root.

Describe the results you received:

PHP temp directory (/tmp) does not exist or is not writable to Composer. Set sys_temp_dir in your php.ini

Describe the results you expected:

Composer command runs without this error.

Output of fin config:

fin config output
---------------------
COMPOSE_PROJECT_NAME_SAFE: aws-transcription-app
COMPOSE_FILE:
/home/anthony/.docksal/stacks/volumes-bind.yml
/home/anthony/.docksal/stacks/stack-default.yml
/home/anthony/projects/aws-transcription-app/.docksal/docksal.yml
ENV_FILE:
/home/anthony/projects/aws-transcription-app/.docksal/docksal.env

PROJECT_ROOT: /home/anthony/projects/aws-transcription-app
DOCROOT: docroot
VIRTUAL_HOST: aws-transcription-app.docksal.site
VIRTUAL_HOST_ALIASES: *.aws-transcription-app.docksal.site
IP: 192.168.64.100

MySQL endpoint:
Public URL:

Docker Compose configuration
---------------------
services:
  cli:
    dns:
    - 8.8.8.8
    - 9.9.9.9
    environment:
      BLACKFIRE_CLIENT_ID: null
      BLACKFIRE_CLIENT_TOKEN: null
      COMPOSER_ALLOW_XDEBUG: "0"
      COMPOSER_DEFAULT_VERSION: null
      COMPOSER_DISABLE_XDEBUG_WARN: "0"
      DOCROOT: docroot
      DRUSH_ALLOW_XDEBUG: "0"
      DRUSH_OPTIONS_URI: aws-transcription-app.docksal.site
      GIT_USER_EMAIL: ag.church21@gmail.com
      GIT_USER_NAME: Anthony Church
      HOST_GID: "1000"
      HOST_UID: "1000"
      MYSQL_DATABASE: default
      MYSQL_HOST: db
      MYSQL_PASSWORD: user
      MYSQL_ROOT_PASSWORD: root
      MYSQL_USER: user
      PHP_IDE_CONFIG: null
      SECRET_ACQUIA_CLI_KEY: null
      SECRET_ACQUIA_CLI_SECRET: null
      SECRET_PLATFORMSH_CLI_TOKEN: null
      SECRET_SSH_PRIVATE_KEY: null
      SECRET_TERMINUS_TOKEN: null
      SSH_AUTH_SOCK: /.ssh-agent/proxy-socket
      VIRTUAL_HOST: aws-transcription-app.docksal.site
      XDEBUG_CONFIG: client_host=192.168.64.1 remote_host=192.168.64.1
      XDEBUG_ENABLED: "0"
    extends:
      file: /home/anthony/.docksal/stacks/services.yml
      service: cli
    hostname: cli
    healthcheck:
      interval: 10s
    image: docksal/cli:php8.1-3.2
    labels:
      io.docksal.shell: bash
      io.docksal.user: docker
    logging:
      options:
        max-file: "10"
        max-size: 1m
    networks:
      default: null
    volumes:
    - type: volume
      source: docksal_ssh_agent
      target: /.ssh-agent
      read_only: true
      volume: {}
    - type: volume
      source: cli_home
      target: /home/docker
      volume: {}
    - type: bind
      source: /tmp/.docksal/aws-transcription-app
      target: /tmp/.docksal/aws-transcription-app
      read_only: true
      bind:
        create_host_path: true
    - type: volume
      source: project_root
      target: /var/www
      volume:
        nocopy: true
  db:
    dns:
    - 8.8.8.8
    - 9.9.9.9
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: null
      MYSQL_DATABASE: default
      MYSQL_INITDB_SKIP_TZINFO: null
      MYSQL_ONETIME_PASSWORD: null
      MYSQL_PASSWORD: user
      MYSQL_RANDOM_ROOT_PASSWORD: null
      MYSQL_ROOT_PASSWORD: root
      MYSQL_USER: user
    extends:
      file: /home/anthony/.docksal/stacks/services.yml
      service: mariadb
    hostname: db
    healthcheck:
      interval: 10s
    image: docksal/mariadb:10.6-1.3
    logging:
      options:
        max-file: "10"
        max-size: 1m
    networks:
      default: null
    ports:
    - mode: ingress
      target: 3306
      protocol: tcp
    volumes:
    - type: volume
      source: db_data
      target: /var/lib/mysql
      volume: {}
    - type: volume
      source: project_root
      target: /var/www
      read_only: true
      volume:
        nocopy: true
  web:
    depends_on:
      cli:
        condition: service_started
    dns:
    - 8.8.8.8
    - 9.9.9.9
    environment:
      APACHE_BASIC_AUTH_PASS: null
      APACHE_BASIC_AUTH_USER: null
      APACHE_DOCUMENTROOT: /var/www/docroot
      APACHE_FCGI_HOST_PORT: cli:9000
    extends:
      file: /home/anthony/.docksal/stacks/services.yml
      service: apache
    hostname: web
    healthcheck:
      interval: 10s
    image: docksal/apache:2.4-2.5
    labels:
      io.docksal.cert-name: none
      io.docksal.permanent: "false"
      io.docksal.project-root: /home/anthony/projects/aws-transcription-app
      io.docksal.virtual-host: aws-transcription-app.docksal.site,*.aws-transcription-app.docksal.site,aws-transcription-app.docksal.site.*
    logging:
      options:
        max-file: "10"
        max-size: 1m
    networks:
      default: null
    volumes:
    - type: volume
      source: project_root
      target: /var/www
      read_only: true
      volume:
        nocopy: true
networks:
  default:
    name: aws-transcription-app_default
volumes:
  cli_home:
    name: aws-transcription-app_cli_home
  db_data:
    name: aws-transcription-app_db_data
  docksal_ssh_agent:
    name: docksal_ssh_agent
    external: true
  project_root:
    name: aws-transcription-app_project_root
    driver: local
    driver_opts:
      device: /home/anthony/projects/aws-transcription-app
      o: bind
      type: none
---------------------


Output of fin sysinfo:

fin sysinfo output
 DOCKSAL
Docksal version: v1.17.0
fin version:     1.110.1

███  OS
Linux Fedora Linux 36
Linux fedora 6.0.12-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 8 17:15:53 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

███  ENVIRONMENT
MODE : Linux Kernel
DOCKER_HOST : 

███  DOCKER
Expected client version: 20.10.12
Expected server version: 20.10.12

Installed versions:

Client: Docker Engine - Community
Cloud integration: v1.0.25
Version:           20.10.21
API version:       1.41
Go version:        go1.18.7
Git commit:        baeda1f
Built:             Tue Oct 25 18:02:58 2022
OS/Arch:           linux/amd64
Context:           default
Experimental:      true

Server: Docker Engine - Community
Engine:
Version:          20.10.21
API version:      1.41 (minimum version 1.12)
Go version:       go1.18.7
Git commit:       3056208
Built:            Tue Oct 25 18:00:34 2022
OS/Arch:          linux/amd64
Experimental:     false
containerd:
Version:          1.6.12
GitCommit:        a05d175400b1145e5e6a735a6710579d181e7fb0
runc:
Version:          1.1.4
GitCommit:        v1.1.4-0-g5fd4c4d
docker-init:
Version:          0.19.0
GitCommit:        de40ad0

███  DOCKER COMPOSE
Expected version:  2.1.0
Installed version: v2.1.0

███  DOCKSAL: PROJECTS
project                 STATUS                    virtual host                                                                                                   project root
aws-transcription-app   Up 59 minutes (healthy)   aws-transcription-app.docksal.site,*.aws-transcription-app.docksal.site,aws-transcription-app.docksal.site.*   /home/anthony/projects/aws-transcription-app

███  DOCKSAL: VIRTUAL HOSTS
*.aws-transcription-app.docksal.site
aws-transcription-app.docksal.site.*
aws-transcription-app.docksal.site

███  DOCKSAL: NETWORKING

DOCKSAL_IP: 192.168.64.100
DOCKSAL_HOST_IP: 192.168.64.1
DOCKSAL_VHOST_PROXY_IP: 
DOCKSAL_DNS_IP: 
DOCKSAL_DNS_DISABLED: 1
DOCKSAL_NO_DNS_RESOLVER: 1
DOCKSAL_DNS_UPSTREAM: 
DOCKSAL_DNS_DOMAIN: docksal.site

███  DOCKSAL: CONNECTIVITY

Host to 192.168.64.100: 	PASS
Container to 192.168.64.100: 	PASS
Container to 192.168.64.1: 	PASS

Checking connectivity to http://dns-test.docksal.site...
Host: PASS
Containers: PASS

███  DOCKER: RUNNING CONTAINERS
CONTAINER ID   IMAGE                     COMMAND                  CREATED       STATUS                       PORTS                                                    NAMES
e4353347a4f2   docksal/apache:2.4-2.5    "httpd-foreground"       6 hours ago   Up About an hour (healthy)   80/tcp, 443/tcp                                          aws-transcription-app_web_1
a21c0e4363a1   docksal/cli:php8.1-3.2    "/opt/startup.sh sup…"   6 hours ago   Up About an hour (healthy)   22/tcp, 3000/tcp, 9000/tcp                               aws-transcription-app_cli_1
30ee25eb441f   docksal/ssh-agent:1.4     "docker-entrypoint.s…"   8 hours ago   Up 8 hours (healthy)                                                                  docksal-ssh-agent
7ac0d67dedc8   docksal/vhost-proxy:1.8   "docker-entrypoint.s…"   8 hours ago   Up 8 hours (healthy)         192.168.64.100:80->80/tcp, 192.168.64.100:443->443/tcp   docksal-vhost-proxy

███  DOCKER: NETWORKS
NETWORK ID     NAME                            DRIVER    SCOPE
007eeab0ac31   _default                        bridge    local
03efae052b15   aws-transcription-app_default   bridge    local
e8597b2e507b   bridge                          bridge    local
e0e2b33be355   host                            host      local
3af1d068a086   none                            null      local

███  VIRTUALBOX
EXPECTED VERSION: 6.1.22
7.0.4_rpmfusionr154605

███  HDD Usage
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        4.0M     0  4.0M   0% /dev
tmpfs           7.7G  6.9M  7.7G   1% /dev/shm
tmpfs           3.1G  2.5M  3.1G   1% /run
/dev/sdb5        74G   66G  4.1G  95% /
tmpfs           7.7G   20K  7.7G   1% /tmp
/dev/sdb2        96M   43M   54M  45% /boot/efi
/dev/sda3       432G  295G  116G  72% /home
tmpfs           1.6G  110M  1.5G   7% /run/user/1000
/dev/sdb6        46G   12G   32G  27% /dockerimages

@ITedInnovator ITedInnovator changed the title Temp directory not writable to PHP and composer with default stack Temp directory not writable to PHP and composer with default stack UPDATE Same with MariaDB 10.6-1.3 image and Mariadb container stops due to it Jan 4, 2023
@ITedInnovator
Copy link
Author

This is the same for MariaDB but there is no way to fix it in the image here. Fresh stack with WordPress boilerplate:
ERROR 2005 (HY000): Unknown MySQL server host 'db' (-2)

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

No branches or pull requests

1 participant