ddev / ddev

Docker-based local PHP+Node.js web development environments
https://ddev.com
Apache License 2.0
2.64k stars 592 forks source link

Unable to increase memory_limit beyond 512M (in Drupal) #6492

Closed jenlampton closed 1 week ago

jenlampton commented 3 weeks ago

Preliminary checklist

Output of ddev debug test

Expand `ddev debug test` diagnostic information ``` ======== Please make sure that you have already looked at troubleshooting guide ======== Troubleshooting guide: https://ddev.readthedocs.io/en/stable/users/usage/troubleshooting/ Simple things to check: * ddev poweroff * Restart Docker Provider * Reboot computer * Temporarily disable VPN and firewall Press any key to continue: ======== Output file will be in /var/folders/mw/_p1cl_rx69b3ll553w9cdvcc0000gn/T/ddev-debug-test.txt ======== ======== Existing project config ======== ddev installation alternate locations: /usr/local/bin/ddev /usr/local/bin/ddev These config files were loaded for project emerisa: [/Users/jlampton/Sites/emerisa/drupal/.ddev/config.yaml] name: emerisa type: drupal7 docroot: docroot php_version: 7.4 webserver_type: nginx-fpm webimage: ddev/ddev-webserver:v1.23.2 additional_hostnames: [] additional_fqdns: [] database: {mariadb 10.11} project_tld: ddev.site use_dns_when_possible: true composer_version: 2 nodejs_version: 20 default_container_timeout: 120 ======== existing project customizations ======== ======== installed DDEV add-ons ======== No registered add-ons were found. Add-ons installed before DDEV v1.22.0 will not be listed. Update them with `ddev get` so they'll be shown. ======== mutagen situation ======== looking for #ddev-generated in mutagen.yml in project /Users/jlampton/Sites/emerisa/drupal #ddev-generated unmodified #ddev-generated found in .ddev/mutagen/mutagen.yml ======== Creating dummy project named tryddevproject-2594 in ../tryddevproject-2594 ======== Creating a new DDEV project config in the current directory (/Users/jlampton/Sites/emerisa/tryddevproject-2594) Once completed, your configuration will be written to /Users/jlampton/Sites/emerisa/tryddevproject-2594/.ddev/config.yaml Configuring a 'php' project named 'tryddevproject-2594' with docroot 'web' at '/Users/jlampton/Sites/emerisa/tryddevproject-2594/web'. For full details use 'ddev describe'. Configuration complete. You may now run 'ddev start'. ======== OS Information ======== Darwin MacBook-Pro.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64 ProductName: macOS ProductVersion: 14.5 BuildVersion: 23F79 ======== User information ======== uid=501(jlampton) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),701(com.apple.sharepoint.group.1),33(_appstore),100(_lpoperator),204(_developer),250(_analyticsusers),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh),400(com.apple.access_remote_ae) ======== DDEV version ======== ITEM VALUE DDEV version v1.23.2 architecture arm64 cgo_enabled 0 db ddev/ddev-dbserver-mariadb-10.11:v1.23.2 ddev-ssh-agent ddev/ddev-ssh-agent:v1.23.2 docker 27.0.3 docker-api 1.46 docker-compose v2.27.0 docker-platform docker-desktop global-ddev-dir /Users/jlampton/.ddev mutagen 0.17.2 os darwin router ddev/ddev-traefik-router:v1.23.2 web ddev/ddev-webserver:v1.23.2 ======== proxy settings ======== HTTP_PROXY='' HTTPS_PROXY='' http_proxy='' NO_PROXY='' ======== DDEV global info ======== developer-mode=false disable-http2=false fail-on-hook-fail=false instrumentation-opt-in=true instrumentation-queue-size=0 instrumentation-reporting-interval=0s instrumentation-user= internet-detection-timeout-ms=3000 last-started-version=v1.23.2 letsencrypt-email= mailpit-http-port=8025 mailpit-https-port=8026 mkcert-caroot=/Users/jlampton/Library/Application Support/mkcert no-bind-mounts=false omit-containers=[] performance-mode=mutagen project-tld=ddev.site required-docker-compose-version=v2.27.0 router=traefik router-bind-all-interfaces=false router-http-port=80 router-https-port=443 simple-formatting=false table-style=bright traefik-monitor-port=10999 use-docker-compose-from-path=false use-hardened-images=false use-letsencrypt=false wsl2-no-windows-hosts-mgt=false xdebug-ide-location= ======== DOCKER provider info ======== docker client location: lrwxr-xr-x 1 jlampton staff 54 Jul 26 14:40 /Users/jlampton/.docker/bin/docker -> /Applications/Docker.app/Contents/Resources/bin/docker docker client alternate locations: /Users/jlampton/.docker/bin/docker Docker provider: docker-desktop Docker Desktop Version: Docker Desktop for Mac 4.32.0 build 157355 docker version: Client: Version: 27.0.3 API version: 1.46 Go version: go1.21.11 Git commit: 7d4bcd8 Built: Fri Jun 28 23:59:41 2024 OS/Arch: darwin/arm64 Context: default Server: Docker Desktop 4.32.0 (157355) Engine: Version: 27.0.3 API version: 1.46 (minimum version 1.24) Go version: go1.21.11 Git commit: 662f78c Built: Sat Jun 29 00:02:44 2024 OS/Arch: linux/arm64 Experimental: false containerd: Version: 1.7.18 GitCommit: ae71819c4f5e67bb4d5ae76a6b735f29cc25774e runc: Version: 1.7.18 GitCommit: v1.1.13-0-g58aa920 docker-init: Version: 0.19.0 GitCommit: de40ad0 DOCKER_DEFAULT_PLATFORM=notset Docker platform: docker-desktop Using Docker context: default (unix:///Users/jlampton/.docker/run/docker.sock) docker-compose: v2.27.0 Using DOCKER_HOST=unix:///Users/jlampton/.docker/run/docker.sock Docker version: 27.0.3 Able to run simple container that mounts a volume. Able to use internet inside container. Docker disk space:Filesystem Size Used Available Use% Mounted on overlay 227.0G 51.9G 163.6G 24% / ======== Existing docker containers ======== CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ======== mkcert information ======== /opt/homebrew/bin/mkcert /opt/homebrew/bin/mkcert /usr/local/bin/mkcert /usr/local/bin/mkcert /Users/jlampton/Library/Application Support/mkcert total 16 -r-------- 1 jlampton staff 2484 Mar 11 19:42 rootCA-key.pem -rw-r--r-- 1 jlampton staff 1826 Mar 11 19:42 rootCA.pem ======== ping attempt on ddev.site ======== PING dkdkd.ddev.site (127.0.0.1): 56 data bytes 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.058 ms --- dkdkd.ddev.site ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 0.058/0.058/0.058/nan ms ======== ddev debug refresh ======== Rebuilding project images... Rebuilding web image with `/Users/jlampton/.ddev/bin/docker-compose -f /Users/jlampton/Sites/emerisa/tryddevproject-2594/.ddev/.ddev-docker-compose-full.yaml build web --no-cache` #0 building with "default" instance using docker driver #1 [web internal] load build definition from Dockerfile #1 transferring dockerfile: 1.25kB done #1 DONE 0.0s #2 [web internal] load metadata for docker.io/ddev/ddev-webserver:v1.23.2 #2 DONE 0.0s #3 [web internal] load .dockerignore #3 transferring context: 2B done #3 DONE 0.0s #4 [web 1/7] FROM docker.io/ddev/ddev-webserver:v1.23.2 #4 CACHED #5 [web 2/7] RUN (groupadd --gid 20 "jlampton" || groupadd "jlampton" || true) && (useradd -l -m -s "/bin/bash" --gid "jlampton" --comment '' --uid 501 "jlampton" || useradd -l -m -s "/bin/bash" --gid "jlampton" --comment '' "jlampton" || useradd -l -m -s "/bin/bash" --gid "20" --comment '' "jlampton" || useradd -l -m -s "/bin/bash" --comment '' jlampton ) #5 0.106 groupadd: GID '20' already exists #5 0.135 useradd warning: jlampton's uid 501 outside of the UID_MIN 1000 and UID_MAX 60000 range. #5 DONE 0.2s #6 [web 3/7] RUN export XDEBUG_MODE=off; composer self-update --stable || composer self-update --stable || true; composer self-update --2 || composer self-update --2 || true #6 0.276 Storing "stable" as default update channel for the next self-update run. #6 0.902 You are already using the latest available Composer version 2.7.7 (stable channel). #6 1.523 You are already using the latest available Composer version 2.7.7 (2.x channel). #6 DONE 1.6s #7 [web 4/7] RUN mkdir -p /home/jlampton && chown jlampton /home/jlampton && chmod 600 /home/jlampton/.pgpass #7 DONE 0.1s #8 [web 5/7] RUN apt-get update #8 0.481 Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB] #8 0.743 Get:2 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB] #8 0.834 Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB] #8 0.834 Get:4 https://packages.sury.org/php bookworm InRelease [7548 B] #8 0.835 Get:5 https://deb.nodesource.com/node_20.x nodistro InRelease [12.1 kB] #8 0.923 Get:6 http://deb.debian.org/debian bookworm/main arm64 Packages [8688 kB] #8 0.924 Get:7 https://deb.nodesource.com/node_20.x nodistro/main arm64 Packages [8731 B] #8 0.981 Get:8 https://packages.sury.org/php bookworm/main arm64 Packages [236 kB] #8 1.018 Get:10 https://dl.cloudsmith.io/public/platformsh/cli/deb/debian bookworm InRelease [3675 B] #8 1.200 Get:11 http://nginx.org/packages/debian bookworm InRelease [2869 B] #8 1.215 Get:12 https://dl.cloudsmith.io/public/platformsh/upsun-cli/deb/debian bookworm InRelease [3681 B] #8 1.398 Get:14 https://dl.cloudsmith.io/public/symfony/stable/deb/debian bookworm InRelease [4422 B] #8 1.464 Get:15 http://nginx.org/packages/debian bookworm/nginx arm64 Packages [14.3 kB] #8 1.601 Get:16 https://dl.cloudsmith.io/public/platformsh/cli/deb/debian bookworm/main arm64 Packages [3887 B] #8 1.674 Get:17 https://dl.cloudsmith.io/public/platformsh/upsun-cli/deb/debian bookworm/main arm64 Packages [2878 B] #8 1.760 Get:18 https://dl.cloudsmith.io/public/symfony/stable/deb/debian bookworm/main arm64 Packages [7465 B] #8 1.776 Get:9 https://dlm.mariadb.com/repo/mariadb-server/10.11/repo/debian bookworm InRelease [4625 B] #8 1.927 Get:13 https://dlm.mariadb.com/repo/maxscale/latest/apt bookworm InRelease [9341 B] #8 2.284 Get:19 https://dlm.mariadb.com/repo/mariadb-server/10.11/repo/debian bookworm/main arm64 Packages [34.4 kB] #8 2.552 Get:20 https://dlm.mariadb.com/repo/mariadb-server/10.11/repo/debian bookworm/main amd64 Packages [40.9 kB] #8 3.048 Get:21 https://dlm.mariadb.com/repo/maxscale/latest/apt bookworm/main arm64 Packages [554 B] #8 3.369 Get:22 https://dlm.mariadb.com/repo/maxscale/latest/apt bookworm/main amd64 Packages [553 B] #8 3.722 Get:23 http://deb.debian.org/debian bookworm-updates/main arm64 Packages [13.7 kB] #8 3.803 Get:24 http://deb.debian.org/debian-security bookworm-security/main arm64 Packages [167 kB] #8 4.578 Fetched 9520 kB in 4s (2150 kB/s) #8 4.578 Reading package lists... #8 DONE 5.0s #9 [web 6/7] RUN curl -I https://www.google.com #9 0.113 % Total % Received % Xferd Average Speed Time Time Time Current #9 0.113 Dload Upload Total Spent Left Speed #9 0.113 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 #9 0.360 HTTP/2 200 #9 0.360 content-type: text/html; charset=ISO-8859-1 #9 0.360 content-security-policy-report-only: object-src 'none';base-uri 'self';script-src 'nonce-LeaJ9uWFH1WBVINZHoLPKg' 'strict-dynamic' 'report-sample' 'unsafe-eval' 'unsafe-inline' https: http:;report-uri https://csp.withgoogle.com/csp/gws/other-hp #9 0.360 p3p: CP="This is not a P3P policy! See g.co/p3phelp for more info." #9 0.360 date: Fri, 16 Aug 2024 22:43:46 GMT #9 0.360 server: gws #9 0.360 x-xss-protection: 0 #9 0.360 x-frame-options: SAMEORIGIN #9 0.360 expires: Fri, 16 Aug 2024 22:43:46 GMT #9 0.360 cache-control: private #9 0.360 set-cookie: AEC=AVYB7coRPC2FPFNSEcf11_iJIqpBZgL7_Jy2dxhtqjVeCCRhRN-7tnvJgQ; expires=Wed, 12-Feb-2025 22:43:46 GMT; path=/; domain=.google.com; Secure; HttpOnly; SameSite=lax #9 0.360 set-cookie: NID=516=U6xrdkx9JjH0JTQc8fz0B1oGWKsWCVWUedcMP5Omo9YDEyFkg_NDGq_gJFV-gienfWvg6-M9KnmIeH-ZxOAK0eLrBoe0wRqwcIFE0qXLgsMphFmJwpL-B4y9-KkLxORIRnz4Xb3dBsb6zJmw-f2Q2ydE3Qs90_YTQU317Azw4ql6zumzQPuDsA; expires=Sat, 15-Feb-2025 22:43:46 GMT; path=/; domain=.google.com; HttpOnly #9 0.360 alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 #9 0.360 #9 DONE 0.4s #10 [web 7/7] RUN chmod 777 /run/php #10 DONE 0.1s #11 [web] exporting to image #11 exporting layers 0.1s done #11 writing image sha256:07924bcf7d9c434234b3c82a9d0b5c995e05899c050cf9c12d3808397f282274 done #11 naming to docker.io/ddev/ddev-webserver:v1.23.2-tryddevproject-2594-built done #11 DONE 0.1s Refreshed Docker cache for project tryddevproject-2594 in 8s Network ddev_default created Container ddev-ssh-agent Created Container ddev-ssh-agent Started ssh-agent container is running: If you want to add authentication to the ssh-agent container, run 'ddev auth ssh' to enable your keys. Building project images... .Project images built in 1s. Network ddev-tryddevproject-2594_default Created Container ddev-tryddevproject-2594-db Created Container ddev-tryddevproject-2594-web Created Container ddev-tryddevproject-2594-web Started Container ddev-tryddevproject-2594-db Started Starting Mutagen sync process... Mutagen sync flush completed in 1s. For details on sync status 'ddev mutagen st tryddevproject-2594 -l' Waiting for containers to become ready: [web db] Starting ddev-router if necessary... Container ddev-router Created Container ddev-router Started Waiting for additional project containers to become ready... All project containers are now ready. ======== Project startup ======== Starting tryddevproject-2594... 2024-08-16T15:44:10.42 Pulled image for ddev/ddev-webserver:v1.23.2 2024-08-16T15:44:10.421 Pulled image for busybox:stable 2024-08-16T15:44:10.422 Pulled image for ddev/ddev-ssh-agent:v1.23.2 2024-08-16T15:44:10.423 Pulled image for ddev/ddev-traefik-router:v1.23.2 2024-08-16T15:44:10.685 GetDockerContext: contextInfo='default unix:///Users/jlampton/.docker/run/docker.sock' 2024-08-16T15:44:10.685 Using Docker context default (unix:///Users/jlampton/.docker/run/docker.sock) 2024-08-16T15:44:11.001 chowning /mnt/ddev-global-cache and /var/lib/mysql to 501 2024-08-16T15:44:11.304 done chowning /mnt/ddev-global-cache and /var/lib/mysql to 501 2024-08-16T15:44:11.312 host.docker.internal='' because no other case was discovered 2024-08-16T15:44:11.408 Pulled image for ddev/ddev-webserver:v1.23.2 2024-08-16T15:44:11.412 Pulled image for ddev/ddev-dbserver-mariadb-10.11:v1.23.2 2024-08-16T15:44:11.415 Pulled image for ddev/ddev-ssh-agent:v1.23.2 2024-08-16T15:44:11.418 Pulled image for ddev/ddev-traefik-router:v1.23.2 Building project images... 2024-08-16T15:44:11.42 Executing docker-compose -f /Users/jlampton/Sites/emerisa/tryddevproject-2594/.ddev/.ddev-docker-compose-full.yaml build --progress=plain .Project images built in 1s. 2024-08-16T15:44:12.423 Executing docker-compose -f /Users/jlampton/Sites/emerisa/tryddevproject-2594/.ddev/.ddev-docker-compose-full.yaml up -d Container ddev-tryddevproject-2594-db Recreate Container ddev-tryddevproject-2594-web Recreate Container ddev-tryddevproject-2594-db Recreated Container ddev-tryddevproject-2594-web Recreated Container ddev-tryddevproject-2594-db Started Container ddev-tryddevproject-2594-web Started 2024-08-16T15:44:23.096 VIRTUAL_HOST=tryddevproject-2594.ddev.site for web 2024-08-16T15:44:23.096 HTTP_EXPOSE=80:80,8025:8025 for web 2024-08-16T15:44:23.096 HTTPS_EXPOSE=443:80,8026:8025 for web 2024-08-16T15:44:23.471 Copied /Users/jlampton/Sites/emerisa/tryddevproject-2594/.ddev/traefik:CopyIntoVolume_vtqfrmvfpxlc into /mnt/v/traefik in 41.782916ms 2024-08-16T15:44:23.504 Exec chown -R 501 /mnt/v/traefik stdout=, stderr=, err= 2024-08-16T15:44:23.604 Copied Traefik certs in /Users/jlampton/Sites/emerisa/tryddevproject-2594/.ddev/traefik/certs to ddev-global-cache/traefik Starting Mutagen sync process... 2024-08-16T15:44:23.69 Using Mutagen config file /Users/jlampton/Sites/emerisa/tryddevproject-2594/.ddev/mutagen/mutagen.yml 2024-08-16T15:44:24.7 Mutagen status after sync: ok Mutagen sync flush completed in 1s. For details on sync status 'ddev mutagen st tryddevproject-2594 -l' 2024-08-16T15:44:24.701 Running /start.sh in ddev-webserver Waiting for containers to become ready: [web db] 2024-08-16T15:44:28.118 Copied /Users/jlampton/.ddev/commands:CopyIntoVolume_divtfqvvcrmx into /mnt/v/global-commands in 56.281125ms 2024-08-16T15:44:28.149 Exec chown -R 501 /mnt/v/global-commands stdout=, stderr=, err= 2024-08-16T15:44:28.358 Testing to see if /mnt/ddev_config is properly mounted Starting ddev-router if necessary... 2024-08-16T15:44:28.899 Copied /Users/jlampton/.ddev/traefik:CopyIntoVolume_olrqoxcfyntl into /mnt/v/traefik in 42.247292ms 2024-08-16T15:44:28.932 Exec chown -R 501 /mnt/v/traefik stdout=, stderr=, err= 2024-08-16T15:44:29.062 Copied global Traefik config in /Users/jlampton/.ddev/traefik/certs to ddev-global-cache/traefik Container ddev-router Running 2024-08-16T15:44:29.139 Waiting for ddev-router to become ready. docker inspect --format "{{json .State.Health }}" ddev-router 2024-08-16T15:44:29.644 ddev-router is ready Waiting for additional project containers to become ready... All project containers are now ready. Successfully started tryddevproject-2594 Project can be reached at https://tryddevproject-2594.ddev.site https://127.0.0.1:51744 ======== Curl of site from inside container ======== % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0HTTP/1.1 200 OK Server: nginx Date: Fri, 16 Aug 2024 22:44:31 GMT Content-Type: text/html; charset=UTF-8 Connection: keep-alive Vary: Accept-Encoding 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 ======== curl -I of http://127.0.0.1:51745 (web container http docker bind port) from outside ======== % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 HTTP/1.1 200 OK Server: nginx Date: Fri, 16 Aug 2024 22:44:31 GMT Content-Type: text/html; charset=UTF-8 Connection: keep-alive Vary: Accept-Encoding ======== curl -I of http://tryddevproject-2594.ddev.site (router http URL) from outside ======== % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 HTTP/1.1 200 OK Content-Type: text/html; charset=UTF-8 Date: Fri, 16 Aug 2024 22:44:31 GMT Server: nginx Vary: Accept-Encoding ======== Full curl of http://tryddevproject-2594.ddev.site (router http URL) from outside ======== % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 286 0 286 0 0 27595 0 --:--:-- --:--:-- --:--:-- 28600 Success accessing database... db via TCP/IP
ddev is working.
The output file for Discord or issue queue is in /var/folders/mw/_p1cl_rx69b3ll553w9cdvcc0000gn/T/ddev-debug-test.txt
file:///var/folders/mw/_p1cl_rx69b3ll553w9cdvcc0000gn/T/ddev-debug-test.txt
======== Full curl of https://tryddevproject-2594.ddev.site (router https URL) from outside ======== % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 286 0 286 0 0 7372 0 --:--:-- --:--:-- --:--:-- 7526 Success accessing database... db via TCP/IP
ddev is working.
The output file for Discord or issue queue is in /var/folders/mw/_p1cl_rx69b3ll553w9cdvcc0000gn/T/ddev-debug-test.txt
file:///var/folders/mw/_p1cl_rx69b3ll553w9cdvcc0000gn/T/ddev-debug-test.txt
======== Curl google.com to check internet access and VPN ======== % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 HTTP/2 200 content-type: text/html; charset=ISO-8859-1 content-security-policy-report-only: object-src 'none';base-uri 'self';script-src 'nonce-gBRv5JdobNrFbYLI_pg0Vg' 'strict-dynamic' 'report-sample' 'unsafe-eval' 'unsafe-inline' https: http:;report-uri https://csp.withgoogle.com/csp/gws/other-hp p3p: CP="This is not a P3P policy! See g.co/p3phelp for more info." date: Fri, 16 Aug 2024 22:44:32 GMT server: gws x-xss-protection: 0 x-frame-options: SAMEORIGIN expires: Fri, 16 Aug 2024 22:44:32 GMT cache-control: private set-cookie: AEC=AVYB7coT6uxBsyYsPrUpqZA5plkLcIqHckUZmEKTT4sA5gSu4JpF0mYVAA; expires=Wed, 12-Feb-2025 22:44:32 GMT; path=/; domain=.google.com; Secure; HttpOnly; SameSite=lax set-cookie: NID=516=Hx8SamERCt0FXowpZz51345fBY7_EuYZKBJ420k2EQlnAxpoYQ120JHrpGE7WhoJ8tFlm_nVXjyj7nJtzHCeYl_NZc52p6IUZ_hw7BV1K54ASAtXZ1JxOU9kzAeg-AfjkElL-gWrhhcqCz2HEZ9Kzna1d2XRlWPg41VcZQrDb2Xuj1Eplyv1; expires=Sat, 15-Feb-2025 22:44:32 GMT; path=/; domain=.google.com; HttpOnly alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 ======== host.docker.internal status ======== PING host.docker.internal (192.168.65.254) 56(84) bytes of data. 64 bytes from 192.168.65.254 (192.168.65.254): icmp_seq=1 ttl=63 time=0.229 ms --- host.docker.internal ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.229/0.229/0.229/0.000 ms ======== Project ownership on host ======== drwxr-xr-x 4 jlampton staff 128 Aug 16 15:43 ../tryddevproject-2594 ======== Project ownership in container ======== drwxr-xr-x 4 jlampton dialout 4096 Aug 16 22:43 //var/www/html ======== In-container filesystem ======== Filesystem Type 1K-blocks Used Available Use% Mounted on /dev/vda1 ext4 238062628 54532892 171404044 25% /var/www ======== Thanks for running the diagnostic! ======== ```

