You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/03/12 05:16:32 UTC
[GitHub] [couchdb] mapmalith opened a new issue #2656: error: 'invalid_json'
for View GET Request
mapmalith opened a new issue #2656: error: 'invalid_json' for View GET Request
URL: https://github.com/apache/couchdb/issues/2656
[NOTE]: # ( ^^ Provide a general summary of the issue in the title above. ^^ )
## Description
There is a issue in new CouchDB version 3.0.0 when getting data with special characters using a View. It is possible to insert data with special characters but it throws an error `error: 'invalid_json',
reason: '{423,invalid_string}'` when getting data using a View.
## Steps to Reproduce
Insert the following into the Database
`{
"type": "TAGS",
"origin_id": "2",
"locale": "sv_SE",
"values_translation": {
"name": "Glasstårta",
"explanation": "",
"links": [],
"alternativeTitle": []
}
}`
and use the following View to GET the data
`function (doc) {
emit([doc.type, doc.origin_id]);
}`
and when I pass `[ "TAGS", "2"]` to the View it gives the following error.
> name: 'Error',
error: 'invalid_json',
reason: '{423,invalid_string}',
ref: 3722911048,
scope: 'couch',
statusCode: 500, ...
## Your Environment
This runs on a Docker Environment & NodeJS Express App with NANO NPM package.
* CouchDB version used: 3.0.0
* Nano: 8.2.2
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [couchdb] willholley commented on issue #2656: error:
'invalid_json' for View GET Request
Posted by GitBox <gi...@apache.org>.
willholley commented on issue #2656: error: 'invalid_json' for View GET Request
URL: https://github.com/apache/couchdb/issues/2656#issuecomment-598158199
@mapmalith:
```
❯ docker system prune --all
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
- all images without at least one container associated to them
- all build cache
Are you sure you want to continue? [y/N] y
Total reclaimed space: 0B
❯ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
❯ docker run -p 15984:5984 --name couchdb -e COUCHDB_USER=foo -e COUCHDB_PASSWORD=bar -d apache/couchdb:3.0.0
Unable to find image 'apache/couchdb:3.0.0' locally
3.0.0: Pulling from apache/couchdb
bc51dd8edc1b: Pull complete
e0721285bf8f: Pull complete
ee5697af831d: Pull complete
67c9b4d1304d: Pull complete
c89263c9a78d: Pull complete
c9b69236695d: Pull complete
4305dca323a8: Pull complete
dbededea05b4: Pull complete
fca0a8bd1d32: Pull complete
16f51bce7f90: Pull complete
df657153d78f: Pull complete
Digest: sha256:3a194f9c1c68ce919cb5c77162bcbfc41457952f63465b010b81ade1bdf69ab5
Status: Downloaded newer image for apache/couchdb:3.0.0
23de4a8ba927227fffea5006b1b5add88046a7fdf3d40bdb365e217bcafc35a8
❯ curl foo:bar@localhost:15984/db1 -XPUT
{"ok":true}
❯ curl foo:bar@localhost:15984/db1/doc1 -XPUT -d '{ "type": "TAGS", "origin_id": "2", "locale": "sv_SE", "values_translation": { "name": "Glasstårta", "explanation": "", "links": [], "alternativeTitle": [] } }'
{"ok":true,"id":"doc1","rev":"1-ac04d6c912096181503c60944f35d5a2"}
❯ curl foo:bar@localhost:15984/db1/doc1
{"_id":"doc1","_rev":"1-ac04d6c912096181503c60944f35d5a2","type":"TAGS","origin_id":"2","locale":"sv_SE","values_translation":{"name":"Glasstårta","explanation":"","links":[],"alternativeTitle":[]}}
❯ curl 'foo:bar@localhost:15984/db1/_all_docs?include_docs=true'
{"total_rows":1,"offset":0,"rows":[
{"id":"doc1","key":"doc1","value":{"rev":"1-ac04d6c912096181503c60944f35d5a2"},"doc":{"_id":"doc1","_rev":"1-ac04d6c912096181503c60944f35d5a2","type":"TAGS","origin_id":"2","locale":"sv_SE","values_translation":{"name":"Glasstårta","explanation":"","links":[],"alternativeTitle":[]}}}
]}
❯ curl 'foo:bar@localhost:15984/db1/_design/foo' -XPUT -d '{"views":{"bar":{"map":"function(doc){emit([doc.type, doc.origin_id]);}"}}}'
{"ok":true,"id":"_design/foo","rev":"1-c3ad517780c931044cbb1c8e88bf46b6"}
❯ curl 'foo:bar@localhost:15984/db1/_design/foo/_view/bar?key=["TAGS","2"]' -g
{"total_rows":1,"offset":0,"rows":[
{"id":"doc1","key":["TAGS","2"],"value":null}
]}
❯ curl 'foo:bar@localhost:15984/db1/_design/foo/_view/bar?key=["TAGS","2"]&include_docs=true' -g
{"total_rows":1,"offset":0,"rows":[
{"id":"doc1","key":["TAGS","2"],"value":null,"doc":{"_id":"doc1","_rev":"1-ac04d6c912096181503c60944f35d5a2","type":"TAGS","origin_id":"2","locale":"sv_SE","values_translation":{"name":"Glasstårta","explanation":"","links":[],"alternativeTitle":[]}}}
]}
```
As mentioned previously, it's difficult to take this further unless you can provide explicit steps to reproduce, starting with an empty container. Is there anything in the container logs that points to where the error is generated?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [couchdb] mapmalith closed issue #2656: error: 'invalid_json' for
View GET Request
Posted by GitBox <gi...@apache.org>.
mapmalith closed issue #2656: error: 'invalid_json' for View GET Request
URL: https://github.com/apache/couchdb/issues/2656
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [couchdb] wohali commented on issue #2656: error: 'invalid_json'
for View GET Request
Posted by GitBox <gi...@apache.org>.
wohali commented on issue #2656: error: 'invalid_json' for View GET Request
URL: https://github.com/apache/couchdb/issues/2656#issuecomment-598316811
@mapmalith Are you sure you're quoting your strings correctly in the shell? Take a close look at how @willholley did it.
Please paste 100% of your steps necessary to reproduce to this ticket, directly out of your shell, including quoting. My bet is that the shell is interpreting something wrong.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [couchdb] mapmalith edited a comment on issue #2656: error:
'invalid_json' for View GET Request
Posted by GitBox <gi...@apache.org>.
mapmalith edited a comment on issue #2656: error: 'invalid_json' for View GET Request
URL: https://github.com/apache/couchdb/issues/2656#issuecomment-598142491
EDIT: Sorry mistakenly I have closed this so I have reopened again.
@willholley My `curl` request
`http://user:pass@localhost:5987/db/_design/contrans/_view/type_id?key=["TAGS","2"]&include_docs=true`
and the response:
`{
"error": "invalid_json",
"reason": "{599,invalid_string}",
"ref": 3722911048
}`
@rnewson it is UTF-8 and I have tried the same with use of `POSTMAN` and still the same
**NOTE:** Please try to remove the Docker volume first and then recreate the issue. TIA
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [couchdb] mapmalith edited a comment on issue #2656: error:
'invalid_json' for View GET Request
Posted by GitBox <gi...@apache.org>.
mapmalith edited a comment on issue #2656: error: 'invalid_json' for View GET Request
URL: https://github.com/apache/couchdb/issues/2656#issuecomment-598168597
@willholley Thanks for your response and below the CouchDb log on the container.
`[error] 2020-03-12T12:49:53.604557Z nonode@nohost <0.24151.0> e1803df291 req_err(3722911048) invalid_json : {599,invalid_string}
[<<"couch_mrview_util:get_view_index_state/5 L138">>,<<"couch_mrview_util:get_view/4 L82">>,<<"couch_mrview:query_view/6 L262">>,<<"rexi_server:init_p/3 L138">>]
[notice] 2020-03-12T12:49:53.610369Z nonode@nohost <0.24151.0> e1803df291 localhost:5987 172.18.0.1 contrans_user GET /translations/_design/contrans/_view/type_id/?key%5C=%5C[%22TAGS%22,%225108be900473ae3330f451999fa029a9%22%5C]%5C&include_docs%5C=true 500 ok 353`
In addition to that there is another error when the CouchDB is idle (If you need further information on logs only).
`[error] 2020-03-12T12:55:05.705836Z nonode@nohost emulator -------- Error in process <0.26774.0> with exit value:`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [couchdb] willholley commented on issue #2656: error:
'invalid_json' for View GET Request
Posted by GitBox <gi...@apache.org>.
willholley commented on issue #2656: error: 'invalid_json' for View GET Request
URL: https://github.com/apache/couchdb/issues/2656#issuecomment-598098805
@mapmalith I also cannot reproduce using the 3.0.0 docker image. Are you able to provide reproduction steps using `curl`?
```
❯ docker run -p 15984:5984 --name couchdb -e COUCHDB_USER=foo -e COUCHDB_PASSWORD=bar -d apache/couchdb:3.0.0
1879c71d0eafdbb6d0836277d689de5d53061f75c3e8b7c35278f6cd3af1fd74
❯ curl foo:bar@localhost:15984/db1 -XPUT
{"ok":true}
❯ curl foo:bar@localhost:15984/db1/doc1 -XPUT -d '{ "type": "TAGS", "origin_id": "2", "locale": "sv_SE", "values_translation": { "name": "Glasstårta", "explanation": "", "links": [], "alternativeTitle": [] } }'
{"ok":true,"id":"doc1","rev":"1-ac04d6c912096181503c60944f35d5a2"}
❯ curl foo:bar@localhost:15984/db1/doc1
{"_id":"doc1","_rev":"1-ac04d6c912096181503c60944f35d5a2","type":"TAGS","origin_id":"2","locale":"sv_SE","values_translation":{"name":"Glasstårta","explanation":"","links":[],"alternativeTitle":[]}}
❯ curl 'foo:bar@localhost:15984/db1/_all_docs?include_docs=true'
{"total_rows":1,"offset":0,"rows":[
{"id":"doc1","key":"doc1","value":{"rev":"1-ac04d6c912096181503c60944f35d5a2"},"doc":{"_id":"doc1","_rev":"1-ac04d6c912096181503c60944f35d5a2","type":"TAGS","origin_id":"2","locale":"sv_SE","values_translation":{"name":"Glasstårta","explanation":"","links":[],"alternativeTitle":[]}}}
]}
❯ curl 'foo:bar@localhost:15984/db1/_design/foo' -XPUT -d '{"views":{"bar":{"map":"function(doc){emit([doc.type, doc.origin_id]);}"}}}'
{"ok":true,"id":"_design/foo","rev":"1-c3ad517780c931044cbb1c8e88bf46b6"}
❯ curl 'foo:bar@localhost:15984/db1/_design/foo/_view/bar?key=["TAGS","2"]' -g
{"total_rows":1,"offset":0,"rows":[
{"id":"doc1","key":["TAGS","2"],"value":null}
]}
❯ curl 'foo:bar@localhost:15984/db1/_design/foo/_view/bar?key=["TAGS","2"]&include_docs=true' -g
{"total_rows":1,"offset":0,"rows":[
{"id":"doc1","key":["TAGS","2"],"value":null,"doc":{"_id":"doc1","_rev":"1-ac04d6c912096181503c60944f35d5a2","type":"TAGS","origin_id":"2","locale":"sv_SE","values_translation":{"name":"Glasstårta","explanation":"","links":[],"alternativeTitle":[]}}}
]}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [couchdb] rnewson commented on issue #2656: error: 'invalid_json'
for View GET Request
Posted by GitBox <gi...@apache.org>.
rnewson commented on issue #2656: error: 'invalid_json' for View GET Request
URL: https://github.com/apache/couchdb/issues/2656#issuecomment-598136230
can you introspect what character encoding your setup used? my terminal uses utf-8 which is exactly what couchdb requires.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [couchdb] rnewson commented on issue #2656: error: 'invalid_json'
for View GET Request
Posted by GitBox <gi...@apache.org>.
rnewson commented on issue #2656: error: 'invalid_json' for View GET Request
URL: https://github.com/apache/couchdb/issues/2656#issuecomment-598064052
I tried to reproduce this without success (i.e, it worked);
```
➜ ~ curl foo:bar@localhost:15984/db1 -XPUT
{"ok":true}
➜ ~ curl foo:bar@localhost:15984/db1/doc1 -XPUT -d '{ "type": "TAGS", "origin_id": "2", "locale": "sv_SE", "values_translation": { "name": "Glasstårta", "explanation": "", "links": [], "alternativeTitle": [] } }'
{"ok":true,"id":"doc1","rev":"1-ac04d6c912096181503c60944f35d5a2"}
➜ ~ curl foo:bar@localhost:15984/db1/doc1
{"_id":"doc1","_rev":"1-ac04d6c912096181503c60944f35d5a2","type":"TAGS","origin_id":"2","locale":"sv_SE","values_translation":{"name":"Glasstårta","explanation":"","links":[],"alternativeTitle":[]}}
➜ ~ curl 'foo:bar@localhost:15984/db1/_all_docs?include_docs=true'
{"total_rows":1,"offset":0,"rows":[
{"id":"doc1","key":"doc1","value":{"rev":"1-ac04d6c912096181503c60944f35d5a2"},"doc":{"_id":"doc1","_rev":"1-ac04d6c912096181503c60944f35d5a2","type":"TAGS","origin_id":"2","locale":"sv_SE","values_translation":{"name":"Glasstårta","explanation":"","links":[],"alternativeTitle":[]}}}
]}
➜ ~ curl 'foo:bar@localhost:15984/db1/_design/foo' -XPUT -d '{"views":{"bar":{"map":"function(doc){emit([doc.type, doc.origin_id]);}"}}}'
{"ok":true,"id":"_design/foo","rev":"1-eb26a625dc5f7da1c4b50b29db08a1b9"}
➜ ~ curl 'foo:bar@localhost:15984/db1/_design/foo/_view/bar?key=["TAGS","2"]' -g
{"total_rows":1,"offset":0,"rows":[
{"id":"doc1","key":["TAGS","2"],"value":null}
]}
➜ ~ curl 'foo:bar@localhost:15984/db1/_design/foo/_view/bar?key=["TAGS","2"]&include_docs=true' -g
{"total_rows":1,"offset":0,"rows":[
{"id":"doc1","key":["TAGS","2"],"value":null,"doc":{"_id":"doc1","_rev":"1-ac04d6c912096181503c60944f35d5a2","type":"TAGS","origin_id":"2","locale":"sv_SE","values_translation":{"name":"Glasstårta","explanation":"","links":[],"alternativeTitle":[]}}}
]}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [couchdb] mapmalith edited a comment on issue #2656: error:
'invalid_json' for View GET Request
Posted by GitBox <gi...@apache.org>.
mapmalith edited a comment on issue #2656: error: 'invalid_json' for View GET Request
URL: https://github.com/apache/couchdb/issues/2656#issuecomment-598091043
Thanks for your response. It worked on the 2.3.1 version and I recently updated the CouchDB version to 3.0.0 and then this issue occurred. Did you try on Couch 3.0.0 or any other different version?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [couchdb] mapmalith opened a new issue #2656: error: 'invalid_json'
for View GET Request
Posted by GitBox <gi...@apache.org>.
mapmalith opened a new issue #2656: error: 'invalid_json' for View GET Request
URL: https://github.com/apache/couchdb/issues/2656
[NOTE]: # ( ^^ Provide a general summary of the issue in the title above. ^^ )
## Description
There is a issue in new CouchDB version 3.0.0 when getting data with special characters using a View. It is possible to insert data with special characters but it throws an error `error: 'invalid_json',
reason: '{423,invalid_string}'` when getting data using a View.
## Steps to Reproduce
Insert the following into the Database
`{
"type": "TAGS",
"origin_id": "2",
"locale": "sv_SE",
"values_translation": {
"name": "Glasstårta",
"explanation": "",
"links": [],
"alternativeTitle": []
}
}`
and use the following View to GET the data
`function (doc) {
emit([doc.type, doc.origin_id]);
}`
and when I pass `key` as `[ "TAGS", "2"]` with `'include_docs': true` to the View it gives the following error.
> name: 'Error',
error: 'invalid_json',
reason: '{423,invalid_string}',
ref: 3722911048,
scope: 'couch',
statusCode: 500, ...
**FURTHER :** if I replace `Glasstårta` word with any English word, then it won't throw the error and View returns the expected results.
## Your Environment
This runs on a Docker Environment & NodeJS Express App with NANO NPM package.
* CouchDB version used: 3.0.0
* Nano: 8.2.2
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [couchdb] mapmalith commented on issue #2656: error: 'invalid_json'
for View GET Request
Posted by GitBox <gi...@apache.org>.
mapmalith commented on issue #2656: error: 'invalid_json' for View GET Request
URL: https://github.com/apache/couchdb/issues/2656#issuecomment-598168597
@willholley Thanks for your response and below the CouchDb log on the container.
`[error] 2020-03-12T12:49:53.604557Z nonode@nohost <0.24151.0> e1803df291 req_err(3722911048) invalid_json : {599,invalid_string}
[<<"couch_mrview_util:get_view_index_state/5 L138">>,<<"couch_mrview_util:get_view/4 L82">>,<<"couch_mrview:query_view/6 L262">>,<<"rexi_server:init_p/3 L138">>]
[notice] 2020-03-12T12:49:53.610369Z nonode@nohost <0.24151.0> e1803df291 localhost:5987 172.18.0.1 contrans_user GET /translations/_design/contrans/_view/type_id/?key%5C=%5C[%22TAGS%22,%225108be900473ae3330f451999fa029a9%22%5C]%5C&include_docs%5C=true 500 ok 353`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [couchdb] mapmalith commented on issue #2656: error: 'invalid_json'
for View GET Request
Posted by GitBox <gi...@apache.org>.
mapmalith commented on issue #2656: error: 'invalid_json' for View GET Request
URL: https://github.com/apache/couchdb/issues/2656#issuecomment-598142210
Please try to remove your Docker volumes first and then try to replicate.
> @mapmalith I also cannot reproduce using the 3.0.0 docker image. Are you able to provide reproduction steps using `curl`?
>
> ```
> ❯ docker run -p 15984:5984 --name couchdb -e COUCHDB_USER=foo -e COUCHDB_PASSWORD=bar -d apache/couchdb:3.0.0
> 1879c71d0eafdbb6d0836277d689de5d53061f75c3e8b7c35278f6cd3af1fd74
>
> ❯ curl foo:bar@localhost:15984/db1 -XPUT
> {"ok":true}
>
> ❯ curl foo:bar@localhost:15984/db1/doc1 -XPUT -d '{ "type": "TAGS", "origin_id": "2", "locale": "sv_SE", "values_translation": { "name": "Glasstårta", "explanation": "", "links": [], "alternativeTitle": [] } }'
> {"ok":true,"id":"doc1","rev":"1-ac04d6c912096181503c60944f35d5a2"}
>
> ❯ curl foo:bar@localhost:15984/db1/doc1
> {"_id":"doc1","_rev":"1-ac04d6c912096181503c60944f35d5a2","type":"TAGS","origin_id":"2","locale":"sv_SE","values_translation":{"name":"Glasstårta","explanation":"","links":[],"alternativeTitle":[]}}
>
> ❯ curl 'foo:bar@localhost:15984/db1/_all_docs?include_docs=true'
> {"total_rows":1,"offset":0,"rows":[
> {"id":"doc1","key":"doc1","value":{"rev":"1-ac04d6c912096181503c60944f35d5a2"},"doc":{"_id":"doc1","_rev":"1-ac04d6c912096181503c60944f35d5a2","type":"TAGS","origin_id":"2","locale":"sv_SE","values_translation":{"name":"Glasstårta","explanation":"","links":[],"alternativeTitle":[]}}}
> ]}
>
> ❯ curl 'foo:bar@localhost:15984/db1/_design/foo' -XPUT -d '{"views":{"bar":{"map":"function(doc){emit([doc.type, doc.origin_id]);}"}}}'
> {"ok":true,"id":"_design/foo","rev":"1-c3ad517780c931044cbb1c8e88bf46b6"}
>
> ❯ curl 'foo:bar@localhost:15984/db1/_design/foo/_view/bar?key=["TAGS","2"]' -g
> {"total_rows":1,"offset":0,"rows":[
> {"id":"doc1","key":["TAGS","2"],"value":null}
> ]}
>
> ❯ curl 'foo:bar@localhost:15984/db1/_design/foo/_view/bar?key=["TAGS","2"]&include_docs=true' -g
> {"total_rows":1,"offset":0,"rows":[
> {"id":"doc1","key":["TAGS","2"],"value":null,"doc":{"_id":"doc1","_rev":"1-ac04d6c912096181503c60944f35d5a2","type":"TAGS","origin_id":"2","locale":"sv_SE","values_translation":{"name":"Glasstårta","explanation":"","links":[],"alternativeTitle":[]}}}
> ]}
> ```
My `curl` request
`http://user:pass@localhost:5987/db/_design/contrans/_view/type_id?key=["TAGS","2"]&include_docs=true`
and the response:
`{
"error": "invalid_json",
"reason": "{599,invalid_string}",
"ref": 3722911048
}`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [couchdb] mapmalith commented on issue #2656: error: 'invalid_json'
for View GET Request
Posted by GitBox <gi...@apache.org>.
mapmalith commented on issue #2656: error: 'invalid_json' for View GET Request
URL: https://github.com/apache/couchdb/issues/2656#issuecomment-598091043
Thanks for your response. It worked on the 2.3.1 version and I recently updated the CouchDB version to 3.0.0 and this issue occurred. Did you try on Couch 3.0.0 or any other different version?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [couchdb] mapmalith commented on issue #2656: error: 'invalid_json'
for View GET Request
Posted by GitBox <gi...@apache.org>.
mapmalith commented on issue #2656: error: 'invalid_json' for View GET Request
URL: https://github.com/apache/couchdb/issues/2656#issuecomment-598142491
My `curl` request
`http://user:pass@localhost:5987/db/_design/contrans/_view/type_id?key=["TAGS","2"]&include_docs=true`
and the response:
`{
"error": "invalid_json",
"reason": "{599,invalid_string}",
"ref": 3722911048
}`
Please try to remove the Docker volume first and then recreate the issue. TIA
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [couchdb] mapmalith removed a comment on issue #2656: error:
'invalid_json' for View GET Request
Posted by GitBox <gi...@apache.org>.
mapmalith removed a comment on issue #2656: error: 'invalid_json' for View GET Request
URL: https://github.com/apache/couchdb/issues/2656#issuecomment-598142210
Please try to remove your Docker volumes first and then try to replicate.
> @mapmalith I also cannot reproduce using the 3.0.0 docker image. Are you able to provide reproduction steps using `curl`?
>
> ```
> ❯ docker run -p 15984:5984 --name couchdb -e COUCHDB_USER=foo -e COUCHDB_PASSWORD=bar -d apache/couchdb:3.0.0
> 1879c71d0eafdbb6d0836277d689de5d53061f75c3e8b7c35278f6cd3af1fd74
>
> ❯ curl foo:bar@localhost:15984/db1 -XPUT
> {"ok":true}
>
> ❯ curl foo:bar@localhost:15984/db1/doc1 -XPUT -d '{ "type": "TAGS", "origin_id": "2", "locale": "sv_SE", "values_translation": { "name": "Glasstårta", "explanation": "", "links": [], "alternativeTitle": [] } }'
> {"ok":true,"id":"doc1","rev":"1-ac04d6c912096181503c60944f35d5a2"}
>
> ❯ curl foo:bar@localhost:15984/db1/doc1
> {"_id":"doc1","_rev":"1-ac04d6c912096181503c60944f35d5a2","type":"TAGS","origin_id":"2","locale":"sv_SE","values_translation":{"name":"Glasstårta","explanation":"","links":[],"alternativeTitle":[]}}
>
> ❯ curl 'foo:bar@localhost:15984/db1/_all_docs?include_docs=true'
> {"total_rows":1,"offset":0,"rows":[
> {"id":"doc1","key":"doc1","value":{"rev":"1-ac04d6c912096181503c60944f35d5a2"},"doc":{"_id":"doc1","_rev":"1-ac04d6c912096181503c60944f35d5a2","type":"TAGS","origin_id":"2","locale":"sv_SE","values_translation":{"name":"Glasstårta","explanation":"","links":[],"alternativeTitle":[]}}}
> ]}
>
> ❯ curl 'foo:bar@localhost:15984/db1/_design/foo' -XPUT -d '{"views":{"bar":{"map":"function(doc){emit([doc.type, doc.origin_id]);}"}}}'
> {"ok":true,"id":"_design/foo","rev":"1-c3ad517780c931044cbb1c8e88bf46b6"}
>
> ❯ curl 'foo:bar@localhost:15984/db1/_design/foo/_view/bar?key=["TAGS","2"]' -g
> {"total_rows":1,"offset":0,"rows":[
> {"id":"doc1","key":["TAGS","2"],"value":null}
> ]}
>
> ❯ curl 'foo:bar@localhost:15984/db1/_design/foo/_view/bar?key=["TAGS","2"]&include_docs=true' -g
> {"total_rows":1,"offset":0,"rows":[
> {"id":"doc1","key":["TAGS","2"],"value":null,"doc":{"_id":"doc1","_rev":"1-ac04d6c912096181503c60944f35d5a2","type":"TAGS","origin_id":"2","locale":"sv_SE","values_translation":{"name":"Glasstårta","explanation":"","links":[],"alternativeTitle":[]}}}
> ]}
> ```
My `curl` request
`http://user:pass@localhost:5987/db/_design/contrans/_view/type_id?key=["TAGS","2"]&include_docs=true`
and the response:
`{
"error": "invalid_json",
"reason": "{599,invalid_string}",
"ref": 3722911048
}`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services