crazy-max / docker-flarum

Flarum Docker image
MIT License
197 stars 32 forks source link

docker-compose exec flarum extension ... produces error #74

Closed hecksadecimal closed 1 year ago

hecksadecimal commented 1 year ago

Behaviour

Steps to reproduce this issue

  1. Install and Run according to examples/compose/docker-compose.yml
  2. Attempt to install extension using command docker-compose exec flarum extension require askvortsov/flarum-categories

Expected behaviour

The specified extension should be installed and persist within the attached volume.

Actual behaviour

This command results in a PHP error, and no installation performed.

Configuration

Docker info

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.10.2
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.16.0
    Path:     /usr/libexec/docker/cli-plugins/docker-compose
  scan: Docker Scan (Docker Inc.)
    Version:  v0.23.0
    Path:     /usr/libexec/docker/cli-plugins/docker-scan

Server:
 Containers: 25
  Running: 23
  Paused: 0
  Stopped: 2
 Images: 40
 Server Version: 23.0.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 2456e983eb9e37e47538f59ea18f2043c9a73640
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.15.0-67-generic
 Operating System: Ubuntu 22.04.2 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 6
 Total Memory: 9.72GiB
 Name: coolify
 ID: 8272eff5-8768-484e-bcbf-76d6061ea203
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: true
 Default Address Pools:
   Base: 172.17.0.0/12, Size: 20
   Base: 192.168.0.0/16, Size: 24

Logs

PHP Fatal error:  Uncaught TypeError: strpos(): Argument #1 ($haystack) must be of type string, int given in phar:///usr/bin/composer/src/Composer/Factory.php:678
Stack trace:
#0 phar:///usr/bin/composer/src/Composer/Factory.php(678): strpos()
#1 phar:///usr/bin/composer/src/Composer/Factory.php(75): Composer\Factory::useXdg()
#2 phar:///usr/bin/composer/src/Composer/Factory.php(171): Composer\Factory::getHomeDir()
#3 phar:///usr/bin/composer/src/Composer/Factory.php(328): Composer\Factory::createConfig()
#4 phar:///usr/bin/composer/src/Composer/Factory.php(623): Composer\Factory->createComposer()
#5 phar:///usr/bin/composer/src/Composer/Console/Application.php(495): Composer\Factory::create()
#6 phar:///usr/bin/composer/src/Composer/Console/Application.php(440): Composer\Console\Application->getComposer()
#7 phar:///usr/bin/composer/src/Composer/Console/Application.php(395): Composer\Console\Application->hintCommonErrors()
#8 phar:///usr/bin/composer/vendor/symfony/console/Application.php(171): Composer\Console\Application->doRun()
#9 phar:///usr/bin/composer/src/Composer/Console/Application.php(141): Symfony\Component\Console\Application->run()
#10 phar:///usr/bin/composer/bin/composer(88): Composer\Console\Application->run()
#11 /usr/bin/composer(29): require('...')
#12 {main}
  thrown in phar:///usr/bin/composer/src/Composer/Factory.php on line 678
hecksadecimal commented 1 year ago

I've run some tests, and this doesn't seem to happen when using PHP 8.2.

hecksadecimal commented 1 year ago

After further debugging, I've discovered that this was a misconfiguration problem on my own end. This is not actually an issue with docker-flarum.