Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Cannot retrieve entity at revision #1915

Closed
simleo opened this issue Mar 14, 2024 · 3 comments · Fixed by #2033
Closed

Cannot retrieve entity at revision #1915

simleo opened this issue Mar 14, 2024 · 3 comments · Fixed by #2033
Assignees
Labels
Milestone

Comments

@simleo
Copy link

simleo commented Mar 14, 2024

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."
}
@thjaeckle
Copy link
Member

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

@simleo
Copy link
Author

simleo commented Mar 18, 2024

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.

@thjaeckle thjaeckle self-assigned this Sep 26, 2024
@thjaeckle thjaeckle added the bug label Sep 26, 2024
@thjaeckle thjaeckle added this to the 3.6.0 milestone Sep 26, 2024
@thjaeckle
Copy link
Member

Sorry this took so long to look into - I can reproduce and will work on a fix.

thjaeckle added a commit to beyonnex-io/ditto that referenced this issue Sep 26, 2024
…h `at-historical-timestamp` when a snapshot was not yet written
thjaeckle added a commit that referenced this issue Sep 27, 2024
…imestamp

#1915 fix retrieving the historical value of a thing with `at-historical-timestamp`
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants