Module: PuppetX::PuppetLabs::ScheduledTask::Error

Defined in:
lib/puppet_x/puppetlabs/scheduled_task/error.rb

Overview

module PuppetX::PuppetLabs::ScheduledTask::Error

Constant Summary collapse

MAX_32_BIT_VALUE =

from C:Program Files (x86)Windows Kits8.1Includesharedwinerror.h

0xFFFFFFFF
ERROR_FILE_NOT_FOUND =

The system cannot find the file specified. WIN32 Error Code 2L (0x2)

0x80070002
ERROR_NONE_MAPPED =

No mapping between account names and security IDs was done. WIN32 Error CODE 1332L (0x534)

0x80070534
SCHED_E_SERVICE_NOT_LOCALSYSTEM =

The Task Scheduler service must be configured to run in the System account to function properly. Individual tasks may be configured to run in other accounts. Win32 Error Code 6200L (0xA28)

0x80070A28
E_INVALIDARG =

One or more arguments are invalid

0x80070057
SCHED_S_TASK_READY =

The task is ready to run at its next scheduled time.

0x00041300
SCHED_S_TASK_RUNNING =

The task is currently running.

0x00041301
SCHED_S_TASK_DISABLED =

The task will not run at the scheduled times because it has been disabled.

0x00041302
SCHED_S_TASK_HAS_NOT_RUN =

The task has not yet run.

0x00041303
SCHED_S_TASK_NO_MORE_RUNS =

There are no more runs scheduled for this task.

0x00041304
SCHED_S_TASK_NOT_SCHEDULED =

One or more of the properties that are needed to run this task on a schedule have not been set.

0x00041305
SCHED_S_TASK_TERMINATED =

The last run of the task was terminated by the user.

0x00041306
SCHED_S_TASK_NO_VALID_TRIGGERS =

Either the task has no triggers or the existing triggers are disabled or not set.

0x00041307
SCHED_S_EVENT_TRIGGER =

Event triggers don’t have set run times.

0x00041308
SCHED_E_TRIGGER_NOT_FOUND =

Trigger not found.

0x80041309
SCHED_E_TASK_NOT_READY =

One or more of the properties that are needed to run this task have not been set.

0x8004130A
SCHED_E_TASK_NOT_RUNNING =

There is no running instance of the task.

0x8004130B
SCHED_E_SERVICE_NOT_INSTALLED =

The Task Scheduler Service is not installed on this computer.

0x8004130C
SCHED_E_CANNOT_OPEN_TASK =

The task object could not be opened.

0x8004130D
SCHED_E_INVALID_TASK =

The object is either an invalid task object or is not a task object.

0x8004130E
SCHED_E_ACCOUNT_INFORMATION_NOT_SET =

No account information could be found in the Task Scheduler security database for the task indicated.

0x8004130F
SCHED_E_ACCOUNT_NAME_NOT_FOUND =

Unable to establish existence of the account specified.

0x80041310
SCHED_E_ACCOUNT_DBASE_CORRUPT =

Corruption was detected in the Task Scheduler security database; the database has been reset.

0x80041311
SCHED_E_NO_SECURITY_SERVICES =

Task Scheduler security services are available only on Windows NT.

0x80041312
SCHED_E_UNKNOWN_OBJECT_VERSION =

The task object version is either unsupported or invalid.

0x80041313
SCHED_E_UNSUPPORTED_ACCOUNT_OPTION =

The task has been configured with an unsupported combination of account settings and run time options.

0x80041314
SCHED_E_SERVICE_NOT_RUNNING =

The Task Scheduler Service is not running.

0x80041315
SCHED_E_UNEXPECTEDNODE =

The task XML contains an unexpected node.

0x80041316
SCHED_E_NAMESPACE =

The task XML contains an element or attribute from an unexpected namespace.

0x80041317
SCHED_E_INVALIDVALUE =

The task XML contains a value which is incorrectly formatted or out of range.

0x80041318
SCHED_E_MISSINGNODE =

The task XML is missing a required element or attribute.

0x80041319
SCHED_E_MALFORMEDXML =

The task XML is malformed.

0x8004131A
SCHED_S_SOME_TRIGGERS_FAILED =

The task is registered, but not all specified triggers will start the task, check task scheduler event log for detailed information.

0x0004131B
SCHED_S_BATCH_LOGON_PROBLEM =

The task is registered, but may fail to start. Batch logon privilege needs to be enabled for the task principal.

0x0004131C
SCHED_E_TOO_MANY_NODES =

The task XML contains too many nodes of the same type.

0x8004131D
SCHED_E_PAST_END_BOUNDARY =

The task cannot be started after the trigger’s end boundary.

0x8004131E
SCHED_E_ALREADY_RUNNING =

An instance of this task is already running.

0x8004131F
SCHED_E_USER_NOT_LOGGED_ON =

The task will not run because the user is not logged on.

0x80041320
SCHED_E_INVALID_TASK_HASH =

The task image is corrupt or has been tampered with.

0x80041321
SCHED_E_SERVICE_NOT_AVAILABLE =

The Task Scheduler service is not available.

0x80041322
SCHED_E_SERVICE_TOO_BUSY =

The Task Scheduler service is too busy to handle your request. Please try again later.

0x80041323
SCHED_E_TASK_ATTEMPTED =

The Task Scheduler service attempted to run the task, but the task did not run due to one of the constraints in the task definition.

0x80041324
SCHED_S_TASK_QUEUED =

The Task Scheduler service has asked the task to run.

0x00041325
SCHED_E_TASK_DISABLED =

The task is disabled.

0x80041326
SCHED_E_TASK_NOT_V1_COMPAT =

The task has properties that are not compatible with previous versions of Windows.

0x80041327
SCHED_E_START_ON_DEMAND =

The task settings do not allow the task to start on demand.

0x80041328
SCHED_E_TASK_NOT_UBPM_COMPAT =

The combination of properties that task is using is not compatible with the scheduling engine.

0x80041329
SCHED_E_DEPRECATED_FEATURE_USED =

The task definition uses a deprecated feature.

0x80041330
PLA_E_TASKSCHED_CHANNEL_NOT_ENABLED =

The Event Log channel Microsoft-Windows-TaskScheduler must be enabled to perform this operation.

0x80300111

Class Method Summary collapse

Class Method Details

.com_error_type?(win_32_ole_runtime_error, hresult) ⇒ Boolean

Checks if an error is a COM Error

Returns:

  • (Boolean)


23
24
25
26
27
28
29
# File 'lib/puppet_x/puppetlabs/scheduled_task/error.rb', line 23

def self.com_error_type?(win_32_ole_runtime_error, hresult)
  # to_s(16) does not include 0x prefix
  # assume actual hex for error is what message contains - i.e. 80070002
  return true if win_32_ole_runtime_error.message.match?(%r{#{hresult.to_s(16)}})
  # if not, look for 2s complement (negative value) - i.e. -2147024894
  win_32_ole_runtime_error.message =~ %r{#{to_signed_value(hresult)}}m
end

.to_signed_value(hresult) ⇒ Object

Returnes the signed value



18
19
20
# File 'lib/puppet_x/puppetlabs/scheduled_task/error.rb', line 18

def self.to_signed_value(hresult)
  -(-hresult & MAX_32_BIT_VALUE)
end