Skip to content

serializers.yamlex is doing something weird with its string representation #47085

Closed as not planned

Description

@mattp-

Description of Issue/Question

when using yamlex,

#!yamlex
/srv:
  file.directory:
    - makedirs: True
    - group: root
    - user: root
    - mode: 755

the following fails

mmp-sl-test-1:
----------
          ID: "/srv"
    Function: file.directory
      Result: False
     Comment: Group "root" is not available
     Started: 15:26:39.835190
    Duration: 9.279 ms
     Changes:

if you remove the try guard,

KeyError: 'getgrnam(): name not found: "root"'

it seems to be making the root string not actually root. when evaluating group == 'root' before the getgrnam() it evaluated as true, so it's likely something with utf8 encoding that yamlex is doing.

Salt Version:
           Salt: 2018.3.0-2279-g68546d2

Dependency Versions:
           cffi: 1.11.5
       cherrypy: unknown
       dateutil: 2.6.1
      docker-py: 3.1.4
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.10
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: 0.29.0
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: 2.18
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.14 (default, Mar 14 2018, 09:26:40)
   python-gnupg: Not Installed
         PyYAML: 3.12
          PyZMQ: 17.0.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.1.6

System Versions:
           dist: redhat 7.3 Maipo
         locale: UTF-8
        machine: x86_64
        release: 3.10.0-514.6.1.el7.x86_64
         system: Linux
        version: Red Hat Enterprise Linux Server 7.3 Maipo```

Activity

  1. mattp- commented on Apr 15, 2018

    @mattp-
    ContributorAuthor
  2. gtmanfred commented on Apr 16, 2018

    @gtmanfred
    Contributor

    Can you provide the output of --versions-report like the issues template requests, so that we can attempt to replicate this issue?

    Daniel

  3. added
    needs-more-info
    on Apr 16, 2018
  4. added this to the Blocked milestone on Apr 16, 2018
  5. mattp- commented on Apr 16, 2018

    @mattp-
    ContributorAuthor

    updated with version-report

  6. gtmanfred commented on Apr 16, 2018

    @gtmanfred
    Contributor

    Also, make sure you put newlines before and after the triple backtics, otherwise they do not do what you are expecting them to do.

  7. gtmanfred commented on Apr 16, 2018

    @gtmanfred
    Contributor

    I am able to replicate this issue.

    [CRITICAL] root
    [CRITICAL] <class 'salt.serializers.yamlex.SLSString'>
    [ERROR   ] Group "root" is not available
    

    It looks like the grp.getgrnam does not like the yamlex SLSString format for some reason.

    Thanks for reporting,
    Daniel

  8. gtmanfred commented on Apr 16, 2018

    @gtmanfred
    Contributor

    Looks like this is the way it has been for a while, also broken in 2017.7.

    Thanks,
    Daniel

  9. added
    bug
    severity-medium
    P4
    and removed
    needs-more-info
    on Apr 16, 2018
  10. modified the milestones: Blocked, Approved on Apr 16, 2018
  11. 12 remaining items

  12. modified the milestones: Approved, Argon v3008 on Aug 31, 2023
  13. dwoz commented on Oct 15, 2026

    @dwoz
    Contributor

    Thanks for the original report. This issue has been open for more than three years without recent activity and carries a severity label below severity-high. As part of a backlog cleanup, we're closing older low- and medium-severity issues so triage can focus on reports against currently supported releases.

    Closing isn't a judgement that the problem wasn't real — only that the codebase has moved through several releases since this was filed, and much of the surrounding code has changed.

    If you — or anyone else — can still reproduce this on the 3008.x LTS release, please leave a comment with a reproduction and a maintainer will reopen. The original reporter can also reopen directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ConfirmedRenderersbugseverity-mediumstale

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions