Skip to content

Doubled slash, a missing comma, and IoT-Agent readiness - #2

Merged
jason-fox merged 1 commit into
FIWARE:NGSI-LDfrom
kzangeli:fix/iot-agent-readiness
Sep 21, 2026
Merged

jason-fox merged 1 commit into
FIWARE:NGSI-LDfrom
kzangeli:fix/iot-agent-readiness

Conversation

@kzangeli

Copy link
Copy Markdown

Three unrelated defects, each of which stops a reader part-way.

1. A doubled slash

One request is written as http://localhost:1026//ngsi-ld/v1/entities/, from a URL variable that isn't there. A strict broker answers 400 Invalid URL Path rather than silently treating it as /ngsi-ld/v1/entities/.

2. A missing comma

"temperature": {
  "value": 16,
  "unitCode": "CEL"
  "observedAt": "2022-03-01T15:00:00.000Z"
}

The whole entityOperations/update?options=replace request is rejected as invalid JSON.

3. The tutorial cannot start: IoT-Agent readiness

waitForIoTAgent loops while the HTTP code is 000, so it stops waiting as soon as the port answers anything — including the 503 the agent serves while still initialising. IoT-Agent, IoT-Agent-JSON and Big-Data-Spark already wait on the container health status; this brings it into line.

And link-devices POSTs several ~30 KB device batches with no retry, under set -e. The agent intermittently closes the connection without replying — curl exit 52, "empty reply from server" — most often on the batch immediately after provision-devices. One such reply then kills the script silently, leaving the tutorial stopped at ⏳ Link Devices to Animal entities with no error shown.

⭐ Verified intermittent rather than assumed: the identical payload against the same agent gave exit=52 then exit=0 back to back. A single device is accepted with 201 throughout, and 31 KB is nowhere near the agent's 1 MB expressLimit, so it isn't a size limit.

--retry 10 --retry-all-errors --retry-delay 10 on those two calls; tested end-to-end, after which the tutorial starts cleanly (services exits 0).

Found while running all sixteen NGSI-LD tutorials against a different NGSI-LD broker — this was one of four that could never be started.

Three unrelated defects that each stop a reader part-way.

1. A request is written as 'http://localhost:1026//ngsi-ld/v1/entities/' - a
   doubled slash, from a URL variable that is not there. A strict broker
   answers 400 rather than treating it as /ngsi-ld/v1/entities/.

2. A payload is missing a comma:

       "unitCode": "CEL"
       "observedAt": "2022-03-01T15:00:00.000Z"

   so the whole entityOperations/update request is rejected as invalid JSON.

3. waitForIoTAgent loops while the HTTP code is 000, i.e. it stops waiting as
   soon as the port answers ANYTHING - including the 503 the agent serves while
   still initialising. link-devices then runs against an agent that is not
   ready. IoT-Agent, IoT-Agent-JSON and Big-Data-Spark already wait on the
   container health status; this brings it into line.

   And link-devices itself POSTs several ~30 KB device batches with no retry,
   under 'set -e'. The agent intermittently closes the connection without
   replying (curl exit 52, 'empty reply from server'), most often on the batch
   immediately after provision-devices - and one such reply then kills the
   script silently, leaving the tutorial stopped at 'Link Devices to Animal
   entities'. Verified intermittent: the identical payload against the same
   agent gave exit=52 then exit=0 back to back. Added --retry to those two
   calls.
@jason-fox
jason-fox merged commit fe68c44 into FIWARE:NGSI-LD Sep 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants