terraform-aws-couchbase icon indicating copy to clipboard operation
terraform-aws-couchbase copied to clipboard

error in run-sync-gateway/wait_for_couchbase_clusters when config file has backtics

Open tinomen opened this issue 4 years ago • 4 comments

https://github.com/gruntwork-io/terraform-aws-couchbase/blob/027eb19e57a7bc2522a1287c4adf008d655afc40/modules/run-sync-gateway/run-sync-gateway#L185

This line of code is throwing an error when the config file has backticks in the import_filter or sync json properties as mentioned in the docs

The error:

parse error: Invalid numeric literal at line 42, column 0

tinomen avatar Jan 12 '21 00:01 tinomen

Turns out it is jq that is throwing the error. 😢

tinomen avatar Jan 13 '21 06:01 tinomen

Oh man, so the config is no longer valid JSON? That's... Unfortunate. Thanks for reporting though!

brikis98 avatar Jan 14 '21 10:01 brikis98

The Sync Gateway config has never been 100% valid JSON, it's always used backticks for multi-line sync functions. It's documented here:

https://docs.couchbase.com/sync-gateway/current/refer/config-properties.html#about-the-schema

We're working on a feature in 3.0 that will allow you to reference an external js file instead, so the config file can become fully valid JSON.

For now though, backticks are really the only way to use multiline strings, vs. minifying and escaping stuff in double quotes, which I don't think anybody wants to do.

bbrks avatar Jan 14 '21 15:01 bbrks

Huh, TIL, thanks!

brikis98 avatar Jan 18 '21 09:01 brikis98

This repo is being archived, feel free to use a fork if necessary.

ellisonc avatar Mar 29 '23 18:03 ellisonc