Git Product home page Git Product logo

ddev-contrib's Introduction

ddev-contrib: Contrib for DDEV

Contrib space for DDEV add-ons, services, tools, snippets, and approaches. MOSTLY OBSOLETE!

THIS REPO IS MOSTLY OBSOLETE, Check the Add-On Registry!

MOST OF THESE recipes have been made obsolete by DDEV add-ons. Please look for add-ons before using anything here. ddev get --list --all

See docs and ddev get --list for official add-ons, ddev get --list --all for all add-ons.

config.yaml hook examples

docker-compose.*.yaml snippets to solve simple problems

Don't forget the Official documentation.

Custom command examples

DDEV's custom commands are a great way to add team-level or project-level commands. They're simple scripts that can be run in any of the containers or on the host. Note that several examples are already shipped with DDEV, you'll find them in .ddev/commands//.example, and then can be enabled by symlinking or copying.)

Additional services added via docker-compose.<service>.yaml

General information on how to do additional services and some additional examples are in the docs.

.ddev/web-build/Dockerfile examples to customize web container

  • Laravel Queue-Worker (This is also a good example of adding an additional process to supervisord,)
  • Stripe CLI (This is also a good example of adding any non-standard Debian repository.)
  • gRPC (This is also a good example of adding a pecl module that is not supported via apt-get.)

Full recipes

Third-party add-ons

ddev-contrib's People

Contributors

alechko avatar amitaibu avatar bc1121 avatar berdir avatar briantully avatar bserem avatar cmuench avatar crydotsnake avatar dacostafilipe avatar damienmckenna avatar davidjguru avatar felmab avatar gitressa avatar hanoii avatar jonaseberle avatar makraz avatar mkalkbrenner avatar pcambra avatar penyaskito avatar rfay avatar ruslansteiger avatar rvolk avatar scotteuser avatar siliconmeadow avatar stborchert avatar thomaskieslich avatar tommym9 avatar tyler36 avatar wolffc avatar wtfred avatar

Stargazers

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

Watchers

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

ddev-contrib's Issues

BUG: Failed to run pgsql_export

I was updating my postgres image to match my server environment and when I noticed that ddev pgsql_export didn't work.

$ ddev pgsql_export
bash: /mnt/ddev_config/import-db/postgresql.db.sql: Permission denied
Failed to run pgsql_export : exit status 

I though I might have messed something up. So I

  • deleted images

    ddev stop
    ddev delete -O -y
    
  • changed docker-compose.postgres.yaml

        image: mdillon/postgis:11

But recieved the same message.

I tried removing ./.ddev/import-db, creating it in WSL2 and running the command.
I tried removing ./.ddev/import-db and letting DDEV create the directory; both without success

I noticed PR #152 and tried changing the image to postgres:13.4, but without success.

I also tried using the ddev snapshot but it didn't work (it only target MySQL right?) . It would be nice if DDEV used my preferred database for snapshot. ๐Ÿ˜„

OS: WSL2 on Win10
DDEV: v1.18.0-rc1-9-gac148660

headless-chrome: The response: 'Host header is specified and is not an IP address or localhost.'

I'm using the headless-chrome service for running browser tests and the url in my app settings is set to "http://chrome:9222", but when I run my tests I get the error that's in the issue title. I've been searching around and apparently it's down to the Chrome version being used.

This issue OnetapInc/chromy#110 explains what's going on and I tried switching to the container/version they're using which stopped the error but gives me a new one.

Facebook\WebDriver\Exception\WebDriverException: JSON decoding of remote response failed.
Error code: 4
The response: 

I'm guessing it's using the correct container and port name now, but something in the service yaml file isn't set correctly which is why the response is now blank. Any help with this issue would be greatly appreciated.

Support for Symfony console

Hi, I have created a super simple custom command to support Sympfony console by using ddev console ..., this makes super easy to execute Symfony console commands without ssh into the container.

I believe that other people might find it handy so I wanted to see if it's worth submitting it here as well.

Command file path:
commands/web/console

Command script:

#!/bin/bash

## Description: Run Symphony console
## Usage: console <command>
## Example: "ddev console about" or "ddev console debug:config"
bin/console $@

If approved, I've already forked this repo and can submit a PR.

Screen Shot 2021-01-29 at 09 59 27

docker-compose-services/postgres - drush command to empty database?

Referring to command ddev pgsql_import on page: https://github.com/drud/ddev-contrib/tree/master/docker-compose-services/postgres

Import / Export

  • ddev pgsql_import : Use pgsql to import .ddev/import-db/postgresql.db.sql into db - Note that this must be executed with an empty database.

Three questions on this please:

  1. Is there also a command to empty/drop the database, in preparation for the above import command?

If I try ddev drush sql-drop -y I get

[warning] The shell command 'psql -q' is required but cannot be found. Please install it and retry.
Failed to run drush sql-drop -y: exit status 1

I've installed:
sudo apt install postgresql-client-common
sudo apt-get install postgresql-client

to get psql but I'm doubtful if that is going to help, given that we are running postgresql inside a Docker container, rather than on the host machine (Ubuntu 20.04).

  1. Or if there isn't a command to empty/drop the database, then is it possible for me to connect into the ddev Docker container for postgresql and run it? I don't think I'm running postgrelsql, here is my .ddev/config.yaml :
name: mysite-develop
type: drupal8
docroot: web
php_version: "7.3"
webserver_type: nginx-fpm
router_http_port: "80"
router_https_port: "443"
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
mariadb_version: "10.3"
mysql_version: ""
provider: default
use_dns_when_possible: true
composer_version: ""

  1. I'm assuming the 2 commands, ddev pgsql_import and ddev pgsql_export are for importing a postgresql export dump file into a ddev setup running mysql or maria, is that right?

Related issues:

Service postgres user

not a Bug but a question:

The "ddev pgsql_import" is not working because the user postgres dosnt exists and the command psql ist unavailable (the user and the commant exists inside the postgres container only)
if i fire up the command:

No passwd entry for user 'postgres'
Failed to run pgsql_import : exit status 1

did I miss something here?

importing the database inside the postgres container now :)

expected <block end>, but found '<block mapping start>' in "[...]/.ddev/docker-compose.chromedriver.yaml

docker-compose.chromedriver.yaml returns indentation errors in yaml validator, and produces the following error on ddev start/restart:

Failed to restart {projectname}: Failed to run docker-compose [-f /Users/path/to/project/.ddev/.ddev-docker-compose-base.yaml -f /Users/path/to/project/.ddev/docker-compose.chromedriver.yaml config], err='exit status 1', stdout='', stderr='yaml.parser.ParserError: while parsing a block mapping
  in "/Users/Users/path/to/project/.ddev/docker-compose.chromedriver.yaml", line 8, column 3
expected <block end>, but found '<block mapping start>'
  in "/Users/Users/path/to/project/.ddev/docker-compose.chromedriver.yaml", line 11, column 5' 

Changing spacing results in different errors, but I have not yet discovered what will lead to a working install. The following change appears to get the closest of what I've tried so far:

---
# Docker-ChromeDriver configuration for DDEV-Local.
# There is one item that must be configured in this file in order for it to
# work, please see below.

version: '3.6'
services:
  chromedriver:
    links:
      web: web
      image: drupalci/webdriver-chromedriver:production
      container_name: ddev-${DDEV_SITENAME}-chromedriver
      labels:
        com.ddev.site-name: ${DDEV_SITENAME}
        com.ddev.approot: $DDEV_APPROOT

  web:
    links:
      - chromedriver:$DDEV_HOSTNAME
    environment:
      # *** One of these must be uncommented ***
      # In order for the system to work, one of these must be uncommented so
      # that the test system can connect to the database.
      # - SIMPLETEST_DB=sqlite://tmp/test.sqlite
      - SIMPLETEST_DB=mysql://db:db@db:3306/db
      #
      # Note: Do not modify the base URL value.
      - SIMPLETEST_BASE_URL=http://web
      - BROWSERTEST_OUTPUT_DIRECTORY=/tmp
      - BROWSERTEST_OUTPUT_BASE_URL=${DDEV_PRIMARY_URL}
      - MINK_DRIVER_ARGS_WEBDRIVER=["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless", "--no-sandbox"]}}, "http://chromedriver:9515"]

This spacing produces the following error, which will be my starting point when I next am able to explore:

Failed to restart {projectname}: Failed to run docker-compose [-f /Users/path/to/project/.ddev/.ddev-docker-compose-base.yaml -f /Users/path/to/project/.ddev/docker-compose.chromedriver.yaml config], err='exit status 1', stdout='', stderr='The Compose file '/Users/path/to/project/.ddev/docker-compose.chromedriver.yaml' is invalid because:
services.chromedriver.links contains an invalid type, it should be an array' 

blackfire: Service conflict when running multiple projects at the same time

When you have multiple ddev projects running, and you're using blackfire in all of them, then you will most likely talk to the wrong service when connecting to tcp://blackfire:8707.

see

The service is defined like this:

services:
  web:
    links:
      blackfire:$DDEV_HOSTNAME

This means that the container blackfire is aliased as $DDEV_HOSTNAME. This doesn't work, and I assume it is silently ignored by Docker...
The problem is, when you still connect to the host blackfire, then this name exists multiple times. Try to ping the blackfire host from the web container multiple times to see this in effect...

Therefore, connecting to blackfire.agent_socket = tcp://blackfire:8707 will only work if the host is given a distinct alias.

This can be solved in a very simple way: Just assign the alias blackfire to this container, and it will work as expected:

services:
  web:
    links:
      blackfire:blackfire

When you ping the blackfire host again, it will always resolve to the service from the same project.

This is also solved in the same way for mongodb in this project, see
https://github.com/drud/ddev-contrib/blob/aeacfb338cf3da2d7dee61e4741b2aeca70c5c95/docker-compose-services/mongodb/docker-compose.mongo.yaml#L43

TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block

Hi,

I've bumped into this issue when adding a new index to elasticsearch (Drupal 8 site). After a bit of digging it looks like Elasticsearch is hitting or getting towards its memory limit.

I did clock there is a note in the readme of this project about increasing the memory limit, but no instructions on how to do this. My docker knowledge isn't the greatest so I've been playing with my docker-compose.elasticsearch.yaml in the hopes I can get it working. No joy so far.

Here is my file for reference:

version: '3.6'
services:
  elasticsearch:
    container_name: ddev-${DDEV_SITENAME}-elasticsearch
    hostname: ${DDEV_SITENAME}-elasticsearch
    image: elasticsearch:7.9.3
    ports:
      - "9200"
      - "9300"
    environment:
      - cluster.name=docker-cluster
      - discovery.type=single-node
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms2048m -Xmx2048m"
      - VIRTUAL_HOST=$DDEV_HOSTNAME
      - HTTP_EXPOSE=9200:9200
      - HTTPS_EXPOSE=9201:9200
    ulimits:
      memlock:
        soft: -1
        hard: -1
    labels:
      com.ddev.site-name: ${DDEV_SITENAME}
      com.ddev.approot: $DDEV_APPROOT
    volumes:
      - elasticsearch:/usr/share/elasticsearch/data
      - ".:/mnt/ddev_config"
  web:
    links:
      - elasticsearch:elasticsearch

volumes:
  elasticsearch:

On my docker desktop I've got the memory up at 16gb so it shouldn't touch that.

Any help would be massively appreciated!

Cheers

Tom

The full error I'm seeing can be found here:
{"error":{"root_cause":[{"type":"cluster_block_exception","reason":"index [elasticsearch_index_db_news] blocked by: [TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];"}],"type":"cluster_block_exception","reason":"index [elasticsearch_index_db_news] blocked by: [TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];"},"status":429}

And running ddev logs -s elasticsearch gives me:
{"type": "server", "timestamp": "2021-07-15T14:16:25,257Z", "level": "WARN", "component": "o.e.c.r.a.DiskThresholdMonitor", "cluster.name": "docker-cluster", "node.name": "REDACTED-drupal-elasticsearch", "message": "flood stage disk watermark [95%] exceeded on [jpkE4gtsRfG26M27cBaP4g][REDACTED-drupal-elasticsearch][/usr/share/elasticsearch/data/nodes/0] free: 3.2gb[3.1%], all indices on this node will be marked read-only", "cluster.uuid": "mOTWzkOWSIK-2dyYJLV-4A", "node.id": "jpkE4gtsRfG26M27cBaP4g" }

New Relic service

I'll document adding New Relic as a service. So far I have this:

.ddev/docker-compose.newrelic.yaml:

