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 Message text and the WARN line to tell them apart. See Error 204

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

Northbound API rejected the Service API credentials. Check the Northbound API login, password and authentication method (Basic or JWT) in FT Configs, and that this user is not blocked or expired

Credentials not configured

Northbound API requires authentication. Set the Northbound API login and password for Service API in FT Configs

Solution:

  1. 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.

  2. Read the fields nbiAuthConfigured, nbiAuthType, nbiLogin, nbiErrorCode, and nbiMessage.

  3. If nbiAuthConfigured=false, set the login and the password in FT Configs. See Northbound API credentials.

  4. If nbiAuthType does not match the NBI inbound mode, change the authentication method. Follow the order in Change the NBI inbound authentication mode.

  5. 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.

  6. For JWT, request a token with the same credentials. This check needs curl and jq. 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 Failed with 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

Northbound API could not process the request and returned no readable error. Try again later or check the Northbound API logs

NBI answered with HTTP 5xx and an empty or unreadable body. WARN line: nbi error reply without a readable error envelope status= method= path=.

Try again later. If the error stays, check the NBI log for the cause.

Northbound API rejected the request and returned no readable error. Retrying will not help: check that the Northbound API URL points to Northbound API and that its version supports this method, then check the Northbound API logs

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 NORTHBOUND_API_URL and the NBI version. Then check the NBI log.

Northbound API returned an invalid authentication token. Check that the Northbound API URL points to Northbound API and that JWT authentication is enabled on it

The token request returned a reply that is not a token. WARN line: nbi token request failed status=<n> …​.

Check NORTHBOUND_API_URL. Check that JWT authentication is enabled on NBI.

Northbound API has no authentication token endpoint (/api/System/Token). Switch Service API to Basic authentication in FT Configs or use a Northbound API version that supports JWT

The token request returned HTTP 404 without an NBI error. Either NORTHBOUND_API_URL has a wrong context path, or this NBI version has no JWT token endpoint.

First check that NORTHBOUND_API_URL includes /iot-webservice. If the URL is correct, update NBI or select Basic in FT Configs.

Northbound API redirected the request (HTTP <status>). Service API does not follow redirects: set NORTHBOUND_API_URL to the final Northbound API address

NBI answered with an HTTP 3xx redirect. <status> is the HTTP status. NORTHBOUND_API_URL points to an address that redirects, for example without /iot-webservice, with HTTP instead of HTTPS, or through a load balancer. WARN line: nbi redirect not followed status= method= path=. With JWT the first NBI call is the token request, so the WARN line is nbi token request failed status=3xx instead.

Set NORTHBOUND_API_URL to the final Northbound API address. See Redirects and proxy.

Northbound API returned error code <n>: <NBI message>. Check the Northbound API logs for what this code means

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.

Northbound API returned error code <n> without a message. Check the Northbound API logs for what this code means

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.2.1. Cannot Connect to Service API

Issue: Unable to establish connection to the Service API.

Solution: * Verify the Service API server is running * Check network connectivity * Ensure firewall rules allow the connection * Verify DNS resolution for the Service API hostname

2.2.2. Timeout Errors

Issue: Requests time out before receiving a response.

Solution: * Increase client timeout settings * Check if the Service API is under heavy load * Verify the ACS is responding properly * Check network latency between components

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

2.3.2. Parameter Update Failures

Issue: Cannot update device parameters.

Solution: * Verify the parameter exists on the device * Check if the parameter is writable * Ensure the new value is valid for the parameter type * Verify the device is online and reachable

2.3.3. Speed Test Failures

Issue: Speed test operation fails.

Solution: * Verify the device supports speed test diagnostics * Check if the device is online * Ensure the ACS has appropriate diagnostic URLs configured * Increase the operation timeout for long-running tests

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

ERROR

Critical errors only (lost connection to ACS/DB)

WARN

Business errors (device not found, invalid parameter) — without stack trace

INFO

Key operations (startup, authorization, main actions)

DEBUG

Detailed diagnostics + stack traces for business errors

In production use INFO. Switch to DEBUG temporarily when investigating issues — business errors will include full stack traces.

The JVM option -Djdk.httpclient.HttpClient.log=headers and the Spring web DEBUG level print the Authorization header and the token. Never enable them in production. Never share logs that were written with them enabled.

View current log level (GET)
curl http://<host>:8080/iot-webservice/actuator/loggers/com.friendly.apiservice
Response example (HTTP 200)
{
    "configuredLevel": "DEBUG",
    "effectiveLevel": "DEBUG"
}
Switch to INFO (POST)
curl -X POST http://<host>:8080/iot-webservice/actuator/loggers/com.friendly.apiservice \
  -H 'Content-Type: application/json' \
  -d '{"configuredLevel": "INFO"}'
Switch to DEBUG (POST)
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 :z for shared use): -v /usr/local/ft-system/service-api/logs:/app/logs:Z

  • rootless Docker: the container user may not be able to chown; pre-create a writable directory on the host, see File Logging Disabled

  • NFS/CIFS mounts: 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}}' and docker 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:

  1. Stop the service.

  2. Set the owner: chown 1001:0 /usr/local/ft-system/service-api/logs.

  3. Set the mode: chmod 2775 /usr/local/ft-system/service-api/logs.

  4. 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
      }
    }
  }
}

4.2. Metrics Endpoint

To view operational metrics:

curl -X GET "http://example.com/iot-webservice/actuator/metrics"

For specific metrics:

curl -X GET "http://example.com/iot-webservice/actuator/metrics/http.server.requests"

4.3. Environment Information

To check environment configuration:

curl -X GET "http://example.com/iot-webservice/actuator/env"

5. Contacting Support

If you cannot resolve an issue using this guide, contact Friendly Technologies support:

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