eclipse-ditto / ditto

Eclipse Ditto™: Digital Twin framework of Eclipse IoT - main repository

Home Page:https://eclipse.dev/ditto/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot retrieve entity at revision

simleo opened this issue · comments

Using Ditto 3.5.3, started via docker compose. I created the floor lamp Thing as explained in https://eclipse.dev/ditto/3.5/intro-hello-world.html, then I updated it twice to set two of the three spots to "on". Now if I try "Streaming historical events via SSE" it seems to work (I get a full record for revision 1, and two more records that show the changes made at revision 2 and 3), but "Retrieve entity at specific revision" gives an error:

curl -u ditto:ditto 'http://localhost:8080/api/2/things/org.eclipse.ditto:67b0d1a5-df3a-48a4-883e-7fb7432a5390' --header 'at-historical-revision: 1' | jq
{
  "status": 404,
  "error": "things:thing.history.notfound",
  "message": "The Thing with ID 'org.eclipse.ditto:67b0d1a5-df3a-48a4-883e-7fb7432a5390' at revision '1' could not be found or requester had insufficient permissions to access it.",
  "description": "Check if the ID of your requested Thing was correct, you have sufficient permissions and ensure that the asked for revision/timestamp does not exceed the history-retention-duration or is from the future."
}

@simleo thanks for the detailed report.
I'll try to reproduce.

I tried to reproduce today and I couldn't. Must have been something temporary the other day. Sorry about that. However, I cannot make at-historical-timestamp work. I always get the latest version of the thing, no matter which timestamp I try to select. I get the same record even if I set a timestamp in the future or one that's before the first revision existed.