---
# Adds New Relic support for performance profiling.
version: '3.6'
services:
  newrelic:
    image: newrelic/php-daemon
    container_name: ddev-${DDEV_SITENAME}-newrelic
    ports: ['31339']
    labels:
      com.ddev.site-name: ${DDEV_SITENAME}
      com.ddev.approot: $DDEV_APPROOT

  web:
    args:
      NEW_RELIC_AGENT_VERSION: "9.2.0.247"
      NEW_RELIC_LICENSE_KEY: "NEW_RELIC_LICENSE_KEY"
      NEW_RELIC_APPNAME: ${DDEV_SITENAME}
      NEW_RELIC_DAEMON_ADDRESS: "newrelic:31339"
    links:
      - newrelic:$DDEV_HOSTNAME

And in .ddev/web-build/Dockerfile

ARG BASE_IMAGE
FROM $BASE_IMAGE

# Install New Relic
# @see https://docs.newrelic.com/docs/agents/php-agent/advanced-installation/docker-other-container-environments-install-php-agent
ARG NEW_RELIC_AGENT_VERSION
ARG NEW_RELIC_LICENSE_KEY
ARG NEW_RELIC_APPNAME

RUN curl -L https://download.newrelic.com/php_agent/archive/${NEW_RELIC_AGENT_VERSION}/newrelic-php5-${NEW_RELIC_AGENT_VERSION}-linux.tar.gz | tar -C /tmp -zx \
    && export NR_INSTALL_USE_CP_NOT_LN=1 \
    && export NR_INSTALL_SILENT=1 \
    && /tmp/newrelic-php5-${NEW_RELIC_AGENT_VERSION}-linux/newrelic-install install \
    && rm -rf /tmp/newrelic-php5-* /tmp/nrinstall*

RUN sed -i -e "s/REPLACE_WITH_REAL_KEY/${NEW_RELIC_LICENSE_KEY}/" \
    -e "s/newrelic.appname[[:space:]]=[[:space:]].*/newrelic.appname=\"${NEW_RELIC_APPNAME}\"/" \
    -e '$anewrelic.distributed_tracing_enabled=true' \
    -e '$anewrelic.daemon.address="newrelic-php-daemon:31339"' \
    $(php -r "echo(PHP_CONFIG_FILE_SCAN_DIR);")/newrelic.ini

Once I know it all works I'll open a PR

Configuring an environment to work with Hugo CMS

I want to contrib an environment for ddev that uses hugoCMS for creating static pages.

I have installed hugo using Debian stable package in my /web-build DockerFile using:

ARG BASE_IMAGE
FROM $BASE_IMAGE
RUN sudo apt-get update && apt-get install hugo -qq