Expected Behavior

Setting the PHP memory_limit in ddev should result in that memory_limit being used by Drupal and drush.

Actual Behavior

Drupal and drush both seem to have the memory_limit hard-coded to 512M regardless of what is changed in ddev

Steps To Reproduce

Any of the following should result in a memory_limit change for Drupal and drush.

Anything else?

I'm trying to increase the PHP memory_limit to 1024M so that I can test a very large and complex feeds import. I'm getting an error indicating that my memory_limit is set to 512M regardless of what I change. I read that the default value for ddev was 1G. I'm guessing that there is something somewhere that is forcing this limit of 512M for Drupal and Drush, and I cannot find it it for the life of me.

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/docroot/modules/field/modules/field_sql_storage/field_sql_storage.module on line 438

I have tried to adjust the memory_limit in the following ways: 1) Added ini_set() in settings.php (this may be another issue) 2) Overwrote .user.ini 3) Added .ddev/php/memory_limit.ini 4) Added a post-start: hook into .ddev/conf.yaml as per https://github.com/ddev/ddev/issues/1825#issuecomment-529964728 5) tried ddev ssh and manually edited /etc/php/7.4/cli/php.ini

I have confirmed the following:

If Drupal is the problem, I thought I'd find something inside drupal, so...

From the command line I get:

