Repository: ddev/ddev (go)

Issue:
Drag and drop to windows terminal in WSL2 does not work for `ddev import-db` or `ddev import-files`
### Preliminary checklist

- [x] I am using the latest stable version of DDEV (see [upgrade guide](https://ddev.readthedocs.io/en/stable/users/install/ddev-upgrade/))
- [x] I have searched [existing issues](https://github.com/ddev/ddev/issues)
- [x] I have checked the [troubleshooting guide](https://ddev.readthedocs.io/en/stable/users/usage/troubleshooting/)
- [x] I have run `ddev debug test` to include output below

### Output of `ddev debug test`

<details><summary>Expand `ddev debug test` diagnostic information</summary>

```
======== Output file will be in /tmp/ddev-debug-test.txt ========


======== Existing project config ========
ddev installation alternate locations:
/usr/bin/ddev
/bin/ddev

These config files were loaded for project projectname: [/home/username/projects/projectname-websites/.ddev/config.yaml]
name: projectname
type: drupal9
docroot: web
php_version: 8.1
webserver_type: nginx-fpm
webimage: ddev/ddev-webserver:v1.24.2
router_http_port: 80
router_https_port: 443
additional_hostnames: [bonap buurtslagers]
database: {mysql 8.0}
hooks: map[post-start:[map[exec:mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS buurtslagers; GRANT ALL ON buurtslagers.* to 'db'@'%';" service:db] map[exec:mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS bonap; GRANT ALL ON bonap.* to 'db'@'%';" service:db] map[exec-host:(ddev drush @default.local status 2>&1 | grep -q Successful) || ddev @default.local install]] pre-start:[map[exec-host:cali check-version]]]
omit_containers: [dba]
host_db_port: 49033
webimage_extra_packages: [python3 python-is-python3 build-essential]
project_tld: ddev.site
use_dns_when_possible: true
composer_version: 2
disable_settings_management: true
nodejs_version: 22
default_container_timeout: 120


======== existing project customizations ========
.ddev/docker-compose.redis.yaml
.ddev/php/xdebug_port.ini


======== installed DDEV add-ons ========
No registered add-ons were found.


======== mutagen situation ========
looking for #ddev-generated in mutagen.yml in project /home/username/projects/projectname-websites
.ddev/mutagen/mutagen.yml not found


======== Creating dummy project named tryddevproject-5373 in ../tryddevproject-5373 ========
Creating a new DDEV project config in the current directory (/home/username/projects/tryddevproject-5373)
Once completed, your configuration will be written to /home/username/projects/tryddevproject-5373/.ddev/config.yaml

Created docroot directory at /home/username/projects/tryddevproject-5373/web
Configuring a 'php' project named 'tryddevproject-5373' with docroot 'web' at '/home/username/projects/tryddevproject-5373/web'.
For full details use 'ddev describe'.
Configuration complete. You may now run 'ddev start'.


======== OS Information ========
Linux Laptop-username 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux


======== User information ========
uid=1000(username) gid=1000(username) groups=1000(username),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),117(netdev),1001(docker)


======== DDEV version ========
 ITEM             VALUE
 DDEV version     v1.24.2
 architecture     amd64
 cgo_enabled      0
 db               ddev/ddev-dbserver-mariadb-10.11:v1.24.2
 ddev-ssh-agent   ddev/ddev-ssh-agent:v1.24.2
 docker           27.5.0
 docker-api       1.47
 docker-compose   v2.32.4
 docker-platform  wsl2-docker-ce
 global-ddev-dir  /home/username/.ddev
 mutagen          0.18.0
 os               linux
 router           ddev/ddev-traefik-router:v1.24.2
 web              ddev/ddev-webserver:v1.24.2



======== proxy settings ========

 HTTP_PROXY=''
 HTTPS_PROXY=''
 http_proxy=''
 NO_PROXY=''



======== DDEV global info ========
developer-mode=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.24.2
letsencrypt-email=
mailpit-http-port=8025
mailpit-https-port=8026
mkcert-caroot=/mnt/c/Users/ username/AppData/Local/mkcert
no-bind-mounts=false
omit-containers=[]
performance-mode=none
project-tld=ddev.site
required-docker-compose-version=v2.32.4
router-bind-all-interfaces=false
router-http-port=80
router-https-port=443
simple-formatting=false
table-style=default
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: -rwxr-xr-x 1 root root 41821136 Jan 13 16:25 /usr/bin/docker

docker client alternate locations:
/usr/bin/docker
/bin/docker

Docker provider: wsl2-docker-ce
docker version:
Client: Docker Engine - Community
 Version:           27.5.0
 API version:       1.47
 Go version:        go1.22.10
 Git commit:        a187fa5
 Built:             Mon Jan 13 15:25:19 2025
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          27.5.0
  API version:      1.47 (minimum version 1.24)
  Go version:       go1.22.10
  Git commit:       38b84dc
  Built:            Mon Jan 13 15:25:19 2025
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.25
  GitCommit:        bcc810d6b9066471b0b6fa75f557a15a1cbf31bb
 runc:
  Version:          1.2.4
  GitCommit:        v1.2.4-0-g6c52b3f
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

DOCKER_DEFAULT_PLATFORM=notset
Docker platform: wsl2-docker-ce
Using Docker context: default (unix:///var/run/docker.sock)
docker-compose: v2.32.4
Using DOCKER_HOST=unix:///var/run/docker.sock
Docker version: 27.5.0
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                1006.9G    267.8G    687.9G  28% /


======== Existing docker containers ========
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES


======== mkcert information ========
/usr/bin/mkcert
/bin/mkcert
CAROOT=/mnt/c/Users/ username/AppData/Local/mkcert WSLENV=WT_SESSION:WT_PROFILE_ID:CAROOT/up: JAVA_HOME=
/mnt/c/Users/ username/AppData/Local/mkcert
total 8
-r-xr-xr-x 1 username username 2484 Jan  4  2023 rootCA-key.pem
-rwxrwxrwx 1 username username 1777 Jan  4  2023 rootCA.pem


======== ping attempt on ddev.site ========
PING dkdkd.ddev.site (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.075 ms

--- dkdkd.ddev.site ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.075/0.075/0.075/0.000 ms


======== curl information ========
/usr/bin/curl
/bin/curl


======== ddev debug rebuild ========
Rebuilding project images...
Rebuilding project tryddevproject-5373 with `/home/username/.ddev/bin/docker-compose -f /home/username/projects/tryddevproject-5373/.ddev/.ddev-docker-compose-full.yaml --progress plain build web --no-cache`
#0 building with "default" instance using docker driver

#1 [web internal] load build definition from Dockerfile
#1 transferring dockerfile: 1.54kB done
#1 DONE 0.1s

#2 [web internal] load metadata for docker.io/ddev/ddev-webserver:v1.24.2
#2 DONE 0.0s

#3 [web internal] load .dockerignore
#3 transferring context: 2B done
#3 DONE 0.0s

#4 [web  1/10] FROM docker.io/ddev/ddev-webserver:v1.24.2
#4 CACHED

#5 [web  2/10] RUN getent group tty || groupadd tty
#5 0.257 tty:x:5:
#5 DONE 0.3s

#6 [web  3/10] RUN (groupadd --gid 1000 "username" || groupadd "username" || true) && (useradd -G tty -l -m -s "/bin/bash" --gid "username" --comment '' --uid 1000 "username" || useradd -G tty -l -m -s "/bin/bash" --gid "username" --comment '' "username" || useradd  -G tty -l -m -s "/bin/bash" --gid "1000" --comment '' "username" || useradd -G tty -l -m -s "/bin/bash" --comment '' username )
#6 DONE 0.5s

#7 [web  4/10] RUN mkdir -p /home/username && chown username /home/username && chmod 600 /home/username/.pgpass
#7 DONE 0.4s

#8 [web  5/10] RUN START_SCRIPT_TIMEOUT=30 mariadb-client-install.sh || true
#8 0.417 This script is not intended to run with mariadb:10.11
#8 DONE 0.5s

#9 [web  6/10] RUN export XDEBUG_MODE=off; composer self-update --stable || composer self-update --stable || true; composer self-update --2 || log-stderr.sh composer self-update --2 || true
#9 0.731 Storing "stable" as default update channel for the next self-update run.
#9 0.788 Upgrading to version 2.8.5 (stable channel).
#9 0.798
#9 1.047 Use composer self-update --rollback to return to version 2.8.4
#9 1.192 You are already using the latest available Composer version 2.8.5 (2.x channel).
#9 DONE 1.2s

#10 [web  7/10] RUN timeout 30 apt-get update || true
#10 0.446 Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
#10 0.450 Get:2 http://nginx.org/packages/debian bookworm InRelease [2869 B]
#10 0.513 Get:3 http://nginx.org/packages/debian bookworm/nginx amd64 Packages [15.7 kB]
#10 0.518 Get:4 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
#10 0.547 Get:6 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
#10 0.565 Get:7 http://deb.debian.org/debian bookworm/main amd64 Packages [8792 kB]
#10 0.711 Get:8 https://packages.sury.org/php bookworm InRelease [7551 B]
#10 0.727 Get:9 https://dl.cloudsmith.io/public/platformsh/cli/deb/debian bookworm InRelease [3675 B]
#10 0.822 Get:5 https://dlm.mariadb.com/repo/mariadb-server/10.11/repo/debian bookworm InRelease [4625 B]
#10 0.830 Get:10 https://packages.sury.org/php bookworm/main amd64 Packages [255 kB]
#10 1.048 Get:11 https://dl.cloudsmith.io/public/platformsh/upsun-cli/deb/debian bookworm InRelease [3681 B]
#10 1.156 Get:12 https://apt.postgresql.org/pub/repos/apt bookworm-pgdg InRelease [129 kB]
#10 1.224 Get:13 https://dl.cloudsmith.io/public/symfony/stable/deb/debian bookworm InRelease [4422 B]
#10 1.454 Get:15 https://dl.cloudsmith.io/public/platformsh/cli/deb/debian bookworm/main amd64 Packages [4504 B]
#10 1.469 Get:16 https://apt.postgresql.org/pub/repos/apt bookworm-pgdg/main amd64 Packages [360 kB]
#10 1.542 Get:14 https://dlm.mariadb.com/repo/mariadb-server/10.11/repo/debian bookworm/main amd64 Packages [41.2 kB]
#10 1.549 Get:17 https://dl.cloudsmith.io/public/platformsh/upsun-cli/deb/debian bookworm/main amd64 Packages [3347 B]
#10 1.589 Get:18 https://dl.cloudsmith.io/public/symfony/stable/deb/debian bookworm/main amd64 Packages [8057 B]
#10 2.024 Get:19 https://dlm.mariadb.com/repo/mariadb-server/10.11/repo/debian bookworm/main arm64 Packages [34.5 kB]
#10 2.442 Get:20 http://deb.debian.org/debian bookworm-updates/main amd64 Packages [13.5 kB]
#10 2.444 Get:21 http://deb.debian.org/debian-security bookworm-security/main amd64 Packages [242 kB]
#10 3.088 Fetched 10.2 MB in 3s (3773 kB/s)
#10 3.088 Reading package lists...
#10 DONE 3.5s

#11 [web  8/10] RUN curl -I https://www.google.com
#11 0.395   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
#11 0.395                                  Dload  Upload   Total   Spent    Left  Speed
#11 0.395
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
#11 0.437 HTTP/2 200
#11 0.437 content-type: text/html; charset=ISO-8859-1
#11 0.437 content-security-policy-report-only: object-src 'none';base-uri 'self';script-src 'nonce-APY6Eveegxs_gm7l7DXkEg' 'strict-dynamic' 'report-sample' 'unsafe-eval' 'unsafe-inline' https: http:;report-uri https://csp.withgoogle.com/csp/gws/other-hp
#11 0.437 accept-ch: Sec-CH-Prefers-Color-Scheme
#11 0.437 p3p: CP="This is not a P3P policy! See g.co/p3phelp for more info."
#11 0.437 date: Mon, 27 Jan 2025 12:52:20 GMT
#11 0.437 server: gws
#11 0.437 x-xss-protection: 0
#11 0.437 x-frame-options: SAMEORIGIN
#11 0.437 expires: Mon, 27 Jan 2025 12:52:20 GMT
#11 0.437 cache-control: private
#11 0.437 set-cookie: AEC=AZ6Zc-WcESvuF96RR7Pl9tlW7OmR-A5-_YcgSMPiheWpGl2EE4jA7HzC1HM; expires=Sat, 26-Jul-2025 12:52:20 GMT; path=/; domain=.google.com; Secure; HttpOnly; SameSite=lax
#11 0.437 set-cookie: __Secure-ENID=25.SE=UG52QJ44LpsRcDY6VCkeFiCgbpHa_HkX8GPFvHQXrtyRaM3hp1keLEEfFEtXrc6V87s3UwbczFWbeCMzt83j6L5_Xab4xhO1IsTnuF-ZlXgYck1PfiwdOYW_xnHFn6CfGWbrjMn6D94a2bxUVvXyAAM56bEDN49Vq9uity5a-pr5AOEancP70uUOHdozsqAhmLvs4I3NjaPBnll8JTAG5_o0giGeH77NXHjnRHywZR9Uq2N0og; expires=Fri, 27-Feb-2026 05:10:38 GMT; path=/; domain=.google.com; Secure; HttpOnly; SameSite=lax
#11 0.437 alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
#11 0.437
#11 DONE 0.5s

#12 [web  9/10] RUN chmod 777 /run/php /var/log
#12 DONE 0.3s

#13 [web 10/10] RUN mkdir -p /tmp/xhprof && chmod -R ugo+w /etc/php /var/lib/php /tmp/xhprof
#13 DONE 2.0s

#14 [web] exporting to image
#14 exporting layers
#14 exporting layers 0.3s done
#14 writing image sha256:730b5bef9018880397395779fe1e5c3e611eb1d69d669fbcf74a50952ccf65ac done
#14 naming to docker.io/ddev/ddev-webserver:v1.24.2-tryddevproject-5373-built 0.0s done
#14 DONE 0.4s

#15 [web] resolving provenance for metadata file
#15 DONE 0.0s
 web  Built
Rebuilt Docker cache for project tryddevproject-5373 in 10s
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.
Using custom web-build configuration: [
	/home/username/projects/tryddevproject-5373/.ddev/web-build/Dockerfile.test
]
Custom configuration is updated on restart.
If you don't see your custom configuration taking effect, run 'ddev restart'.
v1.24.2: Pulling from ddev/ddev-dbserver-mariadb-10.11
6414378b6477: Already exists
95fcb1e2388c: Already exists
c31c961068dd: Already exists
a67827fd8887: Already exists
7e99aaa10ae0: Already exists
a670857f0fb2: Already exists
0aca29d0b893: Already exists
b2f01a3c4e4c: Already exists
4f4fb700ef54: Already exists
4f4fb700ef54: Already exists
4f4fb700ef54: Already exists
473b04f41e48: Pulling fs layer
5ddc303df6ff: Pulling fs layer
78ff44ddbfcf: Pulling fs layer
e8d358a75ef9: Pulling fs layer
4f4fb700ef54: Pulling fs layer
0221c1017b07: Pulling fs layer
65279a4671e9: Pulling fs layer
a78096b8af42: Pulling fs layer
86adac252d41: Pulling fs layer
556ae11a243f: Pulling fs layer
b1477fe48499: Pulling fs layer
c2d84b110b92: Pulling fs layer
94eef44561a8: Pulling fs layer
2f1a72eb95a3: Pulling fs layer
797f5f689d3d: Pulling fs layer
35145d62010c: Pulling fs layer
54180824505a: Pulling fs layer
020d2646e12a: Pulling fs layer
73b64a0da268: Pulling fs layer
e8d358a75ef9: Waiting
86adac252d41: Waiting
4f4fb700ef54: Waiting
0221c1017b07: Waiting
556ae11a243f: Waiting
65279a4671e9: Waiting
797f5f689d3d: Waiting
a78096b8af42: Waiting
b1477fe48499: Waiting
c2d84b110b92: Waiting
35145d62010c: Waiting
94eef44561a8: Waiting
2f1a72eb95a3: Waiting
54180824505a: Waiting
020d2646e12a: Waiting
73b64a0da268: Waiting
473b04f41e48: Download complete
5ddc303df6ff: Verifying Checksum
5ddc303df6ff: Download complete
473b04f41e48: Pull complete
5ddc303df6ff: Pull complete
4f4fb700ef54: Verifying Checksum
4f4fb700ef54: Download complete
e8d358a75ef9: Verifying Checksum
e8d358a75ef9: Download complete
0221c1017b07: Verifying Checksum
0221c1017b07: Download complete
65279a4671e9: Verifying Checksum
65279a4671e9: Download complete
a78096b8af42: Verifying Checksum
a78096b8af42: Download complete
86adac252d41: Verifying Checksum
86adac252d41: Download complete
556ae11a243f: Verifying Checksum
556ae11a243f: Download complete
c2d84b110b92: Verifying Checksum
c2d84b110b92: Download complete
94eef44561a8: Verifying Checksum
94eef44561a8: Download complete
b1477fe48499: Verifying Checksum
b1477fe48499: Download complete
2f1a72eb95a3: Verifying Checksum
2f1a72eb95a3: Download complete
78ff44ddbfcf: Verifying Checksum
78ff44ddbfcf: Download complete
797f5f689d3d: Download complete
35145d62010c: Verifying Checksum
35145d62010c: Download complete
020d2646e12a: Verifying Checksum
020d2646e12a: Download complete
78ff44ddbfcf: Pull complete
e8d358a75ef9: Pull complete
4f4fb700ef54: Pull complete
0221c1017b07: Pull complete
65279a4671e9: Pull complete
a78096b8af42: Pull complete
86adac252d41: Pull complete
556ae11a243f: Pull complete
b1477fe48499: Pull complete
c2d84b110b92: Pull complete
94eef44561a8: Pull complete
2f1a72eb95a3: Pull complete
797f5f689d3d: Pull complete
35145d62010c: Pull complete
54180824505a: Verifying Checksum
54180824505a: Download complete
54180824505a: Pull complete
020d2646e12a: Pull complete
73b64a0da268: Download complete
73b64a0da268: Pull complete
Digest: sha256:a467302d35823140d458b1697b19bea59884edb3931c06e3f0369d6284246871
Status: Downloaded newer image for ddev/ddev-dbserver-mariadb-10.11:v1.24.2
docker.io/ddev/ddev-dbserver-mariadb-10.11:v1.24.2
Building project images......
Project images built in 4s.
 Network ddev-tryddevproject-5373_default  Created
 Container ddev-tryddevproject-5373-web  Created
 Container ddev-tryddevproject-5373-db  Created
 Container ddev-tryddevproject-5373-web  Started
 Container ddev-tryddevproject-5373-db  Started
Waiting for containers to become ready: [web db]
Starting ddev-router if necessary...
 Container ddev-router  Created
 Container ddev-router  Started


======== Project startup ========
Starting tryddevproject-5373...
2025-01-27T13:52:50.22 GetAvailableRouterPort(): Router is healthy and running
2025-01-27T13:52:50.221 GetAvailableRouterPort(): proposedPort 80 already bound on ddev-router, accepting it
2025-01-27T13:52:50.223 GetAvailableRouterPort(): Router is healthy and running
2025-01-27T13:52:50.224 GetAvailableRouterPort(): proposedPort 443 already bound on ddev-router, accepting it
2025-01-27T13:52:50.225 GetAvailableRouterPort(): Router is healthy and running
2025-01-27T13:52:50.225 GetAvailableRouterPort(): proposedPort 8025 already bound on ddev-router, accepting it
2025-01-27T13:52:50.227 GetAvailableRouterPort(): Router is healthy and running
2025-01-27T13:52:50.227 GetAvailableRouterPort(): proposedPort 8026 already bound on ddev-router, accepting it
2025-01-27T13:52:50.245 Pulled image for ddev/ddev-webserver:v1.24.2
2025-01-27T13:52:50.246 Pulled image for busybox:stable
2025-01-27T13:52:50.246 Pulled image for ddev/ddev-utilities
2025-01-27T13:52:50.246 Pulled image for ddev/ddev-ssh-agent:v1.24.2
2025-01-27T13:52:50.247 Pulled image for ddev/ddev-traefik-router:v1.24.2
2025-01-27T13:52:51.523 chowning /mnt/ddev-global-cache and /var/lib/mysql to 1000
2025-01-27T13:52:52.767 done chowning /mnt/ddev-global-cache and /var/lib/mysql to 1000
Using custom web-build configuration: [
	/home/username/projects/tryddevproject-5373/.ddev/web-build/Dockerfile.test
]
Custom configuration is updated on restart.
If you don't see your custom configuration taking effect, run 'ddev restart'.
2025-01-27T13:52:52.781 host.docker.internal='172.22.208.1' because IsWSL2 and !IsDockerDesktop; received from ip -4 route show default
2025-01-27T13:52:52.793 Using automatically detected timezone: TZ=Europe/Brussels
2025-01-27T13:52:52.827 Pulled image for ddev/ddev-dbserver-mariadb-10.11:v1.24.2
2025-01-27T13:52:52.827 Pulled image for ddev/ddev-webserver:v1.24.2
2025-01-27T13:52:52.828 Pulled image for ddev/ddev-traefik-router:v1.24.2
2025-01-27T13:52:52.828 Pulled image for ddev/ddev-ssh-agent:v1.24.2
Building project images...
2025-01-27T13:52:52.835 Executing docker-compose -f /home/username/projects/tryddevproject-5373/.ddev/.ddev-docker-compose-full.yaml build --progress=plain
.
Project images built in 2s.
2025-01-27T13:52:54.457 Removing dangling images for the project ddev-tryddevproject-5373
2025-01-27T13:52:54.463 Executing docker-compose -f /home/username/projects/tryddevproject-5373/.ddev/.ddev-docker-compose-full.yaml up -d
 Container ddev-tryddevproject-5373-db  Recreate
 Container ddev-tryddevproject-5373-web  Recreate
 Container ddev-tryddevproject-5373-db  Recreated
 Container ddev-tryddevproject-5373-web  Recreated
 Container ddev-tryddevproject-5373-db  Started
 Container ddev-tryddevproject-5373-web  Started
2025-01-27T13:53:06.024 VIRTUAL_HOST=tryddevproject-5373.ddev.site for web
2025-01-27T13:53:06.024 HTTP_EXPOSE=80:80,8025:8025 for web
2025-01-27T13:53:06.024 HTTPS_EXPOSE=443:80,8026:8025 for web
2025-01-27T13:53:06.615 Copied /home/username/projects/tryddevproject-5373/.ddev/traefik:CopyIntoVolume_nhvsnntahltd into /mnt/v/traefik in 33.258197ms
2025-01-27T13:53:06.644 Exec chown -R 1000 /mnt/v/traefik stdout=, stderr=, err=<nil>
2025-01-27T13:53:06.999 Copied Traefik certs in /home/username/projects/tryddevproject-5373/.ddev/traefik/certs to ddev-global-cache/traefik
2025-01-27T13:53:06.999 Running /start.sh in ddev-webserver
Waiting for containers to become ready: [web db]
2025-01-27T13:53:11.524 Copied /home/username/.ddev/commands:CopyIntoVolume_jrpfrbfqzakx into /mnt/v/global-commands in 32.798888ms
2025-01-27T13:53:11.553 Exec chown -R 1000 /mnt/v/global-commands stdout=, stderr=, err=<nil>
2025-01-27T13:53:11.921 Testing to see if /mnt/ddev_config is properly mounted
2025-01-27T13:53:11.997 Getting stderr output from 'log-stderr.sh --show'
Starting ddev-router if necessary...
2025-01-27T13:53:12.661 Copied /home/username/.ddev/traefik:CopyIntoVolume_bncyouutxdex into /mnt/v/traefik in 30.093127ms
2025-01-27T13:53:12.687 Exec chown -R 1000 /mnt/v/traefik stdout=, stderr=, err=<nil>
2025-01-27T13:53:13.015 Copied global Traefik config in /home/username/.ddev/traefik/certs to ddev-global-cache/traefik
 Container ddev-router  Running
2025-01-27T13:53:13.045 Waiting for ddev-router to become ready, timeout=60
2025-01-27T13:53:13.548 ddev-router is ready
Successfully started tryddevproject-5373
Your project can be reached at https://tryddevproject-5373.ddev.site
See 'ddev describe' for alternate URLs.


======== 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: Mon, 27 Jan 2025 12:53:16 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:32775 (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: Mon, 27 Jan 2025 12:53:16 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Vary: Accept-Encoding



======== curl -I of http://tryddevproject-5373.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: Mon, 27 Jan 2025 12:53:16 GMT
Server: nginx
Vary: Accept-Encoding



======== Full curl of http://tryddevproject-5373.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   198    0   198    0     0  24750      0 --:--:-- --:--:-- --:--:-- 24750
Success accessing database... db via TCP/IP<br />
ddev is working.<br />
The output file for Discord or issue queue is in
<b>/tmp/ddev-debug-test.txt</b><br />
file:///tmp/ddev-debug-test.txt<br />


======== Full curl of https://tryddevproject-5373.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   198    0   198    0     0  10421      0 --:--:-- --:--:-- --:--:-- 10421
Success accessing database... db via TCP/IP<br />
ddev is working.<br />
The output file for Discord or issue queue is in
<b>/tmp/ddev-debug-test.txt</b><br />
file:///tmp/ddev-debug-test.txt<br />


======== 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-Rbw3RAuLKgcxgcu08JvZ5A' 'strict-dynamic' 'report-sample' 'unsafe-eval' 'unsafe-inline' https: http:;report-uri https://csp.withgoogle.com/csp/gws/other-hp
accept-ch: Sec-CH-Prefers-Color-Scheme
p3p: CP="This is not a P3P policy! See g.co/p3phelp for more info."
date: Mon, 27 Jan 2025 12:53:49 GMT
server: gws
x-xss-protection: 0
x-frame-options: SAMEORIGIN
expires: Mon, 27 Jan 2025 12:53:49 GMT
cache-control: private
set-cookie: AEC=AZ6Zc-UBu4oz2QfHbDuKTIoXJhs6DwqxVg8X1ltn_FnC3p7nSpc3GQAq2f8; expires=Sat, 26-Jul-2025 12:53:49 GMT; path=/; domain=.google.com; Secure; HttpOnly; SameSite=lax
set-cookie: __Secure-ENID=25.SE=S6EDt4nxpZm1-IrGl1S0-GaBF6i5QVmOy3EjoJqlpTzd_qBLGm2OEayVneYB95pc9IGJfuND5Wu5Vtj8n7_MJLErAM5yDZSk8VssEQSKV0LAO7FBuSx_ZvJTNn8oLhh4WIjFYMzMcswIHcW382_bEXFDO69yOrl-rodnQe7X8O9nosAVQwVqJvvm367r4rXEnnOkQ27CdfzjQEiGSZ2IPaFyFMpGgYBSm2Aey7p0tgzvTjeh; expires=Fri, 27-Feb-2026 05:12:07 GMT; path=/; domain=.google.com; Secure; HttpOnly; SameSite=lax
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000



======== host.docker.internal status ========
PING host.docker.internal (172.22.208.1) 56(84) bytes of data.

--- host.docker.internal ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

Failed to execute command ping -c 1 host.docker.internal: exit status 1


======== Project ownership on host ========
drwxr-xr-x 4 username username 4096 Jan 27 13:51 ../tryddevproject-5373


======== Project ownership in container ========
drwxr-xr-x 4 username username 4096 Jan 27 13:51 //var/www/html


======== In-container filesystem ========
Filesystem     Type  1K-blocks      Used Available Use% Mounted on
/dev/sdc       ext4 1055762868 281100340 720959056  29% /var/www/html


======== Thanks for running the diagnostic! ========
Running ddev launch in 3 seconds
Running ddev launch
Waiting for ddev launch to complete before deleting project


Cleanup: deleting test project tryddevproject-5373
 Container ddev-tryddevproject-5373-db  Stopped
 Container ddev-tryddevproject-5373-web  Stopped
 Container ddev-tryddevproject-5373-web  Stopped
 Container ddev-tryddevproject-5373-db  Stopped
 Container ddev-tryddevproject-5373-db  Removed
 Container ddev-tryddevproject-5373-web  Removed
 Network ddev-tryddevproject-5373_default  Removed
Volume tryddevproject-5373-mariadb for project tryddevproject-5373 was deleted
Volume tryddevproject-5373-postgres for project tryddevproject-5373 was deleted
Volume tryddevproject-5373_project_mutagen for project tryddevproject-5373 was deleted
Project tryddevproject-5373 was deleted. Your code and configuration are unchanged.

Please remove the files from this test with 'rm -r ../tryddevproject-5373'

```
</details>


### Expected Behavior

Database should import when pasting path to the file by drag and dropping it in a WSL2 windows terminal screen. 

```
» ddev import-db
Provide the path to the database you want to import.
Path to file: '/my/mounted/path/to/db/file'
```

### Actual Behavior

An error occurs because the path cannot be resolved.

```
Error: failed to import database 'db' for projectname: unable to validate import asset '/my/mounted/path/to/db/file': invalid asset: file not found
```

### Steps To Reproduce

1. run `ddev import-db`

2. Drag and drop file from windows environment into windows terminal WSL2 screen

3. Observe the error message

### Anything else?

Windows terminal provides a way to drag and drop files into the terminal which then gets translated into the correct WSL2 path, using single quotes around the path to make sure this will work (pretty much) everywhere.

The only place this does not work for me is when running `ddev import-db` in this specific way.
Dragging and dropping the file path into the parameter version of this function does work: 
`ddev import-db -f '/my/mounted/path/to/db/file'`

I could trace this back to https://github.com/ddev/ddev/blob/76352fe2ebbf45ecd28931143d6189cdfbd1ddf8/pkg/appimport/appimport.go#L17 
by reading the code but cannot figure out what can be done about this.

Pull request description:
fix: trim single quotes, double quotes, and spaces from filepath input, fixes #6938
## The Issue

- #6938

## How This PR Solves The Issue

Trims single quotes, double quotes, and spaces from user input where filepath is required.

## Manual Testing Instructions

Before
```
$ ddev import-db
Provide the path to the database you want to import. 
Path to file: 'db.sql.gz'
Error: failed to import database 'db' for php-2023: unable to validate import asset 'db.sql.gz': invalid asset: file not found
```

After:
```
$ ddev import-db
Provide the path to the database you want to import. 
Path to file: 'db.sql.gz'
1.22KiB 0:00:00 [19.2MiB/s] [================================>] 100%            
Successfully imported database 'db' for d11
```

Repeat the same with double quotes.

Before
```
$ ddev import-files
Provide the path to the source directory or archive you wish to import. 
Please note: if the destination directory exists, it will be emptied and replaced with the
import assets specified here.
Path to file(s): 'modules'
Error: failed to import files for d11: invalid asset: file not found
```

After:
```
$ ddev import-files
Provide the path to the source directory or archive you wish to import. 
Please note: if the destination directory exists, it will be emptied and replaced with the
import assets specified here.
Path to file(s): 'modules'
Successfully imported files for d11
```

Repeat the same with double quotes.

## Automated Testing Overview

<!-- Please describe the tests introduced by this PR, or explain why no tests are needed. -->

## Release/Deployment Notes

<!-- Does this affect anything else or have ramifications for other code? Does anything have to be done on deployment? -->


Patch:
diff --git a/cmd/ddev/cmd/import-files.go b/cmd/ddev/cmd/import-files.go
index ea45b256c..505454174 100644
--- a/cmd/ddev/cmd/import-files.go
+++ b/cmd/ddev/cmd/import-files.go
@@ -133,7 +133,7 @@ func promptForFileSource(val *string) {
 	// prompting until something is entered
 	for {
 		fmt.Print("Path to file(s): ")
-		*val = util.GetInput("")
+		*val = util.GetQuotedInput("")
 		if len(*val) > 0 {
 			break
 		}
@@ -150,7 +150,7 @@ func promptForExtractPath(val *string) {
 	// An empty string is acceptable in this case, indicating
 	// no particular extraction path
 	fmt.Print("Archive extraction path: ")
-	*val = util.GetInput("")
+	*val = util.GetQuotedInput("")
 }
 
 func init() {
diff --git a/pkg/ddevapp/ddevapp.go b/pkg/ddevapp/ddevapp.go
index 7f43bd8b5..a2256c050 100644
--- a/pkg/ddevapp/ddevapp.go
+++ b/pkg/ddevapp/ddevapp.go
@@ -736,7 +736,7 @@ func (app *DdevApp) ImportDB(dumpFile string, extractPath string, progress bool,
 		output.UserOut.Println("Provide the path to the database you want to import.")
 		fmt.Print("Path to file: ")
 
-		dumpFile = util.GetInput("")
+		dumpFile = util.GetQuotedInput("")
 	}
 
 	if dumpFile != "" {
@@ -746,7 +746,7 @@ func (app *DdevApp) ImportDB(dumpFile string, extractPath string, progress bool,
 				output.UserOut.Println("You provided an archive. Do you want to extract from a specific path in your archive? You may leave this blank if you wish to use the full archive contents")
 				fmt.Print("Archive extraction path:")
 
-				extractPath = util.GetInput("")
+				extractPath = util.GetQuotedInput("")
 			} else {
 				return fmt.Errorf("unable to validate import asset %s: %s", dumpFile, err)
 			}
diff --git a/pkg/util/prompt.go b/pkg/util/prompt.go
index 6fbf6dfd6..93367136f 100644
--- a/pkg/util/prompt.go
+++ b/pkg/util/prompt.go
@@ -28,6 +28,19 @@ func GetInput(defaultValue string) string {
 	return value
 }
 
+// GetQuotedInput reads input from an input buffer in single or double quotes and returns the result as a string.
+func GetQuotedInput(defaultValue string) string {
+	input := GetInput(defaultValue)
+
+	// If the value from the input buffer is blank, then use the default instead.
+	value := strings.Trim(input, `"' `)
+	if value == "" {
+		value = defaultValue
+	}
+
+	return value
+}
+
 // Prompt gets input with a prompt and returns the input
 func Prompt(prompt string, defaultValue string) string {
 	fullPrompt := fmt.Sprintf("%s (%s)", prompt, defaultValue)


Test patch:
diff --git a/pkg/util/utils_test.go b/pkg/util/utils_test.go
index a36a93023..308663198 100644
--- a/pkg/util/utils_test.go
+++ b/pkg/util/utils_test.go
@@ -63,6 +63,32 @@ func TestGetInput(t *testing.T) {
 	println() // Just lets goland find the PASS or FAIL
 }
 
+// TestGetQuotedInput tests GetQuotedInput
+func TestGetQuotedInput(t *testing.T) {
+	testCases := []struct {
+		description string
+		input       string
+		expected    string
+	}{
+		{"Remove single quotes", `'/path/to/file'`, `/path/to/file`},
+		{"Remove double quotes", `"/path/to/file"`, `/path/to/file`},
+		{"Remove spaces", `  /path/to/file  `, `/path/to/file`},
+		{"Remove all quotes and spaces", `  ''' """ /path/to/file '''  """ `, `/path/to/file`},
+		{"Quotes and spaces are not removed from the middle", `/path/'" to/file`, `/path/'" to/file`},
+	}
+	for _, tc := range testCases {
+		t.Run(tc.description, func(t *testing.T) {
+			assert := asrt.New(t)
+			restoreOutput := util.CaptureUserOut()
+			scanner := bufio.NewScanner(strings.NewReader(tc.input))
+			util.SetInputScanner(scanner)
+			result := util.GetQuotedInput("nodefault")
+			assert.EqualValues(tc.expected, result)
+			_ = restoreOutput()
+		})
+	}
+}
+
 // TestCaptureUserOut ensures capturing of stdout works as expected.
 func TestCaptureUserOut(t *testing.T) {
 	assert := asrt.New(t)