In 5.x (including latest release 5.4.7) we have two bugs:
1) the error message {"http status code":409,"http status description":"Conflict","message":"The ETag must be provided using the 'If-Match' header"}
is wrong. In 6.x it is correctly {"http status code":409,"http status description":"Conflict","message":"Duplicate key error (insert with existing _id, update a document not matching specified filter or unique index violation)"}
2) a conflict due to a dup key when passing the ETag returns 200 and it is wrong. In 6.x it correctly returns 409
Thanks @ujibang
If it helps, I put my http file (JetBrains http Client file) here
Wrong response code and message for PATCH on error due to duplicate key
Greetings!
I put RESTHeart behind an Apache reverse proxy under a new location called /api
. All tests including https://bo.mydomain.org/api/ping
work as expected. However, when I try to access
https://bo.mydomain.org/api/myBucket.files
from a browser (other than Firefox), I get a 401 after entering the (admin/secret) username/password. The logs print:
o.r.s.mechanisms.DigestAuthMechanism - The URI in digest token does not match the request URI
I tried Chrome, Edge, Safari, all with 401. Firefox, curl, Postman work as expected.
Do I need to do extra setup on RESTHeart to inform it of the new base_url https://bo.mydomain.org/api/
?
Thank you!
We configured mongo-mounts
this way
mongo-mounts:
- what: /foo
where: /api
created a files bucket and uploaded there a file
we then put the url in the browser http://localhost:8081/api/my.files/6176cdb7f3ccde248345ffa3/binary
the browser login window pops up and providing the correct credentials, the browser display the file (in our test case it's an image)
17:38:34.769 [XNIO-1 task-1] DEBUG o.r.plugins.security.AuthMechanism - digestAuthMechanism -> AUTHENTICATED
Hi @ujibang Thank you for the prompt response. I clear the browser cache between tests and use private / incognito modes. This is what I did. In my Apache conf file, I have a section that looks like:
<VirtualHost bo.mydomain.org:443>
ServerName bo.mydomain.org
# SSL and other conf
<Proxy balancer://restheart>
BalancerMember http://10.0.0.1:32111 route=route1 keepalive=On ping=1 ttl=60
ProxySet lbmethod=bytraffic
ProxySet stickysession=ROUTEID
</Proxy>
<Location /api>
ProxyPreserveHost On
RequestHeader set X-Forwarded-Proto expr=%{REQUEST_SCHEME}
ProxyPass balancer://restheart
</Location>
</VirtualHost>
I run restheart as a Docker image, available on http://10.0.0.1:32111
Like I said, curl, Postman, Firefox, all work as expected. Chrome and Edge seem to misbehave.
Hello. I'm loving the RESTHeart Container. I run it in a single-node Kubernetes cluster to play with. When I view the logs, I noticed that the logs are missing a date!
11:50:38.504 [XNIO-1 task-2] INFO org.restheart.handlers.RequestLogger - PUT http://api/test from /10.0.0.1:52431 => status=401 elapsed=1ms contentLength=0
When viewing the console from within the DashboardUI, I see the date:
2021-12-06T11:50:38.504764642+03:00 11:50:38.504 [XNIO-1 task-2] [34mINFO [0;39m org.restheart.handlers.RequestLogger - PUT http://api/test from /10.0.0.1:52431 => status=[31;1m401[m elapsed=1ms contentLength=0
So I'm guessing the ansi / control sequence are preventing the date from being printed.
Do you have the same issue when running in a container? Do you have a suggestion to fix the issue? Thank you!!
H @jdimi_gitlab I double checked, I think that you can use graphql type Long
to map mongodb type BsonInt64
8d6acdb
that shouyld fix it . You can try the snapshot build. See how at https://github.com/SoftInstigate/restheart/blob/master/README.md#snapshot-builds
{
"_id": "testLong",
"descriptor": {
"name": "TestLong",
"description": "GraphQL App to test Long scalar",
"enabled": true,
"uri": "testLong"
},
"schema": "type Test{ _id: ObjectId n: Long } type Query { all: [Test] }",
"mappings": {
"Test": {
},
"Query": {
"all": {
"db": "restheart",
"collection": "test"
}
}
}
}
test
documents like{
"n": {
"$numberLong": "2398239058230985"
}
}
the following GraphQL request works as expected
{ all { _id n } }
reponse
{
"data": {
"all": [
{
"_id": {
"$oid": "61b8d1502b29d754e337350c"
},
"n": 2
},
{
"_id": {
"$oid": "61b8d1512b29d754e337350f"
},
"n": 2
},
{
"_id": {
"$oid": "61b8d1632b29d754e3373514"
},
"n": 2
},
{
"_id": {
"$oid": "61b8d16c2b29d754e3373518"
},
"n": 2398239058230985
},
{
"_id": {
"$oid": "61b9b25bbb8a4542b608c7ea"
},
"n": 2398239058230985
}
]
}
Hello all. I am Nico from e-Spirit and I have a question:
I wanted to know which query parameters do NOT have the form ?key=value
(so for example ?count
or ?np
). For this I tried to find in the documentation some kind of list of all possible query parameters. Unfortunately I had no success with it. Is there such a list?
Additionally, I noticed that ?count
and ?np
no longer exist in the current v6 documentation. I haven't looked through all the release notes yet, but I guess this means that these parameters are deprecated?
Thanks in advance.
I hope you had a good start into the new year.
Hello everyone,
I have a simple question, but cannot figure a way out to work. I would like to use RESTHeart with docker and connect to a remote database. However, I don’t really know how to do so.
In the default.properties file I change the mongo-uri
and root-mongo-resource
. I tried to connect to a local database running on localhost and to a hosted database on DigitalOcean, neither works. Do I have to change anything else?