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

States that include other states is causing "conflicting IDs" errors. #7526

Closed
luizsilva opened this issue Sep 30, 2013 · 33 comments
Closed
Labels
Bug broken, incorrect, or confusing behavior Regression The issue is a bug that breaks functionality known to work in previous releases. severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around

Comments

@luizsilva
Copy link

Using salt 0.17
On my top.sls I have

base:
  '*'
    - github
    - openssh

The github state include openssh state. That is generating this error message:

Data failed to compile:
----------
    Detected conflicting IDs, SLS IDs need to be globally unique.

If I remove the includes, the highstate runs normaly.

@basepi
Copy link
Contributor

basepi commented Oct 1, 2013

Right, the include pulls those states in. So if you include the openssh state in the github state you should not put the openssh state in your top.sls.

@luizsilva
Copy link
Author

The weird thing is that it was working fine on 0.16.

It was very useful when running a single state that depended on other states.

@basepi
Copy link
Contributor

basepi commented Oct 1, 2013

Ah, didn't realize this was a regression. Thanks for pointing that out, we'll get this fixed.

@basepi
Copy link
Contributor

basepi commented Oct 7, 2013

@luizsilva Are you using 0.17.0, or a more recent build from git? Just want to make sure, as there was a change to includes (to fix wildcards) but it was after 0.17.0 was released.

@luizsilva
Copy link
Author

@basepi We are using salt 0.17.0 (yaourt package version 0.17.0-1 on Arch linux)

I will wait for the package maintainer to update it and I will test again.

@basepi
Copy link
Contributor

basepi commented Oct 9, 2013

OK, then this regression was not caused by the fix I mentioned. We'll figure out what's going on here and get it fixed.

@hobbestigrou
Copy link

We have the same problem. We hope it's be resolved soon.

@Lothiraldan
Copy link
Contributor

I think the include system mimic the import in python. If states has already been included (either in top.sls or by other state), do not try to include it one more time.

@max-arnold
Copy link
Contributor

Same problem here, lots of duplicate IDs on 0.17.0

@basepi
Copy link
Contributor

basepi commented Oct 9, 2013

Thanks for the additional reports. This is high on our priority list.

@JustinCarmony
Copy link
Contributor

Ok, so I've had this problem as well on develop and v0.17.0.

What seems to be the problem is if you include a state file via the top.sls, you cannot include it in any other state files.

so if I have a common/init.sls state file, I can't currently do a:

base:
  '*':
    - common

and then later in something like a php5/init.sls file:

include:
  - common

However, php5/init.sls and nginx/init.sls both can include common as long as it isn't included in the top.sls file.

I hope this helps track down the bug.

@tateeskew
Copy link

Add me to this list. Same exact behavior.

@HuangShaoyan
Copy link

I use overstate as a workaround. It looks good. But please fix it as soon as possible.

thatch45 added a commit that referenced this issue Oct 15, 2013
This should prevent already loaded mods from being reloaded from the
top level of the matches
thatch45 added a commit that referenced this issue Oct 16, 2013
thatch45 added a commit that referenced this issue Oct 16, 2013
@sblask
Copy link

sblask commented Nov 20, 2013

We still have an issue with this using 0.17.2. Did you actually have another fix after reverting the fix in da8a60f/2f71e6f ?

@tateeskew
Copy link

I can confirm that this is still the case as well.

@basepi
Copy link
Contributor

basepi commented Nov 20, 2013

What's the issue you're seeing? The same "conflicting IDs on imported states" problems?

@sblask
Copy link

sblask commented Nov 21, 2013

Yes, same thing.

@basepi basepi reopened this Nov 21, 2013
@basepi
Copy link
Contributor

basepi commented Nov 21, 2013

Alright, re-opened. Guess we still need to try to fix this without breaking PyDSL.

@sblask
Copy link

sblask commented Nov 22, 2013

Because of this problem and the slowness, we tried not using gitfs anymore. Now we work from manual checkouts and replaced the different environments we had with standard git branching. Without actually changing the states, the problem doesn't occur anymore. So it's probably related to using different environments?

@tateeskew
Copy link

My use case is identical to the original problem and it still exists in .17.2
This is kind of a big deal because it basically renders the include statement obsolete in a lot of cases. Especially when you have states within non-base states that have a require statement from something that was to be included.

@basepi
Copy link
Contributor

basepi commented Nov 25, 2013

Can you guys post some example SLS files that consistently cause this error? We need to try to reproduce it again on our end.

@tateeskew
Copy link

Sure @basepi
Here is a gist:
https://gist.github.com/tateeskew/7645966

@jeteokeeffe
Copy link
Contributor

Another example if you needed one
https://gist.github.com/jeteokeeffe/7700914

@medcl
Copy link

medcl commented Dec 26, 2013

global unique is not ideal,maybe auto adding folder name as part of sls-id,that will be more nice to use.

@basepi
Copy link
Contributor

basepi commented Dec 26, 2013

@medcl No worries, this is definitely a bug which we're working to fix.

@medcl
Copy link

medcl commented Dec 27, 2013

great!

-------- 原始邮件 --------
发件人:Colton Myers notifications@github.com
时间:周五 12月27日 03:16
收件人:saltstack/salt salt@noreply.github.com
抄送:Medcl m@medcl.net
主题:Re: [salt] States that include other states is causing "conflicting IDs" errors. (#7526)

@medcl No worries, this is definitely a bug which we're working to fix.


Reply to this email directly or view it on GitHub:
#7526 (comment)

@basepi
Copy link
Contributor

basepi commented Dec 27, 2013

So I have had some long-standing misunderstandings with the way this is supposed to work.

State IDs must be globally unique across a single state run. This won't be changing. I was under the impression that you could have the same state ID in two different state files in the same highstate as long as they didn't include each other. This is false.

That said, if you define an ID in a state file defined in the top.sls, and then also include that state file in a different state file defined in top.sls, this should not be producing conflicting ID errors.

(Edited for clarifications)

@thatch45
Copy link
Contributor

This original issue is still fixed, the issue brought up here is a separate issue now tracked in #9464

@dhs-rec
Copy link
Contributor

dhs-rec commented May 8, 2015

I don't think it's fixed. I see it now on 2014.7.x:
Detected conflicting IDs, SLS IDs need to be globally unique. The conflicting ID is 'foobar' and is found in SLS 'development:foo/bar' and SLS 'development:foo.bar'
when I have foo/bar in top.sls and "include foo.bar" somewhere else. Seems the difference comes from "/" vs. ".". Or do I need to put "foo.bar" into top.sls, too?

@dhs-rec
Copy link
Contributor

dhs-rec commented May 8, 2015

OK, using "." in top.sls works.

@DanielYWoo
Copy link

DanielYWoo commented Nov 19, 2017

what if I have "mysql" in top.sls

  'L@serv01, serv02, serv03':
    - rabbitmq

Then in rabbitmq.sls I must ensure user and groups like this

# users and groups
rabbitmq:
  group.present:

rabbitmq:
  user.present:
    - groups:
      - rabbitmq

I will have three duplicate global IDs?

@Jibun-no-Kage
Copy link

What was this not fixed?

@dhs-rec
Copy link
Contributor

dhs-rec commented Oct 24, 2022

@DanielYWoo, that should then be

rabbitmq:
  group.present:
  user.present:
    - require:
        - group: rabbitmq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Regression The issue is a bug that breaks functionality known to work in previous releases. severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

No branches or pull requests