-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
[BUG] using multiple yaml alias not working. mapping key "<<" already defined #10411
Comments
Thanks for reporting this issue, I'll look into this today |
This is an unexpected side-effect upgrading to go-yaml/v3 |
goyaml/v3 does not support repeated anchors (due to internal storage using environment:
<<: [*mysqlenv, *mysqlextraenv] According to https://yaml.org/type/merge.html this is the expected syntax |
Thanks, @ndeloof. This fix works. Will close this. |
One thing to note that it's not quite the same behaviour. Value overrides don't work as before. If you previously had x-mysql: &mysqlenv
MYSQL_USER: test
x-mysql-extraenv: &mysqlextraenv
MYSQL_USER: overridetest
environment:
<<: *mysqlenv
<<: *mysqlextraenv the value of the variable However with the new syntax, the value for environment:
<<: [*mysqlenv, *mysqlextraenv] |
Sorry for the noise, but it seems to merge in reverse? Rewriting it as environment:
<<: [*mysqlextraenv, *mysqlenv] Does override values of |
Ok, after swifting through https://yaml.org/type/merge.html it does mention this.
I hope it's helpful to someone else. |
Malcolm v23.04.0 is a release with enhancements, component version updates and bug fixes. IMPORTANT NOTE: In March 2023 Docker Inc. announced its decision to sunset the "Docker Free Team" plan, which prompted us to decide to migrate away from Docker Hub to the Github Container Registry or "ghcr" (see #163). Due to public backlash, Docker Inc. reversed its decision. However, the Malcolm project will continue with the decision to use GHCR beginning with this release (Malcolm v23.04.0) and moving forward. If you're updating an existing instance of Malcolm, it's recommended that you back up your `docker-compose.yml` and `docker-compose-standalone.yml` files, replace them with the ones from this release and re-run `./scripts/install.py --configure` to ensure that you're pointing at the latest images (this is actually always good practice when moving to a new release of Malcolm). v23.03.0...v23.04.0 * Enhancements - autostart `install.py --configure` on Malcolm ISO first boot (#157) - clarify information about auth_setup's use of external OpenSearch connections (#160) - migrate away from DockerHub container registry (#163) - give easier option for transferring SSL client files from Malcolm to forwarder (#177) + added `tx-rx-secure.sh` script as wrapper around [croc](https://github.com/schollz/croc) automatically creating and using a local-only relay * Component version updates - [Zeek v5.2.0](https://github.com/zeek/zeek/releases) (#161) - [fluent bit v2.0.10](https://fluentbit.io/announcements/v2.0.10/) - [NetBox v3.4.7](https://github.com/netbox-community/netbox/releases/tag/v3.4.7) * Fixes - XFCE4's "save session on exit" causes conflict with Hedgehog kiosk mode if firefox instance is started upon session restore (#164) - docker-compose move from go-yaml/v3 breaks Malcolm's docker-compose YAML files (#178, docker/compose#10411) - increase index.mapping.nested_fields.limit in opensearch index template (#180)
Malcolm v23.04.0 is a release with enhancements, component version updates and bug fixes. IMPORTANT NOTE: In March 2023 Docker Inc. announced its decision to sunset the "Docker Free Team" plan, which prompted us to decide to migrate away from Docker Hub to the Github Container Registry or "ghcr" (see idaholab#163). Due to public backlash, Docker Inc. reversed its decision. However, the Malcolm project will continue with the decision to use GHCR beginning with this release (Malcolm v23.04.0) and moving forward. If you're updating an existing instance of Malcolm, it's recommended that you back up your `docker-compose.yml` and `docker-compose-standalone.yml` files, replace them with the ones from this release and re-run `./scripts/install.py --configure` to ensure that you're pointing at the latest images (this is actually always good practice when moving to a new release of Malcolm). v23.03.0...v23.04.0 * Enhancements - autostart `install.py --configure` on Malcolm ISO first boot (idaholab#157) - clarify information about auth_setup's use of external OpenSearch connections (idaholab#160) - migrate away from DockerHub container registry (idaholab#163) - give easier option for transferring SSL client files from Malcolm to forwarder (idaholab#177) + added `tx-rx-secure.sh` script as wrapper around [croc](https://github.com/schollz/croc) automatically creating and using a local-only relay * Component version updates - [Zeek v5.2.0](https://github.com/zeek/zeek/releases) (idaholab#161) - [fluent bit v2.0.10](https://fluentbit.io/announcements/v2.0.10/) - [NetBox v3.4.7](https://github.com/netbox-community/netbox/releases/tag/v3.4.7) * Fixes - XFCE4's "save session on exit" causes conflict with Hedgehog kiosk mode if firefox instance is started upon session restore (idaholab#164) - docker-compose move from go-yaml/v3 breaks Malcolm's docker-compose YAML files (idaholab#178, docker/compose#10411) - increase index.mapping.nested_fields.limit in opensearch index template (idaholab#180)
Make shure we have unique yaml keys. Inspired by this post: docker/compose#10411 (comment)
Make shure we have unique yaml keys. Inspired by this post: docker/compose#10411 (comment)
`docker compose` v2.17.2 fails with the following syntax error due to go/yaml/v3 update. ```sh ❯ docker compose config yaml: unmarshal errors: line 40: mapping key "<<" already defined at line 39 line 40: mapping key "<<" already defined at line 39 line 40: mapping key "<<" already defined at line 39 ``` "goyaml/v3 does not support repeated anchors (due to internal storage using << as key during parsing) but allows use of multi-values in anchors" See: docker/compose#10411 (comment) https://yaml.org/type/merge.html
…jected from v2.17.x (#12428) fix: Replace unsupported repeated yaml anchors with merge `docker compose` v2.17.2 fails with the following syntax error due to go/yaml/v3 update. ```sh ❯ docker compose config yaml: unmarshal errors: line 40: mapping key "<<" already defined at line 39 line 40: mapping key "<<" already defined at line 39 line 40: mapping key "<<" already defined at line 39 ``` "goyaml/v3 does not support repeated anchors (due to internal storage using << as key during parsing) but allows use of multi-values in anchors" See: docker/compose#10411 (comment) https://yaml.org/type/merge.html
Fix this error: docker-compose --file docker-compose.yml config parsing /Users/vlad/src/rss-email-subscription/docker-compose.yml: yaml: unmarshal errors: line 56: mapping key "<<" already defined at line 55 line 84: mapping key "<<" already defined at line 83 line 103: mapping key "<<" already defined at line 102 line 118: mapping key "<<" already defined at line 117 line 136: mapping key "<<" already defined at line 135 line 154: mapping key "<<" already defined at line 153 line 168: mapping key "<<" already defined at line 167 NOTE: This started after Docker update, which used a newer version of YAML library. Please see docker/compose#10411.
Repeated anchors are not allowed in YAML, the values should be a list. See docker/compose#10411 (comment)
Make shure we have unique yaml keys. Inspired by this post: docker/compose#10411 (comment)
Docker compose no longer allows multiple merge keys in compose files. The YAML spec allows multiple maps to be merged by passing a sequence to the merge (`<<:`) key. This is documented in the [YAML spec](https://yaml.org/type/merge.html). The behavior change for docker-compose is documented in [this issue](docker/compose#10411)
Docker compose no longer allows multiple merge keys in compose files. The YAML spec allows multiple maps to be merged by passing a sequence to the merge (`<<:`) key. This is documented in the [YAML spec](https://yaml.org/type/merge.html). The behavior change for docker-compose is documented in [this issue](docker/compose#10411)
Docker compose no longer allows multiple merge keys in compose files. The YAML spec allows multiple maps to be merged by passing a sequence to the merge (`<<:`) key. This is documented in the [YAML spec](https://yaml.org/type/merge.html). The behavior change for docker-compose is documented in [this issue](docker/compose#10411)
Repeated anchors are not allowed in YAML, the values should be a list. See docker/compose#10411
Repeated anchors are not allowed in YAML, the values should be a list. See docker/compose#10411
Repeated anchors are not allowed in YAML, the values should be a list. See docker/compose#10411
docker/compose#10411 repeated "<<" break docker-compose >= 2.17 yaml: unmarshal errors: line 148: mapping key "<<" already defined at line 147
* duplicate key in docker-compose-dev * [deprecated syntax](docker/compose#10411 (comment)) in docker-compose
YAML parsing was improved in v2.17 - multiple merge keys takes as array issue taken from docker/compose#10411
Issue when using docker compose version >= 2.17.0 docker/compose#10411
Description
docker-compose.yml
Try
docker-compose config
. Then getting the following errorThe version of my docker-compose is
2.17.2
The same is working in
2.15.1
,2.16.0
and even release candidate version2.17.0-rc.1
.This is broken from version
2.17.0
Steps To Reproduce
docker-compose config
Compose Version
Docker Environment
Anything else?
Not Working in 2.17.0
Working in 2.17.0-rc.1
The text was updated successfully, but these errors were encountered: