{"record":{"id":"89e517841efebf3e","repo":"puppetlabs/puppet","slug":"could-not-find-init-script-or-upstart-conf-file-fo","errorCode":null,"errorMessage":"Could not find init script or upstart conf file for '#{name}'","messagePattern":"Could not find init script or upstart conf file for '#(.+?)'","errorType":"exception","errorClass":"Puppet::Error","httpStatus":null,"severity":"error","filePath":"lib/puppet/provider/service/upstart.rb","lineNumber":124,"sourceCode":"  def overscript\n    @overscript ||= initscript.gsub(/\\.conf$/, \".override\")\n  end\n\n  def search(name)\n    # Search prefers .conf as that is what upstart uses\n    [\".conf\", \"\", \".sh\"].each do |suffix|\n      paths.each do |path|\n        service_name = name.match(/^(\\S+)/)[1]\n        fqname = File.join(path, service_name + suffix)\n        if Puppet::FileSystem.exist?(fqname)\n          return fqname\n        end\n\n        debug(\"Could not find #{name}#{suffix} in #{path}\")\n      end\n    end\n\n    raise Puppet::Error, \"Could not find init script or upstart conf file for '#{name}'\"\n  end\n\n  def enabled?\n    return super unless is_upstart?\n\n    script_contents = read_script_from(initscript)\n    if version_is_pre_0_6_7\n      enabled_pre_0_6_7?(script_contents)\n    elsif version_is_pre_0_9_0\n      enabled_pre_0_9_0?(script_contents)\n    elsif version_is_post_0_9_0\n      enabled_post_0_9_0?(script_contents, read_override_file)\n    end\n  end\n\n  def enable\n    return super unless is_upstart?\n","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/service/upstart.rb#L106-L142","documentation":"Raised by Puppet's upstart service provider when it cannot locate any init artifact for the named service. The `search` method probes each defpath ('/etc/init', '/etc/init.d') with the suffixes '.conf', '', and '.sh'; if no file exists for the service name in any combination, Puppet::Error is raised. This almost always means the service name in the manifest does not match any installed job/init script.","triggerScenarios":"Declaring `service { 'foo': ... }` with the upstart provider selected (Ubuntu 10.04–14.04 era, or explicit `provider => upstart`) when /etc/init/foo.conf, /etc/init.d/foo, and /etc/init.d/foo.sh all do not exist. Also triggered by names with trailing arguments, since only the first whitespace-delimited token (`name.match(/^\\S+)/)`) is used as the file name.","commonSituations":"Typo'd or wrong service title in the manifest; the service package is not installed so no job file exists; using the upstart provider on a system where the service only ships a SysV script elsewhere; referencing a service by its long description rather than the job name.","solutions":["Check that the job actually exists: `ls /etc/init/<name>.conf /etc/init.d/<name>` on the node.","Fix the resource name to match the job/init script file name exactly (first token only — no arguments).","Ensure the package that ships the service is installed and ordered before the service resource (`require => Package[...]`).","If the system is not upstart-based, pin the correct provider (e.g., `provider => systemd` or `init`) instead of letting upstart be selected.","For custom daemons, ship an /etc/init/<name>.conf upstart job or /etc/init.d/<name> script yourself."],"exampleFix":"# before - no such job on the node\nservice { 'postgres': ensure => running }\n# after - correct job name shipped by the package, installed first\npackage { 'postgresql': ensure => installed }\nservice { 'postgresql':\n  ensure  => running,\n  require => Package['postgresql'],\n}","handlingStrategy":"validation","validationCode":"require 'puppet/util/filesystem'\nname = 'myjob'\nfound = ['/etc/init', '/etc/init.d'].any? do |dir|\n  ['.conf', '', '.sh'].any? { |s| Puppet::FileSystem.exist?(File.join(dir, name + s)) }\nend\nraise ArgumentError, 'no upstart job found' unless found","typeGuard":"def upstart_job_exists?(name)\n  name = name.split(/\\s+/).first.to_s\n  return false if name.empty?\n  ['/etc/init', '/etc/init.d'].any? { |d| ['.conf', '', '.sh'].any? { |s| File.exist?(File.join(d, name + s)) } }\nend","tryCatchPattern":null,"preventionTips":["Name service resources exactly after the job file (first whitespace token only).","Require the package that ships the job before the service resource.","Pin `provider =>` explicitly when the platform's init system is ambiguous."],"tags":["upstart","service-management","puppet","file-not-found"],"backgroundTag":"missing-service-init-script","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}