Skip to content

Debug your tasks

Debug your app on iExec

Sometimes things don't work out right the first time and you may need to debug your application.

  • Get debug information of a task
bash
iexec task debug <taskid>

It allows anyone to know on-chain and off-chain statuses of the task.

  • Get debug logs of a task
bash
iexec task debug <taskid> --logs

It allows the requester to retrieve application logs produced by workers.

Off-chain statuses

Task statuses

During its execution, a task transitions between different off-chain statuses. Those statuses let you track how a task progresses when it's being executed and makes it easier for you to debug if the execution fails. The transitions between those statuses are as follows.

WARNING

Please note that, for the sake of simplicity, transitions to the FINAL_DEADLINE_REACHED status have not been pictured. In fact, all statuses except final statuses (FAILED and COMPLETED) can lead to this FINAL_DEADLINE_REACHED status.

As a reminder, tasks have a max execution time, defined by their category. Their final deadlines are defined as follows: deal start time + max execution time. When a task update is triggered on a Scheduler for a non-completed non-failed task while its final deadline is met, then this task status transitions to FINAL_DEADLINE_REACHED.

Below the description of each status:

Task statusDescription
RECEIVEDThe Scheduler has detected the deal
INITIALIZINGThe Scheduler is trying to set the task on-chain status to INITIALIZED
INITIALIZEDThe task on-chain status has been correctly set to INITIALIZED
RUNNINGAt least one Worker has started to work on the task
CONSENSUS_REACHEDThe consensus has been reached
AT_LEAST_ONE_REVEALEDAt least one Worker revealed its result
RESULT_UPLOADINGThe selected Worker is uploading its result
RESULT_UPLOADEDThe result has been uploaded
FINALIZINGThe Scheduler is trying to set the task on-chain status to FINALIZED
FINALIZEDThe task on-chain status has been correctly set to FINALIZED

However, things sometimes don't work as expected. In that case, failure statuses help to understand what went wrong:

Task statusDescription
INITIALIZE_FAILEDTask on-chain initialization failed
RUNNING_FAILEDAll Workers have failed to run this TEE task
CONTRIBUTION_TIMEOUTContribution deadline has been reached before any contribution has been sent
RESULT_UPLOAD_TIMEOUTThe final deadline has been reached while the result was being uploaded
FINALIZE_FAILEDTask on-chain finalization failed
FINAL_DEADLINE_REACHEDThe final deadline has been reached
FAILEDFinal status for any previous failure

Replicate statuses

One task bought by a requester will result in one off-chain task with one or more replicates depending on the level of trust set by the requester. For a given task, each worker involved in the computation will have its own replicate containing the description of the task to compute. The whole computation of a replicate is made of several stages. Each stage completed by a worker will result in an update of its replicate status.

The links between a task to its replicates can be represented as follows:

bash
task1
├── replicate1 (workerX)
├── replicate2 (workerY)
└── replicate3 (workerZ)

A replicate status workflow can follow two different flows:

  1. Usual flow (default): the task is replicated on a number of workers, depending on required trust. The Scheduler has to notify the workers when the consensus is reached. It should also finalize the task on-chain.
  2. Optimized flow (under conditions): the task is finalized by the only worker that has worked on it. It makes the task execution faster and cheaper. However, some limitations apply:
    1. The worker has to be trustworthy. To achieve this point, only TEE tasks are eligible to this workflow.
    2. Callback mode is currently unsupported. iExec strives to remove this limitation.

See the following flowchart for details on their transitions.

WARNING

Please note that all failed status - pictured in red in the above diagram - finally lead to ABORTED. For the sake of simplicity, this final status has not been represented here.

While the task holds a meta status, each replicate has its own status which can be one of these:

Replicate statusDescription
CREATEDA new replicate is assigned to a worker just after it asked for more work
STARTINGThe worker starts preflight checks to confirm it can work on this replicate
STARTEDThe worker confirms it is going to work on this replicate
START_FAILEDThe preflight checks have failed. The worker will NOT work on this replicate
APP_DOWNLOADINGThe worker is downloading the application
APP_DOWNLOADEDThe download of the application is completed
APP_DOWNLOAD_FAILEDThe download of the application failed
DATA_DOWNLOADINGThe worker is downloading the dataset
DATA_DOWNLOADEDThe download of the dataset is completed
DATA_DOWNLOAD_FAILEDThe download of the dataset failed
COMPUTINGThe worker is computing the task
COMPUTEDThe computation is completed
COMPUTE_FAILEDThe computation failed
CONTRIBUTINGThe worker sent the "contribute(..)" transaction (result digest) on chain
CONTRIBUTE_FAILEDThe contribute transaction failed
CONTRIBUTEDThe worker has contributed on chain
REVEALINGThe worker sent the "reveal(..)" transaction (proof that he is the owner of the result digest)
REVEALEDThe worker has revealed the proof on chain
REVEAL_FAILEDThe reveal transaction failed
RESULT_UPLOAD_REQUESTEDThe worker has been requested to upload the result to a remote filesystem
RESULT_UPLOADINGThe worker is uploading the result
RESULT_UPLOAD_FAILEDThe upload of the result failed
RESULT_UPLOADEDThe result has been uploaded to IPFS over the iExec Result Proxy (standard or TEE tasks) or to Dropbox (TEE only), dependending on the deal parameters
CONTRIBUTE_AND_FINALIZE_ONGOINGThe worker sent the "contributeAndFinalize(...)" transaction on chain
CONTRIBUTE_AND_FINALIZE_DONEThe worker has contributed and finalized the task. The latter is now considered as completed on-chain
CONTRIBUTE_AND_FINALIZE_FAILEDThe contributeAndFinalize transaction failed
COMPLETINGThe task is finalized, the worker will purge data related to its replicate
COMPLETEDThe whole task is completed meaning the task is finalized. The worker has been rewarded if it is part of the consensus
COMPLETE_FAILEDThe worker failed to clean the local replicate resources after the task is finalized
FAILEDThe worker failed to participate to the task
ABORTEDThe scheduler asked the worker to stop working on this replicate while the latter was still working on it
RECOVERINGThe worker has been stopped, it is starting back from where it stopped
WORKER_LOSTThe worker didn't ping the iexec-core scheduler for a while. It is considered as out for this task

Off-chain replicates failure causes

When a worker fails to complete a replicate, it returns a failure cause. This cause is helpful to understand what went wrong.

Failures detected by the Scheduler

Replicate failure causeDescription
REVEAL_TIMEOUTThe worker took too long to reveal its proof (more than 2 periods after the consensus)

Failures from Worker

A replicate can fail with the following causes:

Common failures
Replicate failure causeReplicate statusDescription
CHAIN_UNREACHABLESTARTING, APP_DOWNLOADING, DATA_DOWNLOADING, COMPUTING, CONTRIBUTINGThe task model could not be fetched from the blockchain
STAKE_TOO_LOWSTARTING, APP_DOWNLOADING, DATA_DOWNLOADING, COMPUTING, CONTRIBUTINGWorker deposit is too low
TASK_NOT_ACTIVESTARTING, APP_DOWNLOADING, DATA_DOWNLOADING, COMPUTING, CONTRIBUTINGOn-chain task status is not ACTIVE
CONTRIBUTION_TIMEOUTSTARTING, APP_DOWNLOADING, DATA_DOWNLOADING, COMPUTING, CONTRIBUTINGContribution deadline has already been reached
CONTRIBUTION_ALREADY_SETSTARTING, APP_DOWNLOADING, DATA_DOWNLOADING, COMPUTING, CONTRIBUTINGThe worker has already contributed
WORKERPOOL_AUTHORIZATION_NOT_FOUNDSTARTING, APP_DOWNLOADING, DATA_DOWNLOADING, COMPUTING, CONTRIBUTINGThe authorization to contribute to the task is missing
APP_IMAGE_DOWNLOAD_FAILEDAPP_DOWNLOADINGThe download of the application image failed
APP_NOT_FOUND_LOCALLYCOMPUTINGThe application image could not be found on the worker
APP_COMPUTE_FAILEDCOMPUTINGThe application execution failed
POST_COMPUTE_COMPUTED_FILE_NOT_FOUNDCOMPUTINGThe computed.json file could not be found
POST_COMPUTE_RESULT_DIGEST_COMPUTATION_FAILEDCOMPUTINGThe result digest could not be computed from the computed.json file
POST_COMPUTE_TOO_LONG_RESULT_FILE_NAMECOMPUTINGOne or more of the result files name exceed the limit of 31 characters
POST_COMPUTE_OUT_FOLDER_ZIP_FAILEDCOMPUTINGpost-compute failed to zip the output folder resulting from the computation
POST_COMPUTE_SEND_COMPUTED_FILE_FAILEDCOMPUTINGFailed to post computed.json to worker
OUT_OF_GASCONTRIBUTING, REVEALINGThe worker needs some ETH, please refill its wallet
DETERMINISM_HASH_NOT_FOUNDCONTRIBUTING, REVEALINGThe result digest could not be read from the computed.json file
CHAIN_RECEIPT_NOT_VALIDCONTRIBUTING, REVEALINGThe transaction failed on the blockchain
CONSENSUS_BLOCK_MISSINGREVEALINGThe consensus block number was not part of the PLEASE_REVEAL notification
BLOCK_NOT_REACHEDREVEALINGThe worker has not reached the consensus block
CANNOT_REVEALREVEALINGOne of the mandatory condition was not met. Reveal cannot happen
RESULT_LINK_MISSINGUPLOADINGNo result link has been provided by the worker
Specific failures for standard tasks
Replicate failure causeReplicate statusDescription
TASK_DESCRIPTION_INVALIDSTARTINGThe task description contains inconsistencies and cannot be executed
DATASET_FILE_DOWNLOAD_FAILEDDATA_DOWNLOADINGDataset download failed
DATASET_FILE_BAD_CHECKSUMDATA_DOWNLOADINGDownloaded dataset checksum does not match on-chain provided checksum
INPUT_FILES_DOWNLOAD_FAILEDDATA_DOWNLOADINGAt least one input file could not be downloaded
Specific failures for TEE tasks
Replicate failure causeReplicate statusDescription
TEE_NOT_SUPPORTEDSTARTINGThe current worker does not support TEE tasks. It may not be well configured or not compatible at all
UNKNOWN_SMSSTARTINGSMS URL could not be resolved for this task
GET_TEE_SERVICES_CONFIGURATION_FAILEDSTARTINGFailed to fetch TEE task configuration properties from SMS
TEE_PREPARATION_FAILEDCOMPUTINGTEE task preparation step could not be completed, task cannot be executed by the worker
TEE_SESSION_GENERATION_INVALID_AUTHORIZATIONCOMPUTINGThe worker could not authenticate to the SMS
TEE_SESSION_GENERATION_EXECUTION_NOT_AUTHORIZED_EMPTY_PARAMS_UNAUTHORIZEDCOMPUTINGThe parameters provided by the worker do not allow the TEE session generation
TEE_SESSION_GENERATION_EXECUTION_NOT_AUTHORIZED_NO_MATCH_ONCHAIN_TYPECOMPUTINGThe provided task ID does not match with a TEE task on-chain
TEE_SESSION_GENERATION_EXECUTION_NOT_AUTHORIZED_GET_CHAIN_TASK_FAILEDCOMPUTINGThe associated task could not be retrieved on-chain
TEE_SESSION_GENERATION_EXECUTION_NOT_AUTHORIZED_TASK_NOT_ACTIVECOMPUTINGThe task is not active on chain
TEE_SESSION_GENERATION_EXECUTION_NOT_AUTHORIZED_GET_CHAIN_DEAL_FAILEDCOMPUTINGThe associated deal could not be retrieved on-chain
TEE_SESSION_GENERATION_EXECUTION_NOT_AUTHORIZED_INVALID_SIGNATURECOMPUTINGThe provided authorization has not been signed by the correct workerpool owner
TEE_SESSION_GENERATION_PRE_COMPUTE_GET_DATASET_SECRET_FAILEDCOMPUTINGDataset secret could not be fetched from the SMS database
TEE_SESSION_GENERATION_APP_COMPUTE_NO_ENCLAVE_CONFIGCOMPUTINGApplication enclave configuration could not be read from on-chain app description
TEE_SESSION_GENERATION_APP_COMPUTE_INVALID_ENCLAVE_CONFIGCOMPUTINGApplication enclave configuration could not be validated. At least one item between the entrypoint, the heap size or the fingerprint of the app enclave description is not correct
TEE_SESSION_GENERATION_POST_COMPUTE_GET_ENCRYPTION_TOKENS_FAILED_EMPTY_BENEFICIARY_KEYCOMPUTINGBeneficiary result encryption key could not be fetched from the SMS database
TEE_SESSION_GENERATION_POST_COMPUTE_GET_STORAGE_TOKENS_FAILEDCOMPUTINGResults storage (IPFS or Dropbox) token could not be fetched from the SMS database
TEE_SESSION_GENERATION_POST_COMPUTE_GET_SIGNATURE_TOKENS_FAILED_EMPTY_WORKER_ADDRESSCOMPUTINGThe worker address is missing to compute the enclave signature
TEE_SESSION_GENERATION_POST_COMPUTE_GET_SIGNATURE_TOKENS_FAILED_EMPTY_PUBLIC_ENCLAVE_CHALLENGECOMPUTINGThe enclave challenge is missing for the enclave signature computation
TEE_SESSION_GENERATION_POST_COMPUTE_GET_SIGNATURE_TOKENS_FAILED_EMPTY_TEE_CHALLENGECOMPUTINGThe TEE challenge is missing for the enclave signature computation
TEE_SESSION_GENERATION_POST_COMPUTE_GET_SIGNATURE_TOKENS_FAILED_EMPTY_TEE_CREDENTIALSCOMPUTINGThe TEE credentials are missing for the enclave signature computation
TEE_SESSION_GENERATION_SECURE_SESSION_STORAGE_CALL_FAILEDCOMPUTINGThe TEE session could not be posted on the secure session storage
TEE_SESSION_GENERATION_SECURE_SESSION_GENERATION_FAILEDCOMPUTINGThe TEE session could not be generated but the SMS can't provide the reason
TEE_SESSION_GENERATION_SECURE_SESSION_NO_TEE_PROVIDERCOMPUTINGNo TEE provider has been found on the task description
TEE_SESSION_GENERATION_GET_TASK_DESCRIPTION_FAILEDCOMPUTINGThe task description could not be read on-chain
TEE_SESSION_GENERATION_NO_SESSION_REQUESTCOMPUTINGThe TEE session request was empty
TEE_SESSION_GENERATION_NO_TASK_DESCRIPTIONCOMPUTINGThe task description has not been found in the TEE session request
TEE_SESSION_GENERATION_UNKNOWN_ISSUECOMPUTINGThe TEE session could not be generated but the SMS hasn't provided any reason
PRE_COMPUTE_INVALID_ENCLAVE_CONFIGURATIONCOMPUTINGApplication enclave configuration is invalid
PRE_COMPUTE_INVALID_ENCLAVE_HEAP_CONFIGURATIONCOMPUTINGApplication requested HEAP size is bigger than maximum allocatable memory
PRE_COMPUTE_IMAGE_MISSINGCOMPUTINGThe pre-compute image could not be found on the worker
PRE_COMPUTE_TASK_ID_MISSINGCOMPUTINGThe IEXEC_TASK_ID environment variable could not be resolved from the pre-compute container
PRE_COMPUTE_EXIT_REPORTING_FAILEDCOMPUTINGThe pre-compute container failed to post its failure cause to the worker
PRE_COMPUTE_OUTPUT_PATH_MISSINGCOMPUTINGThe IEXEC_PRE_COMPUTE_OUT environment variable could not be resolved from the pre-compute container
PRE_COMPUTE_IS_DATASET_REQUIRED_MISSINGCOMPUTINGThe IS_DATASET_REQUIRED environment variable could not be resolved from the pre-compute container
PRE_COMPUTE_DATASET_URL_MISSINGCOMPUTINGThe IEXEC_DATASET_URL environment variable could not be resolved from the pre-compute container
PRE_COMPUTE_DATASET_KEY_MISSINGCOMPUTINGThe IEXEC_DATASET_KEY environment variable could not be resolved from the pre-compute container
PRE_COMPUTE_DATASET_CHECKSUM_MISSINGCOMPUTINGThe IEXEC_DATASET_CHECKSUM environment variable could not be resolved from the pre-compute container
PRE_COMPUTE_DATASET_FILENAME_MISSINGCOMPUTINGThe IEXEC_DATASET_FILENAME environment variable could not be resolved from the pre-compute container
PRE_COMPUTE_INPUT_FILES_NUMBER_MISSINGCOMPUTINGThe IEXEC_INPUT_FILES_NUMBER environment variable could not be resolved from the pre-compute container
PRE_COMPUTE_AT_LEAST_ONE_INPUT_FILE_URL_MISSINGCOMPUTINGAt least one environment variable starting with IEXEC_INPUT_FILE_URL_ prefix could not be resolve from the pre-compute container
PRE_COMPUTE_OUTPUT_FOLDER_NOT_FOUNDCOMPUTINGThe folder to store the dataset or input files could not be found
PRE_COMPUTE_DATASET_DOWNLOAD_FAILEDCOMPUTINGThe pre-compute failed to download the dataset
PRE_COMPUTE_INVALID_DATASET_CHECKSUMCOMPUTINGThe downloaded dataset checksum does not match the expected one
PRE_COMPUTE_DATASET_DECRYPTION_FAILEDCOMPUTINGThe downloaded dataset decryption failed
PRE_COMPUTE_SAVING_PLAIN_DATASET_FAILEDCOMPUTINGThe decrypted dataset could not be saved in the enclave
PRE_COMPUTE_INPUT_FILE_DOWNLOAD_FAILEDCOMPUTINGThe pre-commpute failed to download at least one input file
PRE_COMPUTE_TIMEOUTCOMPUTINGThe pre-compute did not complete on time
PRE_COMPUTE_FAILED_UNKNOWN_ISSUECOMPUTINGThe pre-compute failed for an unknown cause
POST_COMPUTE_IMAGE_MISSINGCOMPUTINGThe post-compute image could not be found on the worker
POST_COMPUTE_TASK_ID_MISSINGCOMPUTINGThe RESULT_TASK_ID environment variable could not be resolved from the post-compute container
POST_COMPUTE_EXIT_REPORTING_FAILEDCOMPUTINGThe post-compute container failed to post its failure cause to the worker
POST_COMPUTE_WORKER_ADDRESS_MISSINGCOMPUTINGThe RESULT_SIGN_WORKER_ADDRESS environment variable could not be resolved from the post-compute container
POST_COMPUTE_TEE_CHALLENGE_PRIVATE_KEY_MISSINGCOMPUTINGThe RESULT_SIGN_TEE_CHALLENGE_PRIVATE_KEY environment variable could not be resolved from the post-compute container
POST_COMPUTE_ENCRYPTION_PUBLIC_KEY_MISSINGCOMPUTINGThe RESULT_ENCRYPTION_PUBLIC_KEY environment variable could not be resolved from the post-compute container
POST_COMPUTE_STORAGE_TOKEN_MISSINGCOMPUTINGThe RESULT_STORAGE_TOKEN environment variable could not be resolved from the post-compute container
POST_COMPUTE_ENCRYPTION_FAILEDCOMPUTINGResults encryption failed in post-compute container
POST_COMPUTE_RESULT_FILE_NOT_FOUNDCOMPUTINGLocal result file to upload could not be found
POST_COMPUTE_DROPBOX_UPLOAD_FAILEDCOMPUTINGUpload to DROPBOX failed
POST_COMPUTE_IPFS_UPLOAD_FAILEDCOMPUTINGUpload to IPFS failed
POST_COMPUTE_INVALID_TEE_SIGNATURECOMPUTINGThe provided signed TEE challenge is invalid
POST_COMPUTE_TIMEOUTCOMPUTINGThe post-compute did not complete on time
POST_COMPUTE_FAILED_UNKOWN_ISSUECOMPUTINGThe post-compute failed for an unknown cause
ENCLAVE_SIGNATURE_NOT_FOUNDCONTRIBUTINGThe enclave signature could not be found for the result. The worker will not contribute