ddev php -i | grep "memory_limit" memory_limit => -1 => -1

I expect this from attempt no 4

ddev drush php-eval 'print ini_get("memory_limit") . "\n";' 512M

Why is drush showing a different PHP memory_limit than php, and where on earth is this coming from?

jenlampton commented 3 weeks ago

I was thinking that maybe I could look at each bootstrap level to see where Drupal was changing the memory limit, so I added the following to line 2573 of bootstrap.inc to show me the boostrap phase what what the memory limit is set to at that phase:

print_r($phase . ': ' . ini_get('memory_limit') . '<br>');

On the status report page I see:

7: 1024M
3: 512M
2: 512M
7: 512M

7 is a full bootstrap 3 is database, and 2 is variables

This indicates that on the first full bootstrap the memory_limit is behaving how I expect, but as soon as the database is is bootstrapped it's back to 512M. What the heck? Then on the next full bootstrap it remains stunted. :/

On a clean install of core alone, also on the status report page I see only 3 values. So maybe the second full bootstrap only happens on my site with the problematic feed.

7: 1024M
3: 512M
2: 512M
rfay commented 3 weeks ago

memory_limit is set to 1G by default, see

image

To change it, you would use .ddev/php/*.ini. For example, a `.ddev/php/mem.ini with this:

[PHP]
memory_limit = 5G;

Results in this:

image

The docs explain how this works, https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/#custom-php-configuration-phpini

For shell commands, the memory_limit is set to unlimited (-1), which is common for Drupal CLI setups. You can lower that with a .ddev/web-build/Dockerfile.*, but I haven't heard of anybody doing it. It requires overriding the base config.

You're running out of memory because you're using Docker Desktop and you haven't allocated enough for your application, or your application is using too much.

image
rfay commented 3 weeks ago

I see that you said

Added .ddev/conf/php/memory_limit.ini

The correct location is .ddev/php/memory_limit.ini, not what you used.

jenlampton commented 3 weeks ago

You're running out of memory because you're using Docker Desktop and you haven't allocated enough for your application, or your application is using too much.

Is 8G not enough? I get the same result (only 512M available) regardless of how many other ddev projects are running.

Screenshot 2024-08-19 at 9 47 32 AM

The correct location is .ddev/php/memory_limit.ini, not what you used.

This is the location I used. (I have updated the original post)

As mentioned, these ini files are showing correctly in the list of "Additional .ini files parsed" in phpinfo(). (The screenshot below is from after I changed the file name to memlimit.ini to confirm it was my file being loaded and not another memory_limit.ini

Screenshot 2024-08-19 at 9 42 46 AM

The below is from phpinfo() in test.php:

Screenshot 2024-08-19 at 9 41 05 AM

But this is from inside Drupal:

Screenshot 2024-08-19 at 9 41 47 AM

So I have assumed the problem is with Drupal somehow, hence testing the memory_limit at different bootstrap levels.

jenlampton commented 3 weeks ago

I created a brand new ddev drupal 7 project (for another existing site, not a fresh install), and when I added the debug line to bootstrap.inc, I got:

7: 1024M
3: 1024M
2: 1024M

So the mystery decrease of memory_limit doesn't seem to affect all projects.

I did a ddev delete for original problem project, and when I did a new ddev config and ddev start I can all of a sudden see the changes I added to settings.php taking affect. (probably related to https://github.com/ddev/ddev/issues/6491?)

7: 1024M
3: 256M
2: 256M

So, perhaps I have a work-around! I would like to figure out where the original 512M limit was coming from, and why it can only be changed with a ddev delete though.

rfay commented 3 weeks ago

Is 8G not enough? I get the same result (only 512M available) regardless of how many other ddev projects are running.

I think you should be fine with 8G, although it's conceivable that you're running a lot of projects at once.

But it seems like you're onto whatever was going on. Something else is changing the limit... and DDEV doesn't change it, so I guess something in PHP is changing it.

You can test this pretty easily with a phpinfo.php to see what DDEV is giving you. Just add this phpinfo.php to your docroot and execute it.

<?php
phpinfo();

You'll see this by default, (not 512 anything)

image
rfay commented 1 week ago

As demonstrated, you certainly can have a high memory_limit. Something about your Drupal project must be lowering it. Closing this, happy to continue the conversation here or elsewhere.

As above, use a trivial phpinfo() to explore this, so it's not dependent on your Drupal code or configuration.

jenlampton commented 1 week ago

As a wrap up for my future self....

I would like to figure out where the original 512M limit was coming from

I never did figure out where the original Drupal change was coming from. But I was able to override it via settings.php after a ddev delete -- and I think that was related to https://github.com/ddev/ddev/issues/6491.

My ddev overrides were working, but since Drupal overwrote memory_limit (somehow) I needed to override Drupal's override via ini_set() in settings.php. Now that that is working (thanks to ddev mutagen reset -- I've used this several times recently with settings.php changes for Drupal 7) I was able to successfully increase the memory limit.

I decided not to spend any more time on the Drupal mystery since I'm trying to get this site off Drupal 7 anyway :D

Thanks @rfay for the help and for cleaning up the issues after me. I'll try to summarize and close the next one before you ge to it.