{"record":{"id":"c3452e19090b27fa","repo":"puppetlabs/puppet","slug":"unknown-operation","errorCode":null,"errorMessage":"Unknown operation","messagePattern":"Unknown operation","errorType":"validation","errorClass":"Puppet::Error","httpStatus":null,"severity":"error","filePath":"lib/puppet/util/symbolic_file_mode.rb","lineNumber":132,"sourceCode":"          when 'X'\n            # Only meaningful in combination with \"set\" actions.\n            if action != '+'\n              raise Puppet::Error, _(\"X only works with the '+' operator\")\n            end\n\n            # As per the BSD manual page, set if this is a directory, or if\n            # any execute bit is set on the original (unmodified) mode.\n            # Ignored otherwise; it is \"add if\", not \"add or clear\".\n            if is_a_directory or original_mode['any x?']\n              value = actions[action].call(value, ExecBit)\n            end\n\n          when /[st]/\n            bit = SymbolicSpecialToBit[op][who] or fail _(\"internal error\")\n            final_mode['s'] = actions[action].call(final_mode['s'], bit)\n\n          else\n            raise Puppet::Error, _('Unknown operation')\n          end\n        end\n\n        # Now, assign back the value.\n        final_mode[who] = value\n      end\n    rescue Puppet::Error => e\n      if part.inspect != modification.inspect\n        rest = \" at #{part.inspect}\"\n      else\n        rest = ''\n      end\n\n      raise Puppet::Error, _(\"%{error}%{rest} in symbolic mode %{modification}\") % { error: e, rest: rest, modification: modification.inspect }, e.backtrace\n    end\n\n    final_mode['s'] << 9 |\n      final_mode['u'] << 6 |","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/util/symbolic_file_mode.rb#L114-L150","documentation":"Raised when a character in the permission part of a symbolic clause is outside the supported set: operators (-+=), who references (ugo), permission letters (rwx), X, and special bits (st). Anything else falls into the else branch and raises 'Unknown operation'.","triggerScenarios":"Typo or word characters: 'u+z', 'a+read', 'g=rw;q', or punctuation and backslashes pasted in from other tools.","commonSituations":"Writing words instead of single letters; copy-paste from docs with smart quotes or extra characters; programmatic mode building that includes separators.","solutions":["Restrict each clause to [ugoa]*[-+=][ugo rwxXst]* syntax.","Retype the mode instead of pasting; verify with a lint regex before deploying."],"exampleFix":"# before\nfile { '/tmp/y': mode => 'a+read' }\n\n# after\nfile { '/tmp/y': mode => 'a+r' }","handlingStrategy":"validation","validationCode":"VALID_CLAUSE = /\\A[ugoa]*[-+=+][ugo rwxXst]*\\z/\nraise ArgumentError, \"invalid mode #{mode.inspect}\" unless mode.split(/\\s*,\\s*/).all? { |c| c =~ VALID_CLAUSE }\nPuppet::Util::SymbolicMode.symbolic_mode_to_int(mode)","typeGuard":"def symbolic_clause?(c)\n  c =~ /\\A[ugoa]*[-+=][ugo rwxXst]*\\z/\nend","tryCatchPattern":null,"preventionTips":["Use only r,w,x,X,s,t and u,g,o,a letters.","Lint mode strings in CI with a regex check.","Retype rather than paste modes from formatted docs."],"tags":["puppet","file-mode","symbolic-mode","parser","typo"],"backgroundTag":"invalid-symbolic-mode","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}