Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ddev get ddev/ddev-platformsh ends with Syntax Error (Ibexa) #107

Closed
ibexa-yuna opened this issue May 12, 2023 · 9 comments
Closed

ddev get ddev/ddev-platformsh ends with Syntax Error (Ibexa) #107

ibexa-yuna opened this issue May 12, 2023 · 9 comments

Comments

@ibexa-yuna
Copy link
Contributor

ibexa-yuna commented May 12, 2023

Hi,

I'm using my project that's already running on Platform.sh.
This is my .platform.app.yaml.

The error I'm getting is:

$ ddev get ddev/ddev-platformsh

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 
👍  Install .environment file into web-entrypoint.d if needed 
BASE64_ENCODE=base64
Running 'ddev get ddev/ddev-redis'
Downloading https://api.github.com/repos/ddev/ddev-redis/tarball/v1.0.5
v1.0.5_4220337423.tar.gz 7.93 KiB / ? [------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------=---]  81.24% 0s 

Installing project-level components:
👍 docker-compose.redis.yaml
👍 redis/scripts/settings.ddev.redis.php
👍 redis/scripts/setup-drupal-settings.sh
👍 redis/redis.conf
👍 commands/redis/redis-cli

Executing post-install actions:
👍 Install redis settings for Drupal 9+ if applicable

Installed DDEV add-on ddev/ddev-redis, use `ddev restart` to enable.
Please read instructions for this addon at the source repo at
https://github.com/ddev/ddev-redis
Please file issues and create pull requests there to improve it.
bash: -c: line 105: syntax error near unexpected token `]]'
 
👎 Installing dependencies and generating needed environment variables 
could not process post-install action (3) 'Installing dependencies and generating needed environment variables' 

If I try installing ddev-redis manually it's installing without a problem, which leads me to believe that the problem is in ddev-platformsh.

If I run the installation with -v then I can see definitely something wrong with bash in regards to schema.xml:

  # echo service_def=map[configuration:map[configsets:map[mainconfig:configsets/solr6] cores:map[collection1:map[core_properties:configSet=mainconfig
schema=schema.xml
]] endpoints:map[collection1:map[core:collection1]]] disk:412 fulltype:solr:7.7 type:solr version:7.7]

This schema.xml reference is coming from my services.yaml.

Steps to reproduce:

  1. Install Ibexa DXP on Platform.sh (OSS version should be fine) with SOLR configuration from Commerce edition. https://github.com/ibexa/post-install/tree/4.4/resources/platformsh/ibexa-commerce/4.4/.platform
  2. Clone to local
  3. Run ddev get ddev/ddev-platform.sh, answer script questions, observe the error
@rfay rfay changed the title ddev get ddev/ddev-platformsh ends with Syntax Error ddev get ddev/ddev-platformsh ends with Syntax Error (Ibexa) May 12, 2023
@rfay
Copy link
Member

rfay commented May 12, 2023

Thanks for reporting this!

@rfay
Copy link
Member

rfay commented May 22, 2023

The only place I can find that uses the newer bash syntax [[ and ]] is in ddev-redis; it's not used in ddev-platformsh:

if [[ $DDEV_PROJECT_TYPE != drupal* ]] || [[ $DDEV_PROJECT_TYPE =~ ^drupal(6|7)$ ]] ;
then
  exit 0
fi

https://github.com/ddev/ddev-redis/blob/29151def441a5a5d3a1deb92516dd612d8e2d463/redis/scripts/setup-drupal-settings.sh#L5

And I haven't figured out why that would fail, but I can recreate your situation.

@ibexa-yuna
Copy link
Contributor Author

I was able to track and "fix" it, looks like it's a problem of data sanitation during output:

ibexa-yuna@c8951cf

@rfay
Copy link
Member

rfay commented May 22, 2023

Just removing a comment fixes it? And then... why does this work so many other places and not with your .platform.app.yaml. I think we've on the verge of finding out!

PR is welcome! Also, we could add the ibexa type to tests if you'd like.

@ibexa-yuna
Copy link
Contributor Author

not with your .platform.app.yaml

Due to:
https://github.com/ibexa/post-install/blob/main/resources/platformsh/ibexa-commerce/4.6/.platform/services.yaml#L60-L73

SOLR p.sh service requires some multiline input string as parameters, which is what we can see during the error:

# echo service_def=map[configuration:map[configsets:map[mainconfig:configsets/solr6] cores:map[collection1:map[core_properties:configSet=mainconfig
schema=schema.xml
]] endpoints:map[collection1:map[core:collection1]]] disk:412 fulltype:solr:7.7 type:solr version:7.7]

@ibexa-yuna
Copy link
Contributor Author

Hey @rfay

Would you like me to submit a PR or this is something that can be fixed on your end in a more elegant way, than just cutting comments out?

@rfay
Copy link
Member

rfay commented Jun 12, 2023

A PR removing the "comment" would be fine, or fixing the comment would be fine as well. If you're able to provide a trivial example that breaks this that would be helpful as well.

IIRC the "comment" is actually documentation in the generated config, so it only appears to be a comment in this context. But I'm also sure we can live without it.

Thanks so much!

@ibexa-yuna
Copy link
Contributor Author

Hi Randy,

I've created a PR for this:
#108

@rfay
Copy link
Member

rfay commented Jun 22, 2023

Thanks!

@rfay rfay closed this as completed in ea9eb17 Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants