Giter VIP home page Giter VIP logo

docker-development-box's People

Contributors

billydg avatar carlocarels90 avatar dependabot[bot] avatar hnsr avatar maikel-koek avatar paales avatar pascalbrouwers avatar semantic-release-bot avatar wimvdputten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

docker-development-box's Issues

Mysql server won't start

ERROR: for mysql  Cannot create container for service mysql: failed to copy file info for /var/lib/docker/volumes/12go_mysql-mount/_data: failed to chown /var/lib/docker/volumes/12go_mysql-mount/_data: lchown /var/lib/docker/volumes/12go_mysql-mount/_data: operation not permitted

When removing the var/.mysqldata (because the database has become corrupt) and removing the mysql volume (docker volume ls && docker volume rm <mysql_volume>) the mysql instance can't be started because of the above error.

Workaround

docker-compose down
rm -rf var/.mysqldata
docker volume ls
docker volume rm <mysql_volume from list>
mkdir var/.mysqldata
touch var/.mysqldata/something
docker-compose up -d
rm var/.mysqldata/something
docker-compose up -d

Note: don't stop docker containers before removing the something file.

`ERR_HTTP2_PROTOCOL_ERROR` on some Magento pages

On some admin configuration pages I get a ERR_HTTP2_PROTOCOL_ERROR. Sometimes this can be solved by clearing the cookies and doing it again, but sometimes that doesn't work.

My current workaround is to disable web/cookie/cookie_httponly in the Magento configuration. This seems to solve the issue for now.

Keep using Magento 2.3 on 3.0.0 branch

go to your mysql container using ctop (exec shell) and run:

mysql -uroot -pmagento

ALTER USER magento IDENTIFIED WITH 'mysql_native_password' BY 'magento';
SET PERSIST log_bin_trust_function_creators=1;
GRANT ALL ON *.* TO 'magento'@'%';

Change in docker-compose.yml:

FPM_PORT: 9074
FPM_XDEBUG: 9174

to:

FPM_PORT: 9072
FPM_XDEBUG: 9172

Switch php back to php 7.2 for cli

brew unlink [email protected]
brew link [email protected] --force

restart docker:
docker-compose down && docker-compose up -d

Also map to xdebug backend if XDEBUG_SESSION is passed via query parameters

