Couchbase CURL function not working

n1ql

#1

I tried to access CURL external API and tried this query

select curl (“http://localhost:8080/” );

and output as

[
{
“code”: 5010,
“msg”: “Error evaluating projection. - cause: URL end point isn’t whitelisted http://localhost:8080/. Please make sure to whitelist the URL on the UI.”
}
]

in given document https://developer.couchbase.com/documentation/server/5.5/n1ql/n1ql-language-reference/curl.html to create curl_whitelist.json then I created following file in below path

/opt/couchbase/var/lib/couchbase/n1qlcerts/curl_whitelist.json ( note n1qlcerts folder not present I created manually )

and added following json

{
“all_access”: false,
“allowed_urls”: [“http://localhost:8080/”]
}

restarted couch base server and checked but still it not work ?


#2

Check this out https://blog.couchbase.com/curl-comes-n1ql-querying-external-json-data/
cc @isha

In 5.5 CURL whitelist settings are changed. You need to set those in cluster using Web UI
Settings->Advanced Query Settings


#3

Really the interface doesn’t work properly: you can add one or more allowed curl urls, but the query gets an error.
But if you simulate to insert one or two disallowed curl urls and then remove they, the query works fine!


#4

This has been fixed in the upcoming release.