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

[BUG] When using an int as state ID in reactor SLS stacktrace occurs #65210

Closed
Ch3LL opened this issue Sep 15, 2023 · 0 comments
Closed

[BUG] When using an int as state ID in reactor SLS stacktrace occurs #65210

Ch3LL opened this issue Sep 15, 2023 · 0 comments
Assignees
Labels
Bug broken, incorrect, or confusing behavior Sulfur v3006.4

Comments

@Ch3LL
Copy link
Contributor

Ch3LL commented Sep 15, 2023

Description
When a reactor SLS uses a int as the ID, I see this traceback in the master logs:

2023-09-15 12:11:11,834 [salt.utils.reactor                             :192 ][ERROR   ][382147] Exception encountered while compiling reactions                                                                    
Traceback (most recent call last):                                                                                                                                                                                  
  File "/home/ch3ll/git/salt/salt/utils/reactor.py", line 180, in reactions                                                                                                                                         
    errors = self.verify_high(high)                                                                                                                                                                                 
  File "/home/ch3ll/git/salt/salt/state.py", line 453, in verify_high                                                                                                                                               
    if name.startswith("__"):                                                                                                                                                                                       
AttributeError: 'int' object has no attribute 'startswith'        

Setup
/etc/salt/master:

reactor: 
  - 'salt/minion/*/start':
    - /srv/reactor/start.sls 

/srv/reactor/start.sls

1234:                                                                                                                                                                                                               
  local.cmd.run:                                                                                                                                                                                                    
    - tgt: poc-minion                                                                                                                                                                                               
    - args:                                                                                                                                                                                                         
      - cmd: touch /tmp/test1                                                                                                                                                                                       
                                                                                                                                                                                                                    
add_test_2:                                                                                                                                                                                                         
  local.cmd.run:                                                                                                                                                                                                    
    - tgt: poc-minion                                                                                                                                                                                               
    - args:                                                                                                                                                                                                         
      - cmd: touch /tmp/test2                                                                                                                                                                                       
    - require:                                                                                                                                                                                                      
      - local: 1234   

Steps to Reproduce the behavior
Start the Master and then the Minion. When the minion starts you should see the traceback in the log output.

Expected behavior
No traceback, but a clear error that you should not use int.

Versions Report
head of 3006.x

@Ch3LL Ch3LL added Bug broken, incorrect, or confusing behavior Sulfur v3006.4 labels Sep 15, 2023
@Ch3LL Ch3LL added this to the Sulfur v3006.4 milestone Sep 15, 2023
@Ch3LL Ch3LL self-assigned this Sep 15, 2023
@Ch3LL Ch3LL closed this as completed Sep 18, 2023
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 Sulfur v3006.4
Projects
None yet
Development

No branches or pull requests

1 participant