Currently we automatically map to the xdebug backend based on the XDEBUG_SESSION cookie being set, but not via the query parameter that xdebug also supports as activation trigger (https://xdebug.org/docs/step_debug#manual-init)

Supporting query parameter activation would make debugging things like GraphQL calls (or any API calls) a lot easier

Currently we map based on $cookie_* in our nginx config: https://github.com/ho-nl/docker-development-box/blob/master/nginx/conf.d/default.conf#L2-L5

Changing this to $query is trivial, but we need to combine the two somehow to support both activation mechanisms

PHP 7.2 installation fails and services fail to start when running install.sh script

Known issue with a workaround (see README.md), but still needs a proper fix; on initial install, PHP 7.2 is broken and php-fpm dervices fail to start.

Root cause of the problem is that the php binary is linked with tidy-html5, but this library is not present during install (maybe we can just install tidy-html5 manually ahead of installing PHP 7.2?), resulting in:

dyld: Library not loaded: /usr/local/opt/tidy-html5/lib/libtidy.5.dylib
  Referenced from: /usr/local/Cellar/[email protected]/7.2.34_4/bin/php
  Reason: image not found

The workaround is to run brew reinstall tidy-html5 afterwards

E-mail not being diverted to MailHog

MailHog geconfigureerd zoals in de README.md, maar lijkt niet te werken (ook niet na activeren mageplaza/module-smtp).

Gaat in mijn geval om de 2FA activation e-mail, misschien dat dat een uitzondering is en wordt die anders verstuurd en komt de rest wel in MailHog, in welk geval dit issue wel dicht kan aangezien 2FA toch uit kan voor development.

Zal dit zelf even verifiëren als ik tijd heb.

Update docker-compose.yml email module/config

fruitcake/magento2-email-advanced-config has proven to be less hassle than the other options for using Mailhog for local e-mail testing

-  # composer require fruitcake/magento2-email-advanced-config
-  # php bin/magento module:enable Fruitcake_EmailAdvancedConfig
+  # composer require magepal/magento2-gmailsmtpapp
   # php bin/magento setup:upgrade
   # bin/magento config:set --lock-env system/smtp/disable 0
-  # bin/magento config:set --lock-env fruitcake_email_advanced/smtp/transport smtp
-  # bin/magento config:set --lock-env fruitcake_email_advanced/smtp/auth none
-  # bin/magento config:set --lock-env fruitcake_email_advanced/smtp/ssl none
-  # bin/magento config:set --lock-env fruitcake_email_advanced/smtp/host localhost
-  # bin/magento config:set --lock-env fruitcake_email_advanced/smtp/port 1025
+  # bin/magento config:set --lock-env system/gmailsmtpapp/active 1
+  # bin/magento config:set --lock-env system/gmailsmtpapp/auth NONE
+  # bin/magento config:set --lock-env system/gmailsmtpapp/ssl none
+  # bin/magento config:set --lock-env system/gmailsmtpapp/smtphost localhost
+  # bin/magento config:set --lock-env system/gmailsmtpapp/smtpport 1025

Creating local mounts throws error when multiple projects are using the same folder structure

Project 1:
Sightful/src
Project 2:
Foreyes/src

All of the project files are located in the src folder which causes the local mounts to be prefixed with "src_" . This means that multiple projects will have to use the same src_mysql-mount and src_nginx_mount. You will have to manually remove the mounts from project 1 to start project 2.

When running docker-compose up

Creating volume "src_nginx-mount" with local driver ERROR: Configuration for volume mysql-mount specifies "device" driver_opt :/Users/billydegraaf/Sites/foreyes/src/var/.mysqldata, but a volume with the same name uses a different "device" driver_opt (:/Users/billydegraaf/Sites/Sightful/src/var/.mysqldata). If you wish to use the new configuration, please remove the existing volume "src_mysql-mount" first: $ docker volume rm src_mysql-mount

Use named volume for nginx(?)

Without a named volume, you end up with a lot of extra volumes that are no longer used, as a new one is created each time you start the service. (These can be cleaned with for example docker volume prune

We should use a named volume instead so it is reused

Mysql cannot mount with default docker-compose.yml


Creating src_mysql_1 ... error

ERROR: for src_mysql_1  Cannot start service mysql: error while mounting volume '/var/lib/docker/volumes/src_mysql-mount/_data': failed to mount local volume: mount :/Users/billydegraaf/Sites/foreyes/src/var/.mysqldata:/var/lib/docker/volumes/src_mysql-mount/_data, data: addr=192.168.65.2,nolock,hard,nointr,nfsvers=3: no such file or directory

ERROR: for mysql  Cannot start service mysql: error while mounting volume '/var/lib/docker/volumes/src_mysql-mount/_data': failed to mount local volume: mount :/Users/billydegraaf/Sites/foreyes/src/var/.mysqldata:/var/lib/docker/volumes/src_mysql-mount/_data, data: addr=192.168.65.2,nolock,hard,nointr,nfsvers=3: no such file or directory
ERROR: Encountered errors while bringing up the project.```

Install PHP extensions

It seems we're missing the php intl extension

Check which extension are required with Magento and install them as well.

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


No Slack web-hook defined.

A Slack Webhook must be created and set in the SLACK_WEBHOOK environment variable on your CI environment.

Please make sure to create a Slack Webhook and to set it in the SLACK_WEBHOOK environment variable on your CI environment. Alternatively, provide slackWebhook as a configuration option.


Good luck with your project ✨

Your semantic-release bot 📦🚀

Magento 2.4: MySQL 8.0 / PHP 7.4 / ElasticSearch 7.6

Create a new Major 3.x.x release to support Magento 2.4? Keep Magento 2.3 on docker-development-box 2.x.x?

  • Advise PHP 7.4 as default in the README
  • MySQL 8.0 requires the latest mysqlclient (#37)
  • MySQL 8.0 requires different configuration, make configuration compatible with old version.
  • ElasticSearch 7.6
  • Keep branch for Magento 2.3 that can receive new features or fixes, but no breaking changes

Mysql cannot dump database due COLUMN_STATISTICS table

mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Couldn't execute 'SELECT COLUMN_NAME,                       JSON_EXTRACT(HISTOGRAM, '$."number-of-buckets-specified"')                FROM information_schema.COLUMN_STATISTICS                WHERE SCHEMA_NAME = 'magento' AND TABLE_NAME = 'admin_analytics_usage_version_log';': Unknown table 'COLUMN_STATISTICS' in information_schema (1109)

This prevents executing database dumps with n98-magerun2 on your local machine.

PHP: xdebug cli

XDEBUG_CONFIG="" php -c /usr/local/etc/php/7.2/php-xdebug.ini bin/magento

Nginx: Requests are cached

It seems that requests are cached and not updating on the website when a file is edited, even though CMD+SHIFT+R. Due to Nginx micro caching? Sync issues with Nginx?

Add Makefile to facilitate common tasks

Inspired by https://github.com/wodby/docker4drupal, a similar project but for Drupal, it would be nice to have a Makefile that facilitates some common tasks while developing.

Some of the shortcuts that the Makefile provides (via the referenced file docker.mk) are:

  • start
  • stop
  • help
  • open a ssh session
  • run drush commands (we could run php bin/magento commands and n98-magerun2 too)

As mentioned in #17, this file could be a good place to have startup/shutdown commands, for example.

Documentation for new developer if project already has docker

Currently "Project installation" assumes there is no project yet and new developer can get confused.
Add a section called "Project installation for already existing project" in which these steps are only needed:

- Install this in the current project: `composer install`
- Update or create an env.php file and with the following info 'host' => '127.0.0.1', 'dbname' => 'magento', 'username' => 'magento', 'password' => 'magento',

Needed for the 2.3x and 2.4x branch.

Verify hash of the downloaded file to (re)install PHP

In the README it's suggested to execute:

curl -s https://raw.githubusercontent.com/ho-nl/docker-development-box/master/install.sh | bash -s -- -i

There is no validation of the remove script. It's a best practice to avoid somebody from impersonating/replacing the script that will do crucial system tasks.

References:

Remove separate 2.x branch for older Magento versions

Having to keep two branches up to date with install.sh en README.md changes is a bit of a hassle (or more importantly: we just forget to keep them updated). Since (I think?) the only difference between the branches is having to apply a different static content patch (depending on M2 version), I propose we just handle this by having only a main branch with the two patches in the repo with appropriate instructions in a single unified README

PHP version unexepectedly changed to PHP 8.x

After the switch to the shivammathur/php brew tap, we install all php-fpm services with the version in the service name. Before, we installed a php-fpm service without version included, which always ran the latest available PHP version from brew (which back then was PHP 7.4, but currently is PHP 8.1).

Because this service is not removed/cleaned up currently by the install.sh script, it will still attempt to start and listen on port 9074, causing one to (depending on which service happens to start first and listen on port 9074) unexpectedly run PHP 8.1.

  • Ensure install.sh script cleans up legacy service

FPM initialization failed (Address already in use (48))

After installing PHP with the installation script, the execution of Magento is still very slow - without observing any bottleneck in the usage of resources.

The logs are full of entries like this:

==> /usr/local/var/log/php-fpm.log <==
[26-Aug-2020 12:56:21] ERROR: unable to bind listening socket for address '127.0.0.1:9072': Address already in use (48)
[26-Aug-2020 12:56:21] ERROR: FPM initialization failed

And killing the PHP process does not help, the errors appear almost instantly:

==> /usr/local/var/log/php-fpm.log <==
[26-Aug-2020 13:13:43] NOTICE: fpm is running, pid 14034
[26-Aug-2020 13:13:43] NOTICE: ready to handle connections
[26-Aug-2020 13:13:53] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[26-Aug-2020 13:13:53] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[26-Aug-2020 13:13:53] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
[26-Aug-2020 13:13:53] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
[26-Aug-2020 13:13:53] ERROR: unable to bind listening socket for address '127.0.0.1:9072': Address already in use (48)
[26-Aug-2020 13:13:53] ERROR: unable to bind listening socket for address '127.0.0.1:9072': Address already in use (48)
[26-Aug-2020 13:13:53] ERROR: FPM initialization failed
[26-Aug-2020 13:13:53] ERROR: FPM initialization failed

MySQL Issues

@paales Ik probeer 12Go M2 te updaten naar 206, maar hou nog steeds MySQL problemen, moet ik nog iets meer doen dan alleen maar package updaten en opnieuw opstarten?

Schermafbeelding 2020-10-01 om 11 09 04

( ! ) Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] Connection refused in /Users/maikelkoek/Sites/project-12gobiking-m2/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php on line 144

Originally posted by @Maikel-Koek in #29 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.