Closed McFateM closed 6 years ago
OK, looking at this differently and I think I see a way around this. I think I cut too deep when copying my existing codebase. I'm going to try my process again with a more shallow cut that hopefully will not interfere with the drush that is baked into the wodby/drupal-php:7.1-dev-3.3.1 image. I'll report back here if it works.
Well, that worked as intended...but not without additional problems. My existing codebase is in what I believe to be an improperly constructed Drupal 8 instance, so I copied just the ../web portion of that codebase into the local directory where docker-compose.yml lives, and now when I do a 'docker-compose up -d' I am able to follow it successfully with...
docker-compose exec --user 82 php drush --version
Drush Version : 8.1.15
However, my site will no longer open in my browser. Now I'm getting this...
( ! ) Fatal error: require(): Failed opening required '/var/www/html/web/../vendor/autoload.php' (include_path='.:/usr/local/lib/php') in /var/www/html/web/autoload.php on line 17
--
1 | 0.2062 | 421632 | {main}( ) | .../index.php:0
2 | 0.2087 | 422008 | require_once( '/var/www/html/web/autoload.php' ) | .../index.php:14
Unfortunately, I don't understand composer well enough to know what the correct structure of all this should be, or how to fix it.
For reference, a "tree -L 3" of my existing/original site reads like this...
.
├── composer.json
├── composer.lock
├── drush
│ ├── policy.drush.inc
│ └── README.md
├── LICENSE
├── phpunit.xml.dist
├── README.md
├── scripts
│ └── composer
│ └── ScriptHandler.php
├── vendor
│ ├── alchemy
│ │ └── zippy
│ ├── asm89
│ │ └── stack-cors
│ ├── autoload.php
│ ├── behat
│ │ ├── mink
│ │ ├── mink-browserkit-driver
│ │ └── mink-goutte-driver
│ ├── bin
│ │ ├── drupal -> ../drupal/console/bin/drupal
│ │ ├── drush -> ../drush/drush/drush
│ │ ├── drush.complete.sh -> ../drush/drush/drush.complete.sh
│ │ ├── drush.launcher -> ../drush/drush/drush.launcher
│ │ ├── drush.php -> ../drush/drush/drush.php
│ │ ├── php-parse -> ../nikic/php-parser/bin/php-parse
│ │ ├── phpunit -> ../phpunit/phpunit/phpunit
│ │ └── psysh -> ../psy/psysh/bin/psysh
│ ├── composer
│ │ ├── autoload_classmap.php
│ │ ├── autoload_files.php
│ │ ├── autoload_namespaces.php
│ │ ├── autoload_psr4.php
│ │ ├── autoload_real.php
│ │ ├── autoload_static.php
│ │ ├── ClassLoader.php
│ │ ├── installed.json
│ │ ├── installers
│ │ ├── LICENSE
│ │ └── semver
│ ├── consolidation
│ │ ├── annotated-command
│ │ └── output-formatters
│ ├── cweagans
│ │ └── composer-patches
│ ├── dflydev
│ │ ├── dot-access-configuration
│ │ ├── dot-access-data
│ │ └── placeholder-resolver
│ ├── dnoegel
│ │ └── php-xdg-base-dir
│ ├── doctrine
│ │ ├── annotations
│ │ ├── cache
│ │ ├── collections
│ │ ├── common
│ │ ├── inflector
│ │ ├── instantiator
│ │ └── lexer
│ ├── drupal
│ │ ├── console
│ │ ├── console-core
│ │ ├── console-dotenv
│ │ ├── console-en
│ │ └── console-extend-plugin
│ ├── drupal-composer
│ │ └── drupal-scaffold
│ ├── drush
│ │ └── drush
│ ├── easyrdf
│ │ └── easyrdf
│ ├── egulias
│ │ └── email-validator
│ ├── fabpot
│ │ └── goutte
│ ├── gabordemooij
│ │ └── redbean
│ ├── guzzlehttp
│ │ ├── guzzle
│ │ ├── promises
│ │ └── psr7
│ ├── html2text
│ │ └── html2text
│ ├── jakub-onderka
│ │ ├── php-console-color
│ │ └── php-console-highlighter
│ ├── jcalderonzumba
│ │ ├── gastonjs
│ │ └── mink-phantomjs-driver
│ ├── masterminds
│ │ └── html5
│ ├── mikey179
│ │ └── vfsStream
│ ├── nikic
│ │ └── php-parser
│ ├── paragonie
│ │ └── random_compat
│ ├── pear
│ │ └── console_table
│ ├── phpdocumentor
│ │ └── reflection-docblock
│ ├── phpspec
│ │ └── prophecy
│ ├── phpunit
│ │ ├── php-code-coverage
│ │ ├── php-file-iterator
│ │ ├── php-text-template
│ │ ├── php-timer
│ │ ├── php-token-stream
│ │ ├── phpunit
│ │ └── phpunit-mock-objects
│ ├── psr
│ │ ├── cache
│ │ ├── http-message
│ │ ├── log
│ │ └── simple-cache
│ ├── psy
│ │ └── psysh
│ ├── sebastian
│ │ ├── comparator
│ │ ├── diff
│ │ ├── environment
│ │ ├── exporter
│ │ ├── global-state
│ │ ├── recursion-context
│ │ └── version
│ ├── stack
│ │ └── builder
│ ├── stecman
│ │ └── symfony-console-completion
│ ├── swiftmailer
│ │ └── swiftmailer
│ ├── symfony
│ │ ├── browser-kit
│ │ ├── cache
│ │ ├── class-loader
│ │ ├── config
│ │ ├── console
│ │ ├── css-selector
│ │ ├── debug
│ │ ├── dependency-injection
│ │ ├── dom-crawler
│ │ ├── event-dispatcher
│ │ ├── expression-language
│ │ ├── filesystem
│ │ ├── finder
│ │ ├── http-foundation
│ │ ├── http-kernel
│ │ ├── polyfill-apcu
│ │ ├── polyfill-iconv
│ │ ├── polyfill-mbstring
│ │ ├── process
│ │ ├── psr-http-message-bridge
│ │ ├── routing
│ │ ├── serializer
│ │ ├── translation
│ │ ├── validator
│ │ ├── var-dumper
│ │ └── yaml
│ ├── symfony-cmf
│ │ └── routing
│ ├── twig
│ │ └── twig
│ ├── vlucas
│ │ └── phpdotenv
│ ├── webflo
│ │ └── drupal-finder
│ ├── webmozart
│ │ ├── assert
│ │ └── path-util
│ └── zendframework
│ ├── zend-diactoros
│ ├── zend-escaper
│ ├── zend-feed
│ └── zend-stdlib
└── web
├── autoload.php
├── composer.json
├── composer.lock
├── core
│ ├── assets
│ ├── authorize.php
│ ├── CHANGELOG.txt
│ ├── composer.json
│ ├── config
│ ├── COPYRIGHT.txt
│ ├── core.api.php
│ ├── core.libraries.yml
│ ├── core.link_relation_types.yml
│ ├── core.services.yml
│ ├── globals.api.php
│ ├── includes
│ ├── INSTALL.mysql.txt
│ ├── INSTALL.pgsql.txt
│ ├── install.php
│ ├── INSTALL.sqlite.txt
│ ├── INSTALL.txt
│ ├── lib
│ ├── LICENSE.txt
│ ├── MAINTAINERS.txt
│ ├── misc
│ ├── modules
│ ├── package.json
│ ├── phpcs.xml.dist
│ ├── phpunit.xml.dist
│ ├── profiles
│ ├── rebuild.php
│ ├── scripts
│ ├── tests
│ ├── themes
│ ├── UPDATE.txt
│ └── yarn.lock
├── example.gitignore
├── index.php
├── libraries
│ ├── ckeditor.autogrow
│ ├── ckeditor.fakeobjects
│ ├── ckeditor.image
│ ├── ckeditor.link
│ ├── codemirror
│ ├── jquery.geocomplete
│ ├── jquery.icheck
│ ├── jquery.image-picker
│ ├── jquery.inputmask
│ ├── jquery.intl-tel-input
│ ├── jquery.rateit
│ ├── jquery.select2
│ ├── jquery.timepicker
│ ├── jquery.toggles
│ ├── jquery.word-and-character-counter
│ ├── pdf.js
│ ├── progress-tracker
│ └── signature_pad
├── LICENSE.txt
├── modules
│ └── contrib
├── profiles
├── README.txt
├── robots.txt
├── rootstalk.sql
├── sites
│ ├── default
│ ├── development.services.yml
│ ├── example.settings.local.php
│ └── example.sites.php
├── themes
│ ├── bootstrap_rootstalk
│ ├── bootstrap_rootstalk.backup
│ └── contrib
├── update.php
├── vendor
│ ├── asm89
│ ├── autoload.php
│ ├── behat
│ ├── bin
│ ├── composer
│ ├── doctrine
│ ├── drupal
│ ├── easyrdf
│ ├── egulias
│ ├── fabpot
│ ├── guzzlehttp
│ ├── ircmaxell
│ ├── jcalderonzumba
│ ├── masterminds
│ ├── mikey179
│ ├── paragonie
│ ├── phpdocumentor
│ ├── phpspec
│ ├── phpunit
│ ├── psr
│ ├── sebastian
│ ├── squizlabs
│ ├── stack
│ ├── symfony
│ ├── symfony-cmf
│ ├── twig
│ ├── web.config
│ ├── webmozart
│ ├── wikimedia
│ └── zendframework
└── web.config
Note that /vendor and /vendor/autoload.php occur TWICE here, at ./vendor/autoload.php AND at ./web/vendor/autoload.php. The codebase I copied this time includes everything under ./web, but no longer includes ./vendor and its contents. Is this "correct"?
My apologies... This is clearly not a docker4drupal issue, and I'm sorry for the moving target here, but I thought I should post my progress in case it helps others, or prompts better suggestions.
So, I was able to remove ALL redundant composer packages from my "original" site (not my docker4drupal copy) such that there are no longer ANY ../web/vendor/* or ../web/composer.json files. The original site shows no signs of problems so that's a good thing, I believe.
Now that I'm creating my docker4drupal instance of this site from a "reasonable" original, all seems to be working properly (the site behaves properly and drush works too) with one exception...
When I shell into my php container and execute 'drush --version' and 'drush cr all' I get this...
/var/www/html/web/sites/default$ drush --version
A non-numeric value encountered preflight.inc:468 [warning]
D 8
r : .
u 1
s .
h 1
V 5
e
r
s
i
o
n
/var/www/html/web/sites/default$ drush cr all
A non-numeric value encountered preflight.inc:468 [warning]
Cache [ok]
rebuild
complete.
That's not a typo, the output is literally formatted just as you see it above. Anyone have a clue what the root of this problem is, and how I might fix it?
I'm looking into the non-numeric warning (appears to be something related to PHP 7.1?) and any other clues I can find now. Thanks.
I get exactly the same thing as @McFateM. Other commands output fine, but when I run drush I get this weird vertical text thing. It makes it virtually impossible to use.
As a workaround, put this in the environment section of your docker-compose:
COLUMNS: 80
Or run drush with the number of columns you want as an environmental variable.
COLUMNS=80 drush --version
Running stretch/sid unbuntu with docker version 17.12.0-ce, build c97c6d6
I also see this annoying formatting issue when running drush commands. Thank you @camerongreen for the workaround.
Adding the COLUMNS: 80 variable indeed solves the warning. Thanks.
Seems like we should add COLUMNS: 80
to docker-compose.yml
We have make shell
command that pass through $COLUMS
and $LINES
from host https://github.com/wodby/docker4drupal/issues/273#issuecomment-384952750
I'm unable to get drush working with a mounted codebase. I'm certain this is due to configuration differences between the 'php' image and my existing codebase, which was built by someone else, using composer, a long time ago. The original/existing drush is almost certainly not properly configured (although it appears to work).
The error that I see is similar to the following, whenever I run drush in this docker4drupal instance...
In my existing codebase, drush expects to find the preflight.inc include file in /var/www/html/drupal/vendor/drush/drush/includes.
Can anyone suggest how I might correct the drush configuration and codebase inside my existing site so that it will work with docker4drupal?
Codebase
mounted codebase
Host OS
macOS Sierra (10.12.6)
Docker info output
Docker compose file