But the problem is that the version provided by Debian packages on stable is too old (0.55). I have tried to install it using snap or brew but I was not able to install it (maybe I'm doing something wrong).

How can I install the latest version of Hugo in a ddev environment? Any help or guide I can follow?

Another question related to this is that Hugo development server uses port 1313. I'm trying to "publish" this port using the following configuration in my docker-compose.override.yaml file:

version: "3.6"
services:
  web:
    ports:
      - "1313:1313"

But it doesn't work. Any help?

Update multisite recipe for DDEV-Local 1.13.0 (disable-settings-management)

It may be possible to improve the multisite recipe using --disable-settings-management. However, there are some cases where it relies on ddev-generated settings. I'm not sure if ddev should maybe have a way to manually trigger generation of CMS settings files while still keeping settings management otherwise-disabled? It would be useful for one-time templating and customization like in this example.

If not, then we can either just leave it alone or expand it to include the necessary settings files.

Troubleshooting tips for Solr

I ran into some problems recently getting Solr to work, so I thought it'd be useful to add some tips to the documentation. PRs forthcoming.

drupalci-chromedriver recipe does not work on arm64 (Mac M1/Apple Siliicon)

Following the setup on https://github.com/drud/ddev-contrib/tree/master/docker-compose-services/drupalci-chromedriver I get the following error

  1. Drupal\Tests\system\FunctionalJavascript\System\DateFormatTest::testDateFormatXss
    The test wasn't able to connect to your webdriver instance. For more information read core/tests/README.md.

The original message while starting Mink: Could not open connection: unknown error: Chrome failed to start: crashed.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=98.0.4758.102 (273bf7ac8c909cde36982d27f66f3c70846a3718-refs/branch-heads/4758@{#1151}),platform=Linux 5.10.47-linuxkit x86_64)

/var/www/html/web/core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php:55
/var/www/html/web/core/tests/Drupal/Tests/BrowserTestBase.php:381
/var/www/html/web/core/modules/system/tests/src/FunctionalJavascript/System/DateFormatTest.php:29
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:703

Don't know how to proceed any help would be appreciated (@mglaman or @heddn tagging you as the authors on that page)

I'm on a macbook with the M1 chip if that matters.

SQL Server (Microsoft) Readme Updates

After following the Readme for adding a Microsoft SQL database I ran into some issues getting it started.

  1. a PHPize error as commented on here #168 (comment)
  2. Password in readme did not match Docker-compose.sqlsrv.yaml

Add default host and port name to readme

Hi,

First off thanks for this package. I've added Redis to a couple of projects now and its a breeze.

One thing I always get snagged on is hostname and port. I know this information is in the docker-compose.redis.yml file, but would it be possible to add it to the readme to make it really easy for people like me who only add Redis to projects once or twice a year?

Cheers

Tom

Retiring redundant `ddev-contrib`

With the upcoming release of 1.19, Postgre support is in-build making the recipe here redundant.
There is also a move towards ddev get and "official" versions.

We should consider how we want to "retire" redundant contribs while still maintaining searchability for users that may require older versions of DDEV.

  • Do we flag items with DDEV version tags?
  • Provide links to the new service and/or relevant documentaion?
  • Add migration guides?

Just thinking out loud.

Document the redis service host and port

Hi,

Thanks for the recipe. It would be great to add to the documentation what the host/port will be once this container is running. Just to save someone like me looking it up.

Cheers

Tom

redis does not start

I have copied the folders and files but after ddev restart the redis process does not start due to this:

1:C 23 Jun 12:28:34.975 # Fatal error, can't open config file '/usr/local/etc/redis/redis.conf'

Solr instance is not running in SolrCloud mode

I'm attempting to use Drupal 10.0.3 with Search API 4.2.10.

I followed the instructions on the README, but after I set the number of shards to 3 and submit (while trying to upload a new config set from /admin/config/search/search-api/server/ddev_server I get the following error:

Configset upload failed with error code 400: Solr HTTP error: OK (400) { "responseHeader":{ "status":400, "QTime":6}, "error":{ "metadata":[ "error-class","org.apache.solr.common.SolrException", "root-error-class","org.apache.solr.common.SolrException"], "msg":"Solr instance is not running in SolrCloud mode.", "code":400}}

I am able to access the solr server at http://moreddev.ddev.site:8983/solr/#/

On the Drupal server view page (/admin/config/search/search-api/server/ddev_server):

  • Server Connection: The Solr server could be reached.
  • Collection Connection: The Solr collection could not be accessed. Further data is therefore unavailable.
  • Configured Solr Version: 8.11.2
  • Additional information: An error occurred while trying to retrieve additional information from the Solr server: Solr endpoint http://ddev-moreddev-solr:8983/ not found (code: 404, body: <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/> <title>Error 404 Not Found</title> </head> <body><h2>HTTP ERROR 404 Not Found</h2> <table> <tr><th>URI:</th><td>/solr/techproducts/admin/luke</td></tr> <tr><th>STATUS:</th><td>404</td></tr> <tr><th>MESSAGE:</th><td>Not Found</td></tr> <tr><th>SERVLET:</th><td>default</td></tr> </table> </body> </html> , message: Solr HTTP error: OK (404) <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/> <title>Error 404 Not Found</title> </head> <body><h2>HTTP ERROR 404 Not Found</h2> <table> <tr><th>URI:</th><td>/solr/techproducts/admin/luke</td></tr> <tr><th>STATUS:</th><td>404</td></tr> <tr><th>MESSAGE:</th><td>Not Found</td></tr> <tr><th>SERVLET:</th><td>default</td></tr> </table> </body> </html> ).

What am I missing?

thanks,
-mike

Clarify documentation for Blackfire

related to ddev/ddev#1606

It is not obvious that the blackfire.agent_socket needs to be overriden in order to work. It's also not clear on how this gets overridden. The current README hints that the agent socket can be adjusted via the included blackfire.ini, which can be misinterpreted that since it's included, it's being automatically pulled in.

I think we should clarify that the user will need to explicitly add a custom php.ini configuration file in order to get blackfire working correctly.

PostgreSQL commands not working (directory permissions)

Hi all,

I noticed that the PostgreSQL commands (https://github.com/drud/ddev-contrib/tree/master/docker-compose-services/postgres/commands/postgres) do not work out of the box.

I was able to find the reason relatively quickly: In the comments the export & import directory ".ddev/pgsql-db" is mentioned, this is also set correctly during pg_dump and import, but the pgsql_export script still says that the directory "/mnt/ddev_config/import-db" and not "pgsql-db" should be created.

When I changed this to "pgsql-db" everything worked as well. However, the "pgsql-db" folder is not included in .gitignore, so I wonder if it doesn't make sense again to store the database dump in "import-db".

upgraded to ddev v1.18.0 - now receive: Could not validate a connection to Elasticsearch. No alive nodes found in your cluster

Since upgrading to ddev v1.18.0 this elasticsearch config is not working.
I am receiving the errror "Could not validate a connection to Elasticsearch. No alive nodes found in your cluster".
I have restarted ddev several times but still same error.
My config is:

version: '3.6'
services:
elasticsearch:
container_name: ddev-${DDEV_SITENAME}-elasticsearch
hostname: ${DDEV_SITENAME}-elasticsearch
image: elasticsearch:7.10.1
expose:
- "9200"
- "9300"
environment:
- cluster.name=docker-cluster
- discovery.type=single-node
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- VIRTUAL_HOST=$DDEV_HOSTNAME
- HTTP_EXPOSE=9200:9200
- HTTPS_EXPOSE=9201:9200
labels:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.approot: $DDEV_APPROOT
volumes:
- elasticsearch:/usr/share/elasticsearch/data
- ".:/mnt/ddev_config"
web:
links:
- elasticsearch:elasticsearch

volumes:
elasticsearch:

Any ideas?

general_log script is not working

I have copied the file general_log into my project's .ddev/commands/db and then I have restarted ddev. Afterwards I run following command in my project folder

ddev general_log

I got the following message


Enabling general_log mysql: [Warning] Using a password on the command line interface can be insecure.
โœ“
Press CTRL+C to exit.

Failed to run general_log : exit status 1


"Permission denied" error when using SSH server on Win10

I'm trying to follow the SSH setup on a Win10 PC.

When I run the command, I am prompted for a password, but I always get a denied error.

ssh -p 2222 -o StrictHostKeyChecking=no localhost
lost\user13@localhost's password: 
Permission denied, please try again.

If I try ssh-add, the password is accepted.

I have it working in WSL though I think it might there might be an issue with Win10?

OS: Win10
DDEV:
Win10 DDEV 1.18.2, 1.19.0-alpha3
WSL: 1.19.0-alpha3

Redis integration fails to run cli (Illegal option -o pipefail)

Hi, I used the redis configuration as provided.
But running the command ddev redis-cli results in the following error:

$ ddev redis-cli
sh: 1: set: Illegal option -o pipefail
Failed to run redis-cli : exit status 2

Ddev version

$ ddev --version
ddev version v1.15.0

By searching for it I only found out, that this is an error if you are running the command using /bin/sh which links to /bin/dash which does not have the option -o.

The docker-entrypoint.sh from redis is pretty solid and has a shebang for /bin/bash in it, so this should be fine.
Running the docker container directly works:

$ docker exec -i 2e7f7ec00f28 redis-server --version
Redis server v=6.0.5 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=db63ea56716d515f

Is there any special execution happening behind the scenes using ddev which runs the command using /bin/sh or something?

Introduce drowl-init-from-existing (--remote) command

Context:

Existing Drupal project (online) should be fetched from remote to work on it locally (like drowl-init-from-existing) easily.

The Drupal Project typically consists of:

  • composer.json
  • config
  • content
  • files
  • settings.php (server-side configuration)

As config and content are both contained in the database and are up to date there, for a first step we should concentrate on the database instead of fetching configuration.

Steps after 9 are equal to drowl-init-from-existing so perhaps it might make sense to select the source in the first step of drowl-init-from-existing => From local files or From Remote?

Required information for fetching from remote:

  • SSH Login
  • Remote path to project
  • Database name (can be derived from remote settings.php)
  • Project URL

Steps to take (UX - pseudo):

  1. Run drowl-init-from-existing-remote (difer)
  2. Enter Remote Server Connection (user@host:[port])
  3. Connect (using ssh key auth)
  4. You are in directory XXX, enter the path to the project directory (absolute or relative)
  5. /var/www/xz/123/abc/drupal
  6. Check if composer.json is in directory and contains "name": "drupal/recommended-project" => Give success or error message
  7. Read database name from settings.php => The used remote database name is "XXX", is this correct?
  8. Fetch composer.json and database XXX from remote and import into project?
  9. Do it... (proceed like in drowl-init-from-existing)

Further improvements (low prio):

  • Allow to update from remote (re-fetch composer.json, database or config)
  • Compare composer.json or config with remote

Out of scope

  • Uploading to remote or any other deployment steps

Chrome headless 500 Internal Server Error

Hi,

I'm trying to setup a headless chrome as a service following the headless-chrome service (for Behat Testing) and have the following issue:

Service is running fine, and I can access http://localhost:9222 alright from the host.
However, when running wget http://chrome:9222 from the web container, i constantly get a 500 Internal Server Error response.
I'm running lastest ddev 1.18.2 and Docker Desktop 4.4.2 on a M1 MacBook Pro.

Does anyone else is experiencing this issue?

docker-compose-services/postgres - does .ddev/config.yaml need to refer to postgres for when ddev start is run?

My config.yaml looks like:

name: mysite-develop
type: drupal8
docroot: web
php_version: "7.3"
webserver_type: nginx-fpm
router_http_port: "80"
router_https_port: "443"
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
mariadb_version: "10.3"
mysql_version: ""
provider: default
use_dns_when_possible: true
composer_version: ""

But this creates a mariadb container, according to the log output displayed after I run ddev start

Creating volume "ourhealthheroes-develop-mariadb" with default driver

So do I need to change my config.yaml to use a postgres db before I follow the setup instructions here: https://github.com/drud/ddev-contrib/tree/master/docker-compose-services/postgres

It seems I need to do something, because if I try to use the commands provided in the above, e.g. ddev pgsql_drop I get:

ERROR: No such service: postgres
Failed to run pgsql_drop : exit status 1

Related issue: ddev/ddev#2187

Help to setup FTP service

I'm running a project which requires ftp access across multiple vhosts.

I accomplished multi-domain using additional_hostnames in config.yaml and managed different docroots using a custom apache/apache-site.conf file.

Now I'm stuck. I have not enough docker knowledge to add a FTP service.
I'm going to add a .ddev/docker-compose.ftp.yaml file but don't know how make it work vimagick/pure-ftpd (or some other).

This is my actual file:

version: '3.6'

services:
  pure-ftpd:
    container_name: ddev-${DDEV_SITENAME}-ftp
    image: vimagick/pure-ftpd
    hostname: ftp-dam
    volumes:
      - ./media:/home/ftpuser:rw
    privileged: true
    restart: always

ddev starts correctly but don't know how to access the FTP.

Can someone help me?

Thx

DrupalCI ChromeDriver instructions leads to "unable to set cookie" error

Following the DrupalCI ChromeDriver documentation lead me to the following error when I ran the suggested example test:

`$ phpunit --verbose -c core/phpunit.xml core/modules/system/tests/src/FunctionalJavascript/System/DateFormatTest.php
PHPUnit 8.5.8 by Sebastian Bergmann and contributors.

Runtime: PHP 7.3.25-1+020201130.73+debian101.gbp042074
Configuration: /var/www/html/core/phpunit.xml

Testing Drupal\Tests\system\FunctionalJavascript\System\DateFormatTest
E 1 / 1 (100%)

Time: 14.39 seconds, Memory: 4.00 MB

There was 1 error:

  1. Drupal\Tests\system\FunctionalJavascript\System\DateFormatTest::testDateFormatXss
    Exception: unable to set cookie
    (Session info: headless chrome=74.0.3729.157)
    (Driver info: chromedriver=2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Linux 4.19.76-linuxkit x86_64)

/var/www/html/vendor/instaclick/php-webdriver/lib/WebDriver/Exception.php:144
/var/www/html/vendor/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php:157
/var/www/html/vendor/instaclick/php-webdriver/lib/WebDriver/Session.php:191
/var/www/html/core/tests/Drupal/FunctionalJavascriptTests/DrupalSelenium2Driver.php:43
/var/www/html/vendor/behat/mink/src/Session.php:212
/var/www/html/core/tests/Drupal/Tests/UiHelperTrait.php:438
/var/www/html/core/tests/Drupal/Tests/UiHelperTrait.php:326
/var/www/html/core/tests/Drupal/Tests/UiHelperTrait.php:250
/var/www/html/core/modules/system/tests/src/FunctionalJavascript/System/DateFormatTest.php:33
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:691

ERRORS!
Tests: 1, Assertions: 5, Errors: 1.
`

This is running against Drupal 9.1 with ddev 1.16.2 running PHP 7.3, MariaDB 10.3 and the default nginx-fpm webserver.

Any suggestions?

Troubles with newest elasticsearch version

Hello,
i'm trying to migrate from the current version to 6.8.0

docker-compose.yml

version: '3.6'
services:
  elasticsearch:
    container_name: ddev-${DDEV_SITENAME}-elasticsearch
    hostname: ${DDEV_SITENAME}-elasticsearch
    image: elasticsearch:6.8.0
    ports:
      - "9200"
      - "9300"
    environment:
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      - VIRTUAL_HOST=$DDEV_HOSTNAME
      - HTTP_EXPOSE=9200
      - node.max_local_storage_nodes=3
    ulimits:
      memlock:
        soft: -1
        hard: -1
    labels:
      com.ddev.site-name: ${DDEV_SITENAME}
      com.ddev.approot: $DDEV_APPROOT
    volumes:
      - elasticsearch:/usr/share/elasticsearch/data
      - ".:/mnt/ddev_config"
  web:
    links:
      - elasticsearch:elasticsearch

volumes:
  elasticsearch:
    name: "${DDEV_SITENAME}-elasticsearch"

But i'm facing some permissions issues:

OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
OpenJDK 64-Bit Server VM warning: UseAVX=2 is not supported on this CPU, setting it to UseAVX=1
[2020-03-02T16:56:08,473][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [unknown] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Failed to create node environment
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.8.0.jar:6.8.0]
	at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.8.0.jar:6.8.0]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116) ~[elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-6.8.0.jar:6.8.0]
Caused by: java.lang.IllegalStateException: Failed to create node environment
	at org.elasticsearch.node.Node.<init>(Node.java:299) ~[elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.node.Node.<init>(Node.java:266) ~[elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:212) ~[elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.8.0.jar:6.8.0]
	... 6 more
Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data/nodes/1
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:90) ~[?:?]
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) ~[?:?]
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116) ~[?:?]
	at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:389) ~[?:?]
	at java.nio.file.Files.createDirectory(Files.java:692) ~[?:?]
	at java.nio.file.Files.createAndCheckIsDirectory(Files.java:799) ~[?:?]
	at java.nio.file.Files.createDirectories(Files.java:785) ~[?:?]
	at org.elasticsearch.env.NodeEnvironment.lambda$new$0(NodeEnvironment.java:273) ~[elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.env.NodeEnvironment$NodeLock.<init>(NodeEnvironment.java:206) ~[elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:270) ~[elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.node.Node.<init>(Node.java:296) ~[elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.node.Node.<init>(Node.java:266) ~[elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:212) ~[elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.8.0.jar:6.8.0]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.8.0.jar:6.8.0]

what i'm doing wrong or what else is missing?

Confusing Laravel example at docker-compose-services/redis

The information for the laravel .env file should be

CACHE_DRIVER=redis
REDIS_HOST=ddev-<DDEV_SITENAME>-redis
REDIS_PASSWORD=null
REDIS_PORT=6379

and not

CACHE_DRIVER=redis
REDIS_HOST=ddev-<DDEV_SITENAME>:6379
REDIS_PASSWORD=null
REDIS_PORT=6379

Incorrect instruction for adding solr on TYPO3

The information how to add a solr container for local ddev are not correct any longer.

It's not necessary to copy the solr configuration as described in step 5. And so it's also not necessary to add those files via volume. On the opposite, this results in buggy behaviour (stop word list and synonyms are not working as expected).

(

    volumes:
      - "./solr:/opt/solr/server/solr" # <-- THIS S NOT NEEDED ANY LONGER

The full discussion can be seen in this slack thread.

Shall I create a PR?

MongoDB solution no longer working

Hello,

I have set up mongodb in ddev at around November last year without issues. However, today I was trying to use this set up in a new project, and I could not get it to work at all; I keep running into this error:
Fatal error: Uncaught Error: Class 'MongoDB\Driver\Manager' not found in /var/www/html/public_html/vendor/mongodb/mongodb/src/Client.php:116

I have tried all variants of the setup as can be found in the history for the mongodb solution, but none helped.
I am also not sure whether this is an issue here, with ddev, or with the php-mongodb package.

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.