ViewQuery Unauthorized - Password Required

I just upgraded from Couchbase community version 4.6.2 to 5.1.1 and it seems to have broken my Views. This is now the response from the server for every View query “unauthorized: password required”. (Only queries using Views fail).

I can’t figure out why i’m getting this.

Any ideas?

When you upgraded, was it a rebalance or offline upgrade from the same data? If so, that should create a new user with the same name as the bucket that does not require a password.

If you upgraded with backup/restore or some other method, 5.x’s RBAC feature will require you to create users/passwords.

If you have any suggestions on how this can be more clearly called out in the docs, please hit the feedback button there and let the team know, thanks!

Thanks for your response, it was a rebalance with the same data. I have 2 buckets currently (without password protection) and 2 users were created automatically (1 for each bucket, like you said). It created these users with empty strings as passwords.

Note-- our N1QL queries still work.

Whenever a query tries to access a View, we get that error. Do I have to specify in my code these new passwords? (empty string)
Do I have to authenticate?

Thanks

If it was a rebalance upgrade, then you shouldn’t have needed to do anything. Were any of the buckets named “default”? We may need to file an issue.

The best thing to do as a workaround, and in the long term anyway, would be to create users with passwords and appropriate permissions. That’s always the recommended approach for production deployments.

@kivey could you provide some more context about the client you’re using to run these view queries?

I can see you’ve tagged this post with node, are you using the node.js SDK?
If so, what version are you currently using?

First, i’d like to say we found a fix to this issue, which is to use the node.js SDK version 2.3.4.

We were previously using the node.js SDK version 2.2.5.

The SDK is on a CentOS virtual machine.

Seems to only like this specific SDK version, nothing higher, nothing lower.

I suspect you were hitting CCBC-885 - when you upgraded the node.js SDK version the embedded version of libcouchbase would also have been increased.

Glad to hear you got it working though!

1 Like

I tried giving the 2 users permissions/passwords but the only thing we found that fixed it was using the node.js SDK version 2.3.4, we were previously running version 2.2.5.