ddevplatform.sh

ddev get drud/ddev-platformsh configuration - error when generating needed environment variables on MacOS


I'm encountering an issue with undefined project variables following the installation steps outlined here: https://github.com/drud/ddev-platformsh#install

Steps 1-3 were smooth, with no issues.

On step 4 ddev get drud/ddev-platformsh, the script runs successfully until the 'Executing post-install actions:' section. Here is the output with a few preceding lines for context:

Configuration complete. You may now run 'ddev start'.


Installing project-level components:
šŸ‘ web-build/Dockerfile.platformsh
šŸ‘ homeadditions/.bashrc.d/platformsh-environment.sh
šŸ‘ platformsh/.gitignore
šŸ‘ platformsh/generate_db_relationship.sh
šŸ‘ platformsh/generate_elasticsearch_relationship.sh
šŸ‘ platformsh/generate_memcached_relationship.sh
šŸ‘ platformsh/generate_redis_relationship.sh

Installing global components:
šŸ‘ commands/web/platform

Executing post-install actions:
šŸ‘ Support composer and python3 dependencies
BASE64_ENCODE=base64 -w 0
base64: illegal option -- w
base64: illegal option -- w

šŸ‘Ž Installing dependencies and generating needed environment variables
could not process post-install action (2) 'Installing dependencies and generating needed environment variables'

How do I address this? The issue could be that I'm running this on MacOS, which doesn't support the -w flag for BASE64 (based on this other SO issue).

Also, I see that Platform has these environment variables: https://docs.platform.sh/development/variables/use-variables.html#use-platformsh-provided-variables ...but I'm unclear how/where they should be integrated into the DDEV config files.

Also, after encountering the config error, I ran this command, which failed and further indicated that at least one project variable was missing:

$ ddev drush cr

In Config.php line 567:

  The appDir variable is not defined. Are you sure you're running on Platform.sh?

Failed to run drush cr: exit status 1

Any advice wrt how to overcome this issue would be welcome. Thank you.

My environment: DDEV: v1.21.4 OS: MacOS Ventura 13.1 CPU: Apple M1


Solution

  • I think you're on macOS and you have the homebrew version of base64 installed. Unfortunately, it's quite different in its behavior. Could you please uninstall the homebrew version? brew uninstall base64 && hash -r (hash -r just makes the changes in PATH immediately effective).

    See https://github.com/drud/ddev-platformsh/issues/93