"ddev pull pantheon" fails on Windows with Unknown command '\U'.

October 31, 2023
default author headshot Ashraf Abed
Share this post:

In Debug Academy's Drupal 10 training course, we integrate our student projects with Pantheon's hosting environment and we use DDEV for local development.

In general, it works smoothly. However, in some instances students who use Windows (and Git Bash) receive an error upon running ddev pull pantheon . This article walks through a quick and easy workaround.

ddev pull pantheon fails on Windows

Students sometimes see the following error message when running ddev pull pantheon in Git Bash:
You're about to delete the current database and files and replace with the results of a fresh pull.
Would you like to continue? [Y/n] (yes):
 [notice] Logging in via machine token.
 [notice] Found a machine token for __@gmail.com.
 [notice] Logged in via machine token.
Obtaining databases...
+ set -eu -o pipefail
+ ls /var/www/html/.ddev
+ pushd /var/www/html/.ddev/.downloads
+ terminus backup:get samplelkpproj.dev --element=db --to=db.sql.gz
Importing databases [___\Desktop\sample-lkp-proj\.ddev\.downloads\db.sql.gz]

ERROR at line 1: Unknown command '\U'.
Pull failed: failed to import database: composeCmd failed to run 'COMPOSE_PROJECT_NAME=ddev-sample-lkp-proj docker-compose -f ___\Desktop\sample-lkp-proj\.ddev\.ddev-docker-compose-full.yaml

When it happens, the files seem to download from Pantheon successfully, but the database does not get imported. The good news is even if the database doesn't import, it actually does still get downloaded. Hence the following workaround:

How to resolve ERROR at line 1: Unknown command '\U'

Here's a quick workaround so that you can successfully pull the database (and files) from Pantheon into your local ddev-based development environment:

  1. Run ddev pull pantheon as usual:
    1. cd into your Drupal project
    2. ddev start
    3. ddev auth ssh
      • Git Bash users may need to run winpty ddev auth ssh
    4. ddev pull pantheon
      • This may fail to import the database, but it will still successfully download it, so you still need to run it
  2. Received the error ERROR at line 1: Unknown command '\U'.?
    • If so, run: ddev exec 'gunzip -c .ddev/.downloads/db.sql.gz | drush sqlc'

That's it! Your database should now be imported successfully from Pantheon.

Gain more Drupal expertise

Interested in learning more about Drupal? Check out our Drupal training courses. From our introductory drupal training for beginners class to the specialized drupal certification training or our career-changing drupal bootcamp where we use DDEV and Pantheon, our curriculum is designed to cater to different learning needs and career goals.

I hope this was helpful. Thanks for reading!

Ready To Launch Your Career?

Take the first step to launching the career you've always wanted. Explore Debug Academy classes today!

Explore Classes Contact Us