{"record":{"id":"1cf01d9e6beabc49","repo":"puppetlabs/puppet","slug":"error-rest-in-symbolic-mode-modification","errorCode":null,"errorMessage":"%{error}%{rest} in symbolic mode %{modification}","messagePattern":"%(.+?)%(.+?) in symbolic mode %(.+?)","errorType":"validation","errorClass":"Puppet::Error","httpStatus":null,"severity":"error","filePath":"lib/puppet/util/symbolic_file_mode.rb","lineNumber":146,"sourceCode":"            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 |\n      final_mode['g'] << 3 |\n      final_mode['o'] << 0\n  end\nend\nend\nend\n","sourceCodeStart":128,"sourceCodeEnd":157,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/util/symbolic_file_mode.rb#L128-L157","documentation":"This is the wrapper message, not a distinct failure: any Puppet::Error raised while parsing a symbolic mode is re-raised with the offending clause and the whole mode attached (\"<cause> at \\\"clause\\\" in symbolic mode \\\"...\\\"\"), preserving the original backtrace. Seeing it means one of the specific parse errors (empty mode, decimal digits, missing action, missing operation, X misuse, unknown operation) fired underneath.","triggerScenarios":"Any invalid symbolic mode reaching symbolic_mode_to_int; e.g. mode => 'u+r,g' produces 'Missing action at \"g\" in symbolic mode \"u+r,g\". It is the user-facing form logged by the agent for every symbolic-mode typo.","commonSituations":"Variable-interpolated modes that go wrong at runtime; refactoring modes across modules; the message users actually grep for in agent logs.","solutions":["Read the embedded cause before ' in symbolic mode' — it names the real problem and the failing clause.","Fix the flagged clause per its specific error: add the operator, remove 8/9 digits, keep X with '+', drop unknown letters.","Temporarily replace the whole mode with a known-good octal value ('0644') to confirm the resource works, then rebuild the symbolic mode."],"exampleFix":"# before: agent reports ... Missing action at \"g\" in symbolic mode \"u+r,g\"\nfile { '/tmp/z': mode => 'u+r,g' }\n\n# after\nfile { '/tmp/z': mode => 'u+r,g+r' }","handlingStrategy":"try-catch","validationCode":"def valid_symbolic_mode?(m)\n  return false unless m.is_a?(String) && !m.empty?\n  m.split(/\\s*,\\s*/).all? do |c|\n    c =~ /\\A[ugoa]*([-+=][ugo rwxXst]*)\\z/ && !(c.include?('X') && c[/^([ugoa]*)([-+=])/, 2] != '+')\n  end\nend","typeGuard":null,"tryCatchPattern":"begin\n  int_mode = Puppet::Util::SymbolicMode.symbolic_mode_to_int(mode, File.stat(file).mode)\nrescue Puppet::Error => e\n  raise Puppet::Error, \"invalid mode #{mode.inspect} for #{file}: #{e.message}\"\nend","preventionTips":["Parse the ' at <clause>' segment to locate the bad part quickly.","Keep modes static strings, not interpolation targets.","Cover every shipped mode with a spec example."],"tags":["puppet","file-mode","symbolic-mode","error-wrapper","diagnostics"],"backgroundTag":"invalid-symbolic-mode","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}