puppetlabs/puppet · error · Puppet::Error
Could not find init script or upstart conf file for '#{name}
Error message
Could not find init script or upstart conf file for '#{name}' What it means
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.
Source
Thrown at lib/puppet/provider/service/upstart.rb:124
def overscript
@overscript ||= initscript.gsub(/\.conf$/, ".override")
end
def search(name)
# Search prefers .conf as that is what upstart uses
[".conf", "", ".sh"].each do |suffix|
paths.each do |path|
service_name = name.match(/^(\S+)/)[1]
fqname = File.join(path, service_name + suffix)
if Puppet::FileSystem.exist?(fqname)
return fqname
end
debug("Could not find #{name}#{suffix} in #{path}")
end
end
raise Puppet::Error, "Could not find init script or upstart conf file for '#{name}'"
end
def enabled?
return super unless is_upstart?
script_contents = read_script_from(initscript)
if version_is_pre_0_6_7
enabled_pre_0_6_7?(script_contents)
elsif version_is_pre_0_9_0
enabled_pre_0_9_0?(script_contents)
elsif version_is_post_0_9_0
enabled_post_0_9_0?(script_contents, read_override_file)
end
end
def enable
return super unless is_upstart?
View on GitHub (pinned to e227c27540)
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.
Example fix
# before - no such job on the node
service { 'postgres': ensure => running }
# after - correct job name shipped by the package, installed first
package { 'postgresql': ensure => installed }
service { 'postgresql':
ensure => running,
require => Package['postgresql'],
} Defensive patterns
Strategy: validation
Validate before calling
require 'puppet/util/filesystem'
name = 'myjob'
found = ['/etc/init', '/etc/init.d'].any? do |dir|
['.conf', '', '.sh'].any? { |s| Puppet::FileSystem.exist?(File.join(dir, name + s)) }
end
raise ArgumentError, 'no upstart job found' unless found Type guard
def upstart_job_exists?(name)
name = name.split(/\s+/).first.to_s
return false if name.empty?
['/etc/init', '/etc/init.d'].any? { |d| ['.conf', '', '.sh'].any? { |s| File.exist?(File.join(d, name + s)) } }
end Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- One or more file(s) specified did not exist: %{files}
- File not found
- Fileset paths must exist
- binary_file(): The given file '%{unresolved_path}' does not
- Could not find %{path} on disk
AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21).
Data as JSON: /api/errors/89e517841efebf3e.
Report an issue: GitHub.