Skip to content

Error Codes

GhostTypes edited this page Nov 14, 2026 · 4 revisions

Error Codes Reference

This document provides a comprehensive reference for error codes across FlashForge API interfaces.

HTTP API Error Codes

The HTTP REST API (port 8898) uses a standard JSON response envelope for all endpoints.

Response Format

Success:

{
  "code": 0,
  "message": "Success"
}

Error:

{
  "code": <non-zero>,
  "message": "Error description"
}

HTTP API Code Reference

The HTTP status is always 200, also when the request fails. Read the code field in the JSON body. An unknown path is the only exception: it returns HTTP status 404.

Code Message Endpoint Cause
0 Success All The request worked.
-2 Lan mode error All except /notifyWanBind LAN-only mode is off. Only some firmware sends this code. See Authentication.
-1 Parameters is error All that take credentials, except /checkCode and /uploadGcode A credential field is missing, or the body is not valid JSON.
-1 Parameters is different /checkCode A credential field is missing.
1 SN is different All that take credentials The serial number is wrong.
1 Access code is different All that take credentials The check code is wrong.
2 Printer is busy /uploadGcode The printer is busy. The printer checks this before the credentials.
2 Printer is Busy. /printGcode The printer is not idle.
3 File does not exist. /printGcode The file is not on the printer.
-1 Parameter is error. /printGcode fileName or levelingBeforePrint is missing.
-1 File size is 0 /uploadGcode The fileSize header is 0.
-1 Content-type is error /uploadGcode The request is not multipart/form-data.
-1 Send file error /uploadGcode The printer could not save the file.
-1 thumbnail error /getThum No job is active, or the job has no thumbnail.

/control always returns 0 Success after the credential check passes. The printer does not report if the command did something. See HTTP REST API.

Handling Notes

  • Check code === 0 for success. Do not parse the message string.
  • The same code can have different messages. Use the endpoint and the message together to find the cause.
  • The messages contain spelling and case differences (for example Printer is busy and Printer is Busy.). Do not compare them as exact strings.

Common Error Scenarios

Code -2: LAN Mode Error

Cause: LAN-only mode is off on the printer.

Resolution: Turn on LAN-only mode on the printer. On some firmware you must also restart the printer. See Authentication.

Code 1: Wrong Credentials

Causes:

  • The serial number is wrong (SN is different).
  • The check code is wrong (Access code is different).
  • The user made a new check code on the printer.

Resolution: Read the serial number and the check code again on the printer screen.

Code 2: Printer Busy

Cause: A print or another task is active.

Resolution: Poll /detail until status is ready. Then send the request again.

Code 3: File Not Found

Cause: /printGcode names a file that is not on the printer.

Resolution: Use /gcodeList to get the file names.

IFS Error Codes (AD5X Only)

These errors appear in /detail responses or in blocking dialogs when you use the Material Station (Intelligent Filament System).

Feeding Errors

Code Description Trigger
E0100 Channel 1 feeding timeout Load failure (Slot 1)
E0101 Channel 2 feeding timeout Load failure (Slot 2)
E0102 Channel 3 feeding timeout Load failure (Slot 3)
E0103 Channel 4 feeding timeout Load failure (Slot 4)

Retraction Errors

Code Description Trigger
E0104 Channel 1 retracting timeout Unload failure (Slot 1)
E0105 Channel 2 retracting timeout Unload failure (Slot 2)
E0106 Channel 3 retracting timeout Unload failure (Slot 3)
E0107 Channel 4 retracting timeout Unload failure (Slot 4)

System Errors

Code Description Trigger
E0108 Feed failure to extruder Filament sensor timeout during feed
E0109 Odometer stall Filament tangle or jam (stall count > 200)
E0114 IFS homing error Selector mechanism failure

TCP Protocol Errors

Legacy TCP commands (port 8899) return plain text error messages.

The messages below are for the Adventurer 5M series and the AD5X. The Creator 5 has no TCP service.

Session Errors

Error Message Description
CMD M601 Received. + Control failed. Another client has the control session.

Resolution: Wait for the other session to time out, or send M602 from that client.

File Upload Errors

Error Message Description
File Is Not Aviable M29: the received data does not match the size in M28. The printer spells the message this way.

Resolution: Make sure that the file size matches the M28 value. Then send the file again.

Unknown Commands

The printer does not reject an unknown command. It replies CMD Mxxx Received. and ok, and it does nothing. A reply of ok does not prove that the printer supports the command. See TCP Protocol for the supported commands.

Note: The Adventurer 3 and Adventurer 4 can use other messages. These printers are not covered here.

Detail Response Error Fields

The /detail endpoint may include error information in the response:

{
  "detail": {
    "errorCode": "E0100",
    "status": "error"
  }
}

Checking for Errors

  1. Check status field for value "error"
  2. Inspect errorCode field for specific error code
  3. Cross-reference with error tables above

Error Recovery Strategies

HTTP API Errors

Code Strategy
-2 Ask the user to turn on LAN-only mode. Do not retry until the mode changes
-1 Fix the request. Do not retry the same request
1 Ask the user for the correct serial number or check code. Do not retry
2 Poll /detail until status is ready, then retry
3 Get the file names with /gcodeList

TCP Errors

Error Strategy
Control failed. Wait 30 seconds and retry connection
File Is Not Aviable Verify file integrity, retransmit

IFS Errors

Strategy Implementation
Poll status Check matlStationInfo.stateAction during operations
Retry with backoff Implement exponential backoff for transient errors
User notification Display actionable error messages to users
Recovery commands Use ms_cmd with action 2 (cancel) to stop a failed operation

Best Practices

Error Handling

  1. Always check response code field, not just HTTP status
  2. Retry with exponential backoff only for code 2 (busy)
  3. Log error codes for debugging and support
  4. Display user-friendly messages based on error context

Timeout Handling

For long-running operations:

  • Use appropriate timeouts (30-60 seconds for most operations)
  • Implement progress polling for file uploads
  • Reconnect and retry requests when the network disconnects.

IFS-Specific Handling

For AD5X material station operations:

  1. Check matlStationInfo.stateAction before starting operations
  2. Monitor state during multi-step operations
  3. Implement error recovery workflows
  4. Clear errors using errorCodeCtrl_cmd if available

Clone this wiki locally