On behalf is not working with get request

Description

when doing get operation with on_behalf returns LCB_ERR_TIMEOUT.
lcb store works without any error.
Without on_behalf_of header it returns correct results without any error.

code snippet:

lcb_CMDGET *cmd; lcb_cmdget_create(&cmd); std::cout << "DBG: GET CREATE" << std::endl; lcb_cmdget_collection(cmd, scope_name_.c_str(), scope_name_.size(), collection_name_.c_str(), collection_name_.size()); lcb_cmdget_key(cmd, key.c_str(), key.length()); lcb_cmdget_timeout(cmd, 500000000); std::string user = "Administrator"; lcb_cmdget_on_behalf_of(cmd, user.c_str(), user.size()); auto err = lcb_get(connection_, nullptr, cmd); std::cout << "Sending result: " << err << std::endl; err = lcb_wait(connection_, LCB_WAIT_DEFAULT); std::cout << "Wait result: " << err << std::endl;

Logging with on_behalf of

DBG: GET CREATE SBG: <localhost:11210> (HE=0x7ff518e066d0) Found ready connection in pool. Reusing socket and not creating new connection Sending result: 0 SBG: <localhost:11210> (HE=0x7ff518e066d0) Assigning R=0x7ff518d1dff0 SOCKET=0x7ff518e06b80 SBG: <localhost:11210> (SRV=0x7ff518d1d110) Got new KV connection (json=yes, snappy=yes, mt=yes, durability=no, bucket=yes "src") SBG: <localhost:11210> (CTX=0x7ff518d1e150,unknown) Pairing with SOCK=0de65e96a677a903 SBG: Background-polling for new configuration SBG: Refreshing current cluster map (bucket: src) SBG: Attempting to retrieve cluster map via CCCP SBG: Re-Issuing CCCP Command on server struct 0x7ff518d1d110 (localhost:11210) SBG: <NOHOST:NOPORT> (CTX=0x0,) Could not get configuration: LCB_ERR_TIMEOUT (201) SBG: Provider 'CCCP' failed: LCB_ERR_TIMEOUT (201) SBG: Maximum provider reached. Resetting index SBG: Background-polling for new configuration SBG: Refreshing current cluster map (bucket: src) SBG: Attempting to retrieve cluster map via CCCP SBG: Re-Issuing CCCP Command on server struct 0x7ff518d1d110 (localhost:11210) SBG: Failing command with error LCB_ERR_TIMEOUT (201): {"b":"src","i":"6aa5a66a945e924a/0de65e96a677a903/1","l":"127.0.0.1:54362","r":"localhost:11210","s":"kv:get_cluster_config","t":2500000} SBG: <localhost:11210> (CTX=0x7ff518d1e150,memcached,SRV=0x7ff518d1d110,IX=0) Server timed out. Some commands have failed SBG: <localhost:11210> (CTX=0x7ff518d1e150,memcached,SRV=0x7ff518d1d110,IX=0) Scheduling next timeout for 2499 ms. This is not an error SBG: <NOHOST:NOPORT> (CTX=0x0,) Could not get configuration: LCB_ERR_TIMEOUT (201) SBG: Provider 'CCCP' failed: LCB_ERR_TIMEOUT (201) SBG: Maximum provider reached. Resetting index SBG: Background-polling for new configuration SBG: Refreshing current cluster map (bucket: src)

Without on_behalf_of

DBG: GET CREATE SBG: <localhost:11210> (HE=0x7f953fe042f0) Found ready connection in pool. Reusing socket and not creating new connection Sending result: 0 SBG: <localhost:11210> (HE=0x7f953fe042f0) Assigning R=0x7f953fe06490 SOCKET=0x7f953fe04b60 SBG: <localhost:11210> (SRV=0x7f953fe05540) Got new KV connection (json=yes, snappy=yes, mt=yes, durability=no, bucket=yes "src") SBG: <localhost:11210> (CTX=0x7f953ff043f0,unknown) Pairing with SOCK=c8123446c183c3d6 Wait result: 0

Same operation works with go sdk

Environment

None

Gerrit Reviews

None

Release Notes Description

None

Activity

Show:

CB robot October 14, 2021 at 4:52 AM

Build couchbase-server-7.1.0-1491 contains libcouchbase commit 494582f with commit message:
https://couchbasecloud.atlassian.net/browse/CCBC-1510#icft=CCBC-1510: fix key length calculation for exists/get/touch/unlock

Sergey Auseyau October 13, 2021 at 11:25 AM

, , here is SHA-1 of merged change: 494582fa897e1e1ca9339c0695e70b2e4d8ab96a

Thank you for report

Sergey Auseyau October 13, 2021 at 8:50 AM

, , please verify this patch http://review.couchbase.org/c/libcouchbase/+/163540 and leave your review on gerrit. Then I will be able to merge it and will give you SHA-1 for the server

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Fix versions

Story Points

Reporter

Affects versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created October 11, 2021 at 6:25 AM
Updated October 14, 2021 at 4:52 AM
Resolved October 13, 2021 at 11:25 AM
Instabug