Troubleshooting Guide
This guide provides solutions to common issues you might encounter when working with the Service API, including error code explanations, troubleshooting steps, and logging information.
1. Error Codes
The Service API uses a consistent set of error codes across both SOAP and REST interfaces.
1.1. Common Error Codes
| Code | Description | Troubleshooting Steps |
|---|---|---|
201 |
No device |
Verify the device serial number is correct and the device exists in the ACS |
202 |
No DB |
Database connection issue - check database configuration and connectivity |
203 |
Incorrect request structure |
Check your request format against the API documentation |
204 |
General error |
Several causes share this code. Use the |
205 |
No ACS |
ACS connection issue - verify ACS URL and credentials |
210 |
Service API could not authenticate to Northbound API |
Check the Northbound API credentials in FT Configs. See Error 210 |
401 |
Authentication failure |
Check your API credentials and ensure they have not expired |
403 |
Authorization error |
Verify the user has appropriate permissions for the requested operation |
404 |
Resource not found |
Ensure the requested resource (device, service, etc.) exists |
409 |
Conflict |
Operation cannot be performed in current state - check business rules |
500 |
Internal server error |
Review server logs for detailed error information |
1.2. SOAP-Specific Errors
| Code | Description | Troubleshooting Steps |
|---|---|---|
SOAP-ENV:Client |
Client-side error |
Check your request format and parameters |
SOAP-ENV:Server |
Server-side error |
Server encountered an unexpected error - check logs |
SOAP-ENV:MustUnderstand |
Required header missing |
Add the required SOAP header to your request |
SOAP-ENV:VersionMismatch |
SOAP version mismatch |
Ensure you’re using the correct SOAP version |
1.3. REST-Specific Status Codes
| Status | Description | Troubleshooting Steps |
|---|---|---|
400 |
Bad Request |
Check request format and parameters for errors |
401 |
Unauthorized |
Authentication failed - verify credentials |
403 |
Forbidden |
User lacks permission for the requested operation |
404 |
Not Found |
Resource does not exist |
405 |
Method Not Allowed |
The HTTP method is not supported for this endpoint |
409 |
Conflict |
Business rule violation - operation cannot be performed |
429 |
Too Many Requests |
Rate limit exceeded - slow down request rate |
500 |
Internal Server Error |
Server-side error - check logs for details |
503 |
Service Unavailable |
Service is temporarily unavailable - try again later |
2. Common Issues
2.1. Authentication Problems
2.1.1. SOAP Authentication Failures
Issue: SOAP requests fail with authentication errors.
Solution: * Ensure WS-Security headers are correctly formatted * Verify username and password are correct * Check if the account is locked or disabled
2.1.2. JWT Token Issues
Issue: JWT token is rejected.
Solution: * Verify the token has not expired * Ensure you’re using the correct token format (Bearer) * Check if the token has been revoked * Request a new token
2.1.3. SOAP Error 210: Northbound API Authentication
Issue: A SOAP response has status Failed and response code 210.
Service API could not authenticate to Northbound API (NBI).
The message depends on the credentials state at the time of the call.
| State | Message |
|---|---|
Credentials configured |
|
Credentials not configured |
|
Solution:
-
Find the WARN line in the Service API application log. See Log Locations. Search for
nbi authentication rejected|nbi token request failed. For JWT, a token request line can come first. -
Read the fields
nbiAuthConfigured,nbiAuthType,nbiLogin,nbiErrorCode, andnbiMessage. -
If
nbiAuthConfigured=false, set the login and the password in FT Configs. See Northbound API credentials. -
If
nbiAuthTypedoes not match the NBI inbound mode, change the authentication method. Follow the order in Change the NBI inbound authentication mode. -
If the scheme matches, check the password, the user state, and the user domain in NBI. A user with the wrong domain (
ispMode=0) is a cause of 210 with JWT. -
For JWT, request a token with the same credentials. This check needs
curlandjq. See Verify the credentials before you use JWT.
Service API writes these log lines:
nbi authentication rejected status=401 nbiErrorCode=<n|none> nbiMessage="<NBI message>" nbiAuthConfigured=<true|false> nbiAuthType=<BASIC|JWT|none> nbiLogin=<login|none>
nbi token request failed status=<n|io> nbiErrorCode=<n|none> nbiMessage="<NBI message>" nbiLogin=<login> [error=<cause class>]
If the token request fails on the network, status=io and nbiErrorCode=none.
Then the line has the field error=<cause class>. For example, error=HttpTimeoutException or error=ConnectException.
The field shows the Java class of the network error. Use it to tell a timeout from a refused connection.
The search string in step 1 also matches the token request line of a network failure.
If status=io, the cause is a network failure and the SOAP response is 204.
The SOAP response is 210 only if status=401, or if status=200 and nbiErrorCode is an authentication code (401, 9000, 9017, 9018, 9021, 9060 or 9065).
Any other status= value means a 204. See SOAP Error 204: General Error from Northbound API.
The password and the token never appear in the log.
Service API removes control characters from nbiMessage and cuts it at 200 characters.
To tell a scheme mismatch from a wrong password, compare nbiAuthType with the NBI inbound mode.
If the NBI inbound mode is Basic and nbiAuthType=JWT, the scheme does not match.
If the NBI inbound mode is JWT and nbiAuthType=BASIC, the scheme does not match.
If the NBI inbound mode is Both, the scheme always matches.
Read nbiMessage for the reason that NBI gives.
If the scheme matches, the password, the user state, or the user domain is wrong.
To fix a mismatch, follow Change the NBI inbound authentication mode.
Related cases:
-
If the token request times out or fails on the network, the SOAP response is
Failedwith code 204, not 210. See Token request fails on the network. -
If NBI returns a token in an invalid format, see Error 204.
-
If the NBI user has the wrong domain, Basic returns "No CPE" errors. NBI reports that it finds no device for this user. JWT returns 210.
-
If JWT is selected and NBI authentication is OFF, a wrong password still returns 210. If Basic is selected, NBI ignores the Basic credentials while its authentication is OFF, so the call succeeds.
2.1.4. SOAP Error 204: General Error from Northbound API
Issue: A SOAP response has status Failed and response code 204 (GENERAL).
Code 204 has several meanings.
204 GENERAL is also used by other Service API failures.
Use the Message text to find the case in the table below.
If the Message matches no row, check the Service API log around the time of the call.
Then find the matching WARN line in the Service API application log. See Log Locations.
| Message | Cause | Next step |
|---|---|---|
|
NBI answered with HTTP 5xx and an empty or unreadable body. WARN line: |
Try again later. If the error stays, check the NBI log for the cause. |
|
NBI answered with HTTP 4xx (not 401) and an empty or unreadable body. The WARN line is the same as for 5xx. The NBI URL can point to another service, or the NBI version has no such method. |
Do not retry. Check |
|
The token request returned a reply that is not a token. WARN line: |
Check |
|
The token request returned HTTP 404 without an NBI error. Either |
First check that |
|
NBI answered with an HTTP 3xx redirect. |
Set |
|
NBI returned an error code that Service API does not know. Service API shows the NBI message. It removes control characters and cuts the text at 200 characters. |
Look up the code in the NBI log or the NBI documentation. |
|
The same case, and NBI sent no message. |
The same step. |
An NBI error reply can carry the success code 100.
Service API never returns Completed with code 100 in this case.
It returns 204 with the "could not process" or "rejected" text from the table.
The WARN line is nbi error reply with a success error code status= method= path=.
If NBI returns a known error code without a message, Service API returns that code with its standard description.
Token request fails on the network
For JWT, Service API first requests a token.
The connection to NBI times out after 5 seconds.
The wait for the token reply times out after 10 seconds.
If the request times out or fails, the SOAP response has status Failed and code 204 (GENERAL).
The Message depends on the operation.
It is General error or the text of the network error.
The code stays 204 in both cases.
Both cases come with the WARN line nbi token request failed status=io … error=<cause class>.
Read the field error=<cause class> to find the cause.
2.2. Connection Problems
2.3. Operation Failures
2.3.1. Device Not Found
Issue: API returns "No device" error.
Solution: * Verify the device serial number is correct * Check if the device exists in the ACS * Ensure the device has communicated with the ACS recently
3. Logging
3.1. Log Locations
-
Container stdout/stderr: Access via
docker logs <container-name> -
Volume-mounted logs:
/app/logs/(requires mount like-v /usr/local/ft-system/service-api/logs:/app/logs) -
Centralized logging: Configure log driver for external log aggregation
3.2. Runtime Log Level Management
The application supports changing the log level at runtime without restarting the container, using Spring Boot Actuator.
| Level | What is logged |
|---|---|
|
Critical errors only (lost connection to ACS/DB) |
|
Business errors (device not found, invalid parameter) — without stack trace |
|
Key operations (startup, authorization, main actions) |
|
Detailed diagnostics + stack traces for business errors |
|
In production use |
|
The JVM option |
curl http://<host>:8080/iot-webservice/actuator/loggers/com.friendly.apiservice
{
"configuredLevel": "DEBUG",
"effectiveLevel": "DEBUG"
}
curl -X POST http://<host>:8080/iot-webservice/actuator/loggers/com.friendly.apiservice \
-H 'Content-Type: application/json' \
-d '{"configuredLevel": "INFO"}'
curl -X POST http://<host>:8080/iot-webservice/actuator/loggers/com.friendly.apiservice \
-H 'Content-Type: application/json' \
-d '{"configuredLevel": "DEBUG"}'
| All POST requests return HTTP 204 No Content with an empty body — this is the expected success response. To verify the change, use the GET request above. |
To change the log level persistently (survives container restart), set LOGGING_LEVEL_COM_FRIENDLY_APISERVICE in the per-service environment file /usr/local/ft-system/service-api/.env:
# Values: ERROR, WARN, INFO, DEBUG
LOGGING_LEVEL_COM_FRIENDLY_APISERVICE=INFO
3.3. Host Volume Permissions (SELinux / rootless / NFS/CIFS)
Symptom: Logs are visible in container stdout, but files are not created in the host logs/ directory.
Checks and fixes:
-
SELinux: relabel the mount with:Z(or:zfor shared use):-v /usr/local/ft-system/service-api/logs:/app/logs:Z -
rootless Docker: the container user may not be able tochown; pre-create a writable directory on the host, see File Logging Disabled -
NFS/CIFSmounts: ownership change may be blocked by storage settings; ensure write permission is granted by mount options/export policy for the container process -
Verify mount and effective permissions:
docker inspect service-api --format '{{json .Mounts}}'anddocker exec service-api sh -c 'id; ls -ld /app/logs; touch /app/logs/.perm_test && rm /app/logs/.perm_test'
3.4. File Logging Disabled (Permission denied)
Symptom: The console shows one WARN line at start: File logging disabled: cannot write /app/logs/application.log (Permission denied). Console logging continues. Fix: pre-create the host logs directory owned by uid 1001, gid 0, mode g+rwX. The host logs/ directory has no application.log.
Cause: The container runs as uid 1001, gid 0. The host directory mounted at /app/logs (./service-api/logs) is not writable by this user. The service still starts. File logging stays off until you fix the directory.
Fix:
-
Stop the service.
-
Set the owner:
chown 1001:0 /usr/local/ft-system/service-api/logs. -
Set the mode:
chmod 2775 /usr/local/ft-system/service-api/logs. -
Start the service.
Note: While file logging is off, docker logs service-api still shows all log output.
# View container logs
docker logs service-api
# Follow logs in real-time
docker logs -f service-api
# View last 100 lines
docker logs --tail 100 service-api
4. Diagnostic Tools
4.1. Health Endpoint
The Service API provides a health endpoint to check system status:
curl -X GET "http://example.com/iot-webservice/actuator/health"
Sample response:
{
"status": "UP",
"components": {
"db": {
"status": "UP",
"details": {
"database": "MySQL",
"validationQuery": "isValid()"
}
},
"acsConnection": {
"status": "UP"
},
"diskSpace": {
"status": "UP",
"details": {
"total": 500107862016,
"free": 325889617920,
"threshold": 10485760
}
}
}
}
5. Contacting Support
If you cannot resolve an issue using this guide, contact Friendly Technologies support:
-
Email: support@friendly-tech.com
-
Support Portal: https://support.friendly-tech.com
-
Phone: +1-555-123-4567
When contacting support, please provide:
-
Service API version
-
Detailed error message
-
Relevant log entries
-
Steps to reproduce the issue
-
Any recent changes to your environment