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

Unable to execute core:cron from crontab #187

Open
MatteoBorgognoni opened this issue Jun 12, 2020 · 9 comments · Fixed by docksal/docksal#1365
Open

Unable to execute core:cron from crontab #187

MatteoBorgognoni opened this issue Jun 12, 2020 · 9 comments · Fixed by docksal/docksal#1365
Assignees

Comments

@MatteoBorgognoni
Copy link

MatteoBorgognoni commented Jun 12, 2020

Hi I am trying to setup a crontab for executing the core:cron drush command.
I have trying to follow instructions at https://blog.docksal.io/running-scheduled-events-with-docksal-43fc69d7b29b without luck.

I have create a new crontab file under .docksal/services/cli
This is the content of the crontab:

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/docker/.composer/vendor/bin
* * * * * drush --debug --root=/var/www/docroot core:cron -v > /tmp/drupal-cron.log 2>&1

(You can see I had to add to define the path variable as php wasn't even found.. It would have been good to find this mentioned in the instructions?)

This is the logged output:

Drush Launcher Version: 0.6.0
ROOT: /var/www/docroot
Drush Launcher Version: 0.6.0
ROOT: /var/www/docroot
DRUSH VERSION: 9
DRUPAL ROOT: /var/www/docroot
COMPOSER ROOT: /var/www
VENDOR ROOT: /var/www/vendor
 [preflight] Config paths: /var/www/vendor/drush/drush/drush.yml,/var/www/drush/drush.yml
 [preflight] Alias paths: /var/www/docroot/drush/sites,/var/www/drush/sites
 [preflight] Commandfile search paths: /var/www/vendor/drush/drush/src,/var/www/docroot/drush,/var/www/drush
 [debug] Bootstrap further to find core:cron [0.05 sec, 8.45 MB]
 [debug] Trying to bootstrap as far as we can [0.05 sec, 8.45 MB]
 [bootstrap] Drush bootstrap phase: bootstrapDrupalRoot() [0.05 sec, 8.45 MB]
 [bootstrap] Change working directory to /var/www/docroot [0.05 sec, 8.45 MB]
 [bootstrap] Initialized Drupal 8.8.5 root directory at /var/www/docroot [0.05 sec, 8.58 MB]
 [bootstrap] Drush bootstrap phase: bootstrapDrupalSite() [0.06 sec, 8.94 MB]
 [bootstrap] Initialized Drupal site wwf.docksal at sites/default [0.06 sec, 9.11 MB]
 [bootstrap] Drush bootstrap phase: bootstrapDrupalConfiguration() [0.06 sec, 9.11 MB]
 [debug] Add service modifier [0.06 sec, 9.32 MB]
 [bootstrap] Unable to connect to database. More information may be available by running `drush status`. This may occur when Drush is trying to bootstrap a site that has not been installed or does not have a configured database. In this case you can select another site with a working database setup by specifying the URI to use with the --uri parameter on the command line. See `drush topic docs-aliases` for details. [0.06 sec, 9.33 MB]
 [debug] Bootstrap phase bootstrapDrupalDatabase() failed to validate; continuing at bootstrapDrupalConfiguration() [0.06 sec, 9.32 MB]
 [debug] Done with bootstrap max in Application::find(): trying to find core:cron again. [0.06 sec, 9.32 MB]

In Application.php line 239:
                                                                               
  [Symfony\Component\Console\Exception\CommandNotFoundException]               
  Command core:cron was not found. Drush was unable to query the database. As  
   a result, many commands are unavailable. Re-run your command with --debug   
  to see relevant log messages.                                                
                                                                               

Exception trace:
  at /var/www/vendor/drush/drush/src/Application.php:239
 Drush\Application->bootstrapAndFind() at /var/www/vendor/drush/drush/src/Application.php:192
 Drush\Application->find() at /var/www/vendor/symfony/console/Application.php:236
 Symfony\Component\Console\Application->doRun() at /var/www/vendor/symfony/console/Application.php:148
 Symfony\Component\Console\Application->run() at /var/www/vendor/drush/drush/src/Runtime/Runtime.php:118
 Drush\Runtime\Runtime->doRun() at /var/www/vendor/drush/drush/src/Runtime/Runtime.php:49
 Drush\Runtime\Runtime->run() at /var/www/vendor/drush/drush/drush.php:72
 require() at /var/www/vendor/drush/drush/includes/preflight.inc:18
 drush_main() at phar:///usr/local/bin/drush/bin/drush.php:141
 require() at /usr/local/bin/drush:10

What am I missing???

This is my project config and variables:

version: "2.1"

services:
  cli:
    environment:
      # Make mysql environment variables from docksal.env available to the cli container.
      - MYSQL_DATABASE
      - MYSQL_PASSWORD
      - MYSQL_USER
      - DOCKSAL_ENVIRONMENT

  db:
    volumes:
      - ${PROJECT_ROOT}/db:/docker-entrypoint-initdb.d:ro
CLI_IMAGE='docksal/cli:2.10-php7.3'
DOCKSAL_STACK=default
DOCROOT=docroot
@sean-e-dietrich
Copy link
Member

@MatteoBorgognoni

This will certainly be documented. The fix for this would be to load the bash profile before you run the command. That can be done doing the following:

* * * * * bash -l -c 'drush --debug --root=/var/www/docroot core:cron -v > /tmp/drupal-cron.log 2>&1'

That way you don't even need to set the PATH.

@MatteoBorgognoni
Copy link
Author

MatteoBorgognoni commented Jun 15, 2020

Still getting the same error.

docker@cli:/var/www$ crontab -l
* * * * * bash -l -c 'drush --debug --root=/var/www/docroot core:cron -v > /tmp/drupal-cron.log 2>&1'
Drush Launcher Version: 0.6.0
ROOT: /var/www/docroot
Drush Launcher Version: 0.6.0
ROOT: /var/www/docroot
DRUSH VERSION: 9
DRUPAL ROOT: /var/www/docroot
COMPOSER ROOT: /var/www
VENDOR ROOT: /var/www/vendor
 [preflight] Config paths: /var/www/vendor/drush/drush/drush.yml,/var/www/drush/drush.yml
 [preflight] Alias paths: /var/www/docroot/drush/sites,/var/www/drush/sites
 [preflight] Commandfile search paths: /var/www/vendor/drush/drush/src,/var/www/docroot/drush,/var/www/drush
 [debug] Bootstrap further to find core:cron [0.05 sec, 8.45 MB]
 [debug] Trying to bootstrap as far as we can [0.05 sec, 8.45 MB]
 [bootstrap] Drush bootstrap phase: bootstrapDrupalRoot() [0.05 sec, 8.46 MB]
 [bootstrap] Change working directory to /var/www/docroot [0.05 sec, 8.46 MB]
 [bootstrap] Initialized Drupal 8.8.5 root directory at /var/www/docroot [0.06 sec, 8.59 MB]
 [bootstrap] Drush bootstrap phase: bootstrapDrupalSite() [0.06 sec, 8.95 MB]
 [bootstrap] Initialized Drupal site default at sites/default [0.06 sec, 9.12 MB]
 [bootstrap] Drush bootstrap phase: bootstrapDrupalConfiguration() [0.06 sec, 9.12 MB]
 [debug] Add service modifier [0.06 sec, 9.32 MB]
 [bootstrap] Unable to connect to database. More information may be available by running `drush status`. This may occur when Drush is trying to bootstrap a site that has not been installed or does not have a configured database. In this case you can select another site with a working database setup by specifying the URI to use with the --uri parameter on the command line. See `drush topic docs-aliases` for details. [0.06 sec, 9.34 MB]
 [debug] Bootstrap phase bootstrapDrupalDatabase() failed to validate; continuing at bootstrapDrupalConfiguration() [0.06 sec, 9.33 MB]
 [debug] Done with bootstrap max in Application::find(): trying to find core:cron again. [0.06 sec, 9.33 MB]

In Application.php line 239:
                                                                               
  [Symfony\Component\Console\Exception\CommandNotFoundException]               
  Command core:cron was not found. Drush was unable to query the database. As  
   a result, many commands are unavailable. Re-run your command with --debug   
  to see relevant log messages.                                                
                                                                               

Exception trace:
  at /var/www/vendor/drush/drush/src/Application.php:239
 Drush\Application->bootstrapAndFind() at /var/www/vendor/drush/drush/src/Application.php:192
 Drush\Application->find() at /var/www/vendor/symfony/console/Application.php:236
 Symfony\Component\Console\Application->doRun() at /var/www/vendor/symfony/console/Application.php:148
 Symfony\Component\Console\Application->run() at /var/www/vendor/drush/drush/src/Runtime/Runtime.php:118
 Drush\Runtime\Runtime->doRun() at /var/www/vendor/drush/drush/src/Runtime/Runtime.php:49
 Drush\Runtime\Runtime->run() at /var/www/vendor/drush/drush/drush.php:72
 require() at /var/www/vendor/drush/drush/includes/preflight.inc:18
 drush_main() at phar:///usr/local/bin/drush/bin/drush.php:141
 require() at /usr/local/bin/drush:10

@lmakarov
Copy link
Member

Thanks for reporting. We added more details to the cron docs. See https://github.com/docksal/docksal/pull/1365/files

@lmakarov
Copy link
Member

@MatteoBorgognoni I've just tested this with https://github.com/docksal/boilerplate-drupal8-composer and it works as expected

docker@cli:/var/www$ crontab -l
* * * * * bash -l -c 'drush --debug --root=/var/www/web core:cron -v > /tmp/drupal-cron.log 2>&1'
docker@cli:/var/www$ cat /tmp/drupal-cron.log 
Drush Launcher Version: 0.6.0
ROOT: /var/www/web
DRUSH VERSION: 9
DRUPAL ROOT: /var/www/web
COMPOSER ROOT: /var/www
VENDOR ROOT: /var/www/vendor
 [preflight] Config paths: /var/www/vendor/drush/drush/drush.yml,/var/www/drush/drush.yml
 [preflight] Alias paths: /var/www/web/drush/sites,/var/www/drush/sites
 [preflight] Commandfile search paths: /var/www/vendor/drush/drush/src,/var/www/drush
 [debug] Bootstrap further to find core:cron [0.2 sec, 8.69 MB]
 [debug] Trying to bootstrap as far as we can [0.2 sec, 8.69 MB]
 [bootstrap] Drush bootstrap phase: bootstrapDrupalRoot() [0.2 sec, 8.69 MB]
 [bootstrap] Change working directory to /var/www/web [0.2 sec, 8.69 MB]
 [bootstrap] Initialized Drupal 8.8.6 root directory at /var/www/web [0.2 sec, 8.82 MB]
 [bootstrap] Drush bootstrap phase: bootstrapDrupalSite() [0.21 sec, 9.12 MB]
 [bootstrap] Initialized Drupal site default at sites/default [0.21 sec, 9.35 MB]
 [bootstrap] Drush bootstrap phase: bootstrapDrupalConfiguration() [0.21 sec, 9.35 MB]
 [debug] Add service modifier [0.22 sec, 9.56 MB]
 [bootstrap] Drush bootstrap phase: bootstrapDrupalDatabase() [0.23 sec, 10.01 MB]
 [bootstrap] Successfully connected to the Drupal database. [0.23 sec, 10.01 MB]
 [bootstrap] Drush bootstrap phase: bootstrapDrupalFull() [0.23 sec, 10.01 MB]
 [debug] Start bootstrap of the Drupal Kernel. [0.23 sec, 10.01 MB]
 [debug] Finished bootstrap of the Drupal Kernel. [0.32 sec, 15.61 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\config\ConfigCommands [0.49 sec, 21.57 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\config\ConfigExportCommands [0.49 sec, 21.61 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\config\ConfigImportCommands [0.5 sec, 21.61 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\BatchCommands [0.5 sec, 21.62 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\CliCommands [0.5 sec, 21.62 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\DrupalCommands [0.5 sec, 21.63 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\EntityCommands [0.5 sec, 21.64 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\ImageCommands [0.5 sec, 21.64 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\JsonapiCommands [0.5 sec, 21.65 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\LanguageCommands [0.5 sec, 21.66 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\LocaleCommands [0.5 sec, 21.67 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\MessengerCommands [0.5 sec, 21.68 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\QueueCommands [0.5 sec, 21.68 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\RoleCommands [0.5 sec, 21.7 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\StateCommands [0.51 sec, 21.72 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\TwigCommands [0.51 sec, 21.73 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\UserCommands [0.51 sec, 21.75 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\ViewsCommands [0.51 sec, 21.79 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\WatchdogCommands [0.51 sec, 21.82 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\pm\PmCommands [0.51 sec, 21.84 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\pm\ThemeCommands [0.51 sec, 21.85 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeCommands [0.52 sec, 21.86 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeCommentsCommands [0.52 sec, 21.86 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeSessionsCommands [0.52 sec, 21.86 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeUserFieldsCommands [0.52 sec, 21.87 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeUserTableCommands [0.52 sec, 21.87 MB]
 [debugnotify] Add a commandfile class: Drupal\token\Commands\TokenCommands [0.52 sec, 21.87 MB]
 [debugnotify] Add a commandfile class: Drupal\devel_generate\Commands\DevelGenerateCommands [0.52 sec, 21.87 MB]
 [debugnotify] Add a commandfile class: Drupal\pathauto\Commands\PathautoCommands [0.52 sec, 21.89 MB]
 [debug] Done with bootstrap max in Application::find(): trying to find core:cron again. [0.52 sec, 21.91 MB]
 [bootstrap] Starting bootstrap to none [0.53 sec, 21.93 MB]
 [bootstrap] Drush bootstrap phase 0 [0.53 sec, 21.93 MB]
 [bootstrap] Try to validate bootstrap phase 0 [0.53 sec, 21.93 MB]
 [notice] Starting execution of comment_cron(). [0.49 sec, 22.58 MB]
 [notice] Starting execution of dblog_cron(), execution of comment_cron() took 12.66ms. [0.49 sec, 22.91 MB]
 [notice] Starting execution of field_cron(), execution of dblog_cron() took 0.62ms. [0.49 sec, 22.91 MB]
 [notice] Starting execution of file_cron(), execution of field_cron() took 1.63ms. [0.49 sec, 22.93 MB]
 [notice] Starting execution of history_cron(), execution of file_cron() took 45.95ms. [0.49 sec, 24.84 MB]
 [notice] Starting execution of node_cron(), execution of history_cron() took 0.96ms. [0.49 sec, 24.86 MB]
 [notice] Starting execution of search_cron(), execution of node_cron() took 12.85ms. [0.49 sec, 25.46 MB]
 [notice] Starting execution of system_cron(), execution of search_cron() took 17.44ms. [0.49 sec, 25.94 MB]
 [notice] Execution of system_cron() took 19.43ms. [0.49 sec, 26.01 MB]
 [notice] Cron run completed. [0.49 sec, 26.01 MB]
docker@cli:/var/www$ 

@lmakarov
Copy link
Member

If you still have issues with drush in cron, double check that drush can read the site settings correctly and is able to connect to the database (it looks like it cannot in your case).

docker@cli:/var/www$ crontab -l
* * * * * bash -l -c 'drush --root=/var/www/web core:status &>>/tmp/drupal-cron.log'
* * * * * bash -l -c 'drush --root=/var/www/web sql:connect &>>/tmp/drupal-cron.log'
docker@cli:/var/www$ tail -f /tmp/drupal-cron.log 
mysql --user=user --password=user --database=default --host=db --port=3306 -A
 Drupal version   : 8.8.6                                 
 Site URI         : http://default                        
 DB driver        : mysql                                 
 DB hostname      : db                                    
 DB port          : 3306                                  
 DB username      : user                                  
 DB name          : default                               
 Database         : Connected                             
 Drupal bootstrap : Successful                            
 Default theme    : bartik                                
 Admin theme      : seven                                 
 PHP binary       : /usr/local/bin/php                    
 PHP config       :                                       
 PHP OS           : Linux                                 
 Drush script     : /usr/local/bin/drush                  
 Drush version    : 9.7.2                                 
 Drush temp       : /tmp                                  
 Drush configs    : /var/www/vendor/drush/drush/drush.yml 
                    /var/www/drush/drush.yml              
 Install profile  : standard                              
 Drupal root      : /var/www/web                          
 Site path        : sites/default                         
 Files, Public    : sites/default/files                   
 Files, Temp      : /tmp                                  

@MatteoBorgognoni
Copy link
Author

MatteoBorgognoni commented Jun 16, 2020

No drush can't read the database settings running cron but the docker user definitely can.

I think here the reason is that your project is set with hardcoded db credentials whereas mine is using getenv() and I need to.

Those variables are not available in cron. It would be handy to have declared environment variables added to the profile.

* * * * * bash -lc 'env > /tmp/cronbashenv.log'
docker@cli:/var/www$ cat /tmp/cronbashenv.log 
SHELL=/bin/sh
PYENV_SHELL=bash
rvm_prefix=/home/docker
MY_RUBY_HOME=/home/docker/.rvm/rubies/ruby-2.6.5
RUBY_VERSION=ruby-2.6.5
PWD=/home/docker
LOGNAME=docker
DRUSH_LAUNCHER_FALLBACK=/usr/local/bin/drush8
rvm_version=1.29.9 (1.29.9)
HOME=/home/docker
NVM_DIR=/home/docker/.nvm
rvm_bin_path=/home/docker/.rvm/bin
GEM_PATH=/home/docker/.rvm/gems/ruby-2.6.5:/home/docker/.rvm/gems/ruby-2.6.5@global
GEM_HOME=/home/docker/.rvm/gems/ruby-2.6.5
VISIBLE=now
SHLVL=1
NVM_CD_FLAGS=
PYENV_ROOT=/home/docker/.pyenv
BUNDLE_PATH=.bundle
PATH=/home/docker/.pyenv/shims:/home/docker/.pyenv/bin:/home/docker/.rvm/gems/ruby-2.6.5/bin:/home/docker/.rvm/gems/ruby-2.6.5@global/bin:/home/docker/.rvm/rubies/ruby-2.6.5/bin:/home/docker/.yarn/bin:/home/docker/.config/yarn/global/node_modules/.bin:/home/docker/.nvm/versions/node/v12.13.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/docker/.composer/vendor/bin:/home/docker/.rvm/bin
NVM_BIN=/home/docker/.nvm/versions/node/v12.13.0/bin
IRBRC=/home/docker/.rvm/rubies/ruby-2.6.5/.irbrc
rvm_path=/home/docker/.rvm
_=/usr/bin/env
services:
  cli:
    environment:
      # Make mysql environment variables from docksal.env available to the cli container.
      - MYSQL_DATABASE
      - MYSQL_PASSWORD
      - MYSQL_USER
      - DOCKSAL_ENVIRONMENT

@lmakarov
Copy link
Member

Please post the output from fin sysinfo and fin config (run inside the project directory)

@lmakarov lmakarov reopened this Jun 16, 2020
@MatteoBorgognoni
Copy link
Author

MatteoBorgognoni commented Jun 16, 2020

SYSINFO

███  OS
Linux Ubuntu 20.04
Linux ares-desktop 5.4.0-37-generic #41-Ubuntu SMP Wed Jun 3 18:57:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

███  ENVIRONMENT
MODE : Linux Kernel
DOCKER_HOST : 

███  FIN
fin version: 1.95.0

███  DOCKER COMPOSE
EXPECTED VERSION: 1.24.1
docker-compose version 1.24.1, build 4667896b
docker-py version: 3.7.3
CPython version: 3.6.8
OpenSSL version: OpenSSL 1.1.0j  20 Nov 2018

███  DOCKER
EXPECTED VERSION: 19.03.4

Client: Docker Engine - Community
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        afacb8b7f0
 Built:             Wed Mar 11 01:25:55 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       afacb8b7f0
  Built:            Wed Mar 11 01:24:26 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

███  DOCKSAL: PROJECTS
project             STATUS                        virtual host                              project root
support                 Up About a minute (healthy)   support.docksal,*.support.docksal,support.docksal.*   /home/ares/clones/support

███  DOCKSAL: VIRTUAL HOSTS
*.support.docksal
adminer.support.docksal
webmail.support.docksal
support.docksal.*
support.docksal

███  DOCKSAL: DNS
Successfully requested http://dns-test.docksal

███  DOCKER: RUNNING CONTAINERS
CONTAINER ID        IMAGE                     COMMAND                  CREATED              STATUS                        PORTS                                                    NAMES
8fc335d56d58        docksal/ssh-agent:1.3     "docker-entrypoint.s…"   About a minute ago   Up About a minute (healthy)                                                            docksal-ssh-agent
2e9c2a4ccec9        docksal/dns:1.1           "docker-entrypoint.s…"   About a minute ago   Up About a minute (healthy)   192.168.64.100:53->53/udp                                docksal-dns
0e43d0a1052c        docksal/vhost-proxy:1.5   "docker-entrypoint.s…"   About a minute ago   Up About a minute (healthy)   192.168.64.100:80->80/tcp, 192.168.64.100:443->443/tcp   docksal-vhost-proxy
e0c476e78520        docksal/apache:2.4-2.3    "httpd-foreground"       3 days ago           Up About a minute (healthy)   80/tcp, 443/tcp                                          support_web_1
4b5ea26f5eba        docksal/cli:2.10-php7.3   "/opt/startup.sh sup…"   3 days ago           Up About a minute (healthy)   22/tcp, 3000/tcp, 9000/tcp                               support_cli_1
cacdc3bdb25c        adminer                   "entrypoint.sh docke…"   6 days ago           Up About a minute             8080/tcp                                                 support_adminer_1
873fe7406a86        mailhog/mailhog           "MailHog"                6 days ago           Up About a minute             80/tcp, 1025/tcp, 8025/tcp                               support_mail_1
b4001a76dbb6        docksal/mysql:5.6-1.4     "docker-entrypoint.s…"   6 days ago           Up About a minute (healthy)   0.0.0.0:32771->3306/tcp                                  support_db_1

███  DOCKER: NETWORKS
NETWORK ID          NAME                DRIVER              SCOPE
25ab67d64358        _default            bridge              local
292a632d0dfd        bridge              bridge              local
49d1d20e115f        host                host                local
6eb901fb585d        none                null                local
3972476c5144        support_default     bridge              local

███  VIRTUALBOX
EXPECTED VERSION: 5.2.34
6.1.6_Ubuntur137129

███  HDD Usage
Filesystem      Size  Used Avail Use% Mounted on
udev             16G     0   16G   0% /dev
tmpfs           3.2G  4.6M  3.2G   1% /run
/dev/sdb2       220G  198G   11G  95% /
tmpfs            16G  927M   15G   6% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs            16G     0   16G   0% /sys/fs/cgroup
/dev/loop1       29M   29M     0 100% /snap/chromium-ffmpeg/15
/dev/loop3       55M   55M     0 100% /snap/core18/1705
/dev/loop4       22M   22M     0 100% /snap/chromium-ffmpeg/13
/dev/loop6       98M   98M     0 100% /snap/core/9289
/dev/loop5      141M  141M     0 100% /snap/gnome-3-26-1604/100
/dev/loop7       94M   94M     0 100% /snap/core/9066
/dev/loop8       55M   55M     0 100% /snap/core18/1754
/dev/loop9      256M  256M     0 100% /snap/gnome-3-34-1804/33
/dev/loop11     256M  256M     0 100% /snap/gnome-3-34-1804/36
/dev/loop10     141M  141M     0 100% /snap/gnome-3-26-1604/98
/dev/loop12     162M  162M     0 100% /snap/gnome-3-28-1804/128
/dev/loop15     256K  256K     0 100% /snap/gtk2-common-themes/5
/dev/loop14      55M   55M     0 100% /snap/gtk-common-themes/1502
/dev/loop13     2.3M  2.3M     0 100% /snap/gnome-system-monitor/148
/dev/sdb1       511M   33M  479M   7% /boot/efi
/dev/loop16     256K  256K     0 100% /snap/gtk2-common-themes/9
/dev/loop17     142M  142M     0 100% /snap/inkscape/7627
/dev/loop19      12M   12M     0 100% /snap/ngrok/26
/dev/loop18     142M  142M     0 100% /snap/inkscape/7601
/dev/loop20     143M  143M     0 100% /snap/opera/76
/dev/loop22      50M   50M     0 100% /snap/snap-store/454
/dev/loop21     161M  161M     0 100% /snap/gnome-3-28-1804/116
/dev/loop23     2.3M  2.3M     0 100% /snap/gnome-system-monitor/145
/dev/loop24     143M  143M     0 100% /snap/opera/77
/dev/loop25      63M   63M     0 100% /snap/gtk-common-themes/1506
/dev/loop26      50M   50M     0 100% /snap/snap-store/433
/dev/loop27     144M  144M     0 100% /snap/firefox/372
tmpfs           3.2G  4.0K  3.2G   1% /run/user/127
tmpfs           3.2G   20K  3.2G   1% /run/user/129
tmpfs           3.2G   60K  3.2G   1% /run/user/1000
/dev/loop28     140M  140M     0 100% /snap/slack/24
/dev/loop29     157M  157M     0 100% /snap/chromium/1192
/dev/loop2      157M  157M     0 100% /snap/chromium/1193

CONFIG

---------------------
COMPOSE_PROJECT_NAME_SAFE: support
COMPOSE_FILE:
/home/ares/.docksal/stacks/volumes-bind.yml
/home/ares/.docksal/stacks/stack-default.yml
/home/ares/clones/support/.docksal/docksal.yml
ENV_FILE:
/home/ares/clones/support/.docksal/docksal.env
/home/ares/clones/support/.docksal/docksal-local.env

PROJECT_ROOT: /home/ares/clones/support
DOCROOT: docroot
VIRTUAL_HOST: support.docksal
VIRTUAL_HOST_ALIASES: *.support.docksal
IP: 192.168.64.100
MYSQL: 192.168.64.100:32771

Docker Compose configuration
---------------------
services:
  adminer:
    environment:
      ADMINER_DEFAULT_SERVER: db
      ADMINER_DESIGN: price
      ADMINER_PLUGINS: tables-filter tinymce
    hostname: adminer
    image: adminer
    labels:
      io.docksal.virtual-host: adminer.support.docksal
  cli:
    dns:
    - 192.168.64.100
    - 8.8.8.8
    environment:
      BLACKFIRE_CLIENT_ID: null
      BLACKFIRE_CLIENT_TOKEN: null
      COMPOSER_ALLOW_XDEBUG: '1'
      COMPOSER_DISABLE_XDEBUG_WARN: '1'
      DOCKSAL: "yes"
      DOCKSAL_ENVIRONMENT: local
      DOCROOT: docroot
      DRUSH_ALLOW_XDEBUG: '1'
      DRUSH_OPTIONS_URI: support.docksal
      GIT_USER_EMAIL: mail@matteoborgognoni.com
      GIT_USER_NAME: Matteo Borgognoni
      HOST_GID: '1000'
      HOST_UID: '1000'
      MYSQL_DATABASE: ms_db
      MYSQL_HOST: db
      MYSQL_PASSWORD: ms_pass
      MYSQL_ROOT_PASSWORD: root
      MYSQL_USER: ms_user
      PHP_IDE_CONFIG: null
      SECRET_ACAPI_EMAIL: null
      SECRET_ACAPI_KEY: null
      SECRET_PLATFORMSH_CLI_TOKEN: null
      SECRET_SSH_PRIVATE_KEY: null
      SECRET_TERMINUS_TOKEN: null
      SSH_AUTH_SOCK: /.ssh-agent/proxy-socket
      VIRTUAL_HOST: support.docksal
      XDEBUG_CONFIG: remote_connect_back=0 remote_host=192.168.64.1
      XDEBUG_ENABLED: '1'
    hostname: cli
    image: docksal/cli:2.10-php7.3
    labels:
      io.docksal.shell: bash
      io.docksal.user: docker
    volumes:
    - docksal_ssh_agent:/.ssh-agent:ro
    - cli_home:/home/docker:rw
    - project_root:/var/www:rw,nocopy,cached
  db:
    dns:
    - 192.168.64.100
    - 8.8.8.8
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: null
      MYSQL_DATABASE: ms_db
      MYSQL_INITDB_SKIP_TZINFO: null
      MYSQL_ONETIME_PASSWORD: null
      MYSQL_PASSWORD: ms_pass
      MYSQL_RANDOM_ROOT_PASSWORD: null
      MYSQL_ROOT_PASSWORD: root
      MYSQL_USER: ms_user
    hostname: db
    image: docksal/mysql:5.6-1.4
    ports:
    - 3306/tcp
    volumes:
    - /home/ares/clones/support/db:/docker-entrypoint-initdb.d:ro
    - db_data:/var/lib/mysql:rw
    - project_root:/var/www:ro,nocopy,cached
  mail:
    environment:
      MH_API_BIND_ADDR: 0.0.0.0:80
      MH_UI_BIND_ADDR: 0.0.0.0:80
    expose:
    - '80'
    hostname: mail
    image: mailhog/mailhog
    labels:
      io.docksal.virtual-host: webmail.support.docksal
    user: root
  web:
    depends_on:
      cli:
        condition: service_started
    dns:
    - 192.168.64.100
    - 8.8.8.8
    environment:
      APACHE_BASIC_AUTH_PASS: null
      APACHE_BASIC_AUTH_USER: null
      APACHE_DOCUMENTROOT: /var/www/docroot
      APACHE_FCGI_HOST_PORT: cli:9000
    hostname: web
    image: docksal/apache:2.4-2.3
    labels:
      io.docksal.cert-name: none
      io.docksal.permanent: "false"
      io.docksal.project-root: /home/ares/clones/support
      io.docksal.virtual-host: support.docksal,*.support.docksal,support.docksal.*
    volumes:
    - project_root:/var/www:ro,nocopy,cached
version: '2.1'
volumes:
  cli_home: {}
  db_data: {}
  docksal_ssh_agent:
    external: true
    name: docksal_ssh_agent
  project_root:
    driver: local
    driver_opts:
      device: /home/ares/clones/support
      o: bind
      type: none

---------------------

@lmakarov
Copy link
Member

ok, this one looks to be a little tricky.
I've created a feature request to implement passing of docker environment variables to cron jobs: #188

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.

3 participants