Hi, I may have updated atmos yesterday to 201, not...
# atmos
c
Hi, I may have updated atmos yesterday to 201, not sure, in any case, I get a new error while loading atmos for the following part in my stack, this is right under vars in a component:
Copy code
overseer:
          db_subnets: !terraform.state services-network ".subnets[] | select(.group == ""overseer"") | .id"
and I get
Copy code
Error: failed to set value at overseer.db_subnets: cannot navigate path: field is    
 not a map: path=[overseer db_subnets] field=overseer
I have identical subnet id queries elsewhere in the stack, no idea why this one specifically triggers something. if I replace the terraform state stuff with just "subnet-1234", it works. downgrading to 194 solves it
e
Does that mean it broke for you starting 1.195.0?
c
sadly I don't nkow, occasionally I run brew upgrade so I don't really know wha tthe previous versoin was. I grabbed 194 sort of randomly
e
@Andriy Knysh (Cloud Posse) could this be related to https://github.com/cloudposse/atmos/pull/1821
šŸ‘€ 1
a
@cromega thanks for reporting to make it faster to detect the problem, can you please execute a few commands: •
atmos describe component <component> -s <stack>
- this should throw the error you described • Update the expression to
db_subnets: !terraform.state services-network ".subnets[] | select(.group == ""overseer"")"
and execute the same command • Update the expression to
db_subnets: !terraform.state services-network ".subnets[]"
and execute the same command please provide the results for
overseer.db_subnets
for all these cases thank you
also, please search in your code for all occurrences of
Copy code
overseer:
          db_subnets: ......
it looks like some of those are in a wrong (different) format, and when Atmos tries to deep-merge it with the result of
!terraform.state services-network ".subnets[] | select(.group == ""overseer"") | .id"
, it can't merge two diff data types (e.g. list and map, or map and string)
c
ah I have some more clues: there is a component in which the overseer is configured and another component that inherits from this one and it has it nulled:
overseer: ~
if I delete
overseer: ~
from the child component then atmos loads fine
a
the latest Atmos release correctly deep-merges all values, including those from the
terraform.state
functions and declared inline
if those values have diff data types (which is invalid config), Atmos will not be able to merge it (which is correct behavior)
``overseer: ~` - looks incorrect, should be
overseer: {}
c
for terraform {} is not the same as null though
a
if you need
null
, use
Copy code
overseer: null
Atmos/YQ should be able to handle it
c
if I do overseer: null, I see the same error
but I think there is something else to it, I can't reproduce it with a simple example
a
ok, let me know if you get new info
the main point is, all
overseer
fields from the stacks must be the same data type
before 1.201, Atmos just replaced it with the result from
terraform.state
(which is not 100% valid, we need to honor inheritance. e.g a map from a base component or stack should be deep-merged with a map returned from
terraform.state
)
e
@Andriy Knysh (Cloud Posse) we should be able to merge
null
with a
map
right?
a
i suppose yes, but need to check/test it
overseer: ~
is def wrong
it was working before b/c Atmos just replaced it with the result from
terraform.state
, but now it tries to deep-merge it
e
CleanShot 2025-12-12 at 10.29.45@2x.png
I didn't know that!
c
this is the structure if components in my stack
Copy code
components:
  terraform:
    c1:
      vars:
        overseer:
          db_subnets: !terraform.state services-network ".subnets[] | select(.group == ""overseer"") | .id"
    c2:
      metadata:
        type: abstract
      inherits: [c1]
      vars:
        overseer: ~
    c3:
      inherits: [c2]
    c4:
      inherits: [c2]
however, this one triggers no errors. I'm trying to figure out what else is at play
a
i did not know about
overseer: ~
too
c
it's just a way to write null in yaml, afaik
āœ… 1
ah, I can reproduce it with this configuration: ``````
Copy code
components:
  terraform:
    c1:
      vars:
        some:
          data: !terraform.state some-component some-output
    c2:
      metadata:
        type: abstract
        inherits: [c1]
      vars:
        some: ~
    c3:
      metadata:
        inherits: [c2]
    c4:
      metadata:
        inherits: [c2]
~ or null makes no difference
a
thanks for the test fixture, we'll add a test for that and improve Atmos
you get the same error as you described above?
c
yeah, for this snippet I get
Copy code
Error: failed to set value at some.data: cannot navigate path: field is not a  
 map: path=[some data] field=some
a
thanks
e
āœ… 1
merged 1