J. Doe
J. Doe

Reputation: 619

Requested resource not found when trying to query from cli

I'm trying to perform some queries on a couchbase database through curl command.

According to the documentation I was able to get info about a specific bucket using:

curl -v http://base.example.com:8091/pools/default/buckets/results -u 'admin':'xxxx'

The thing is that I cannot execute a query using the following command:

curl -v http://base.company.com:8091/query/service -u 'admin':'xxxx' -d 'statement=SELECT * FROM device'

more specificaly I'm getting the following error:

*   Trying xx.xx.xx.xx:8091...
* Connected to base.company.com (xx.xx.xx.xx) port 8091 (#0)
* Server auth using Basic with user 'admin'
> POST /query/service HTTP/1.1
> Host: base.company.com:8091
> Authorization: Basic xxxxxxxxxxxx
> User-Agent: curl/7.77.0
> Accept: */*
> Content-Length: 30
> Content-Type: application/x-www-form-urlencoded
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 404 Object Not Found
< X-XSS-Protection: 1; mode=block
< X-Permitted-Cross-Domain-Policies: none
< X-Frame-Options: DENY
< X-Content-Type-Options: nosniff
< Server: Couchbase Server
< Pragma: no-cache
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Date: Tue, 06 Jul 2021 06:49:22 GMT
< Content-Type: text/plain
< Content-Length: 31
< Cache-Control: no-cache,no-store,must-revalidate
<
Requested resource not found.
* Connection #0 to host base.company.com left intact

Upvotes: 1

Views: 845

Answers (1)

Matthew Groves
Matthew Groves

Reputation: 26096

Per documentation, use port 8093 for N1QL requests. (As opposed to the Buckets API, which uses port 8091).

Upvotes: 1

Related Questions