Hello,
I have a strange situation, from time to time JSON objects, are reported as being Binary documents, but they are definitely simple JSON. What could be the problem?
I see that it is saying that it is an invalid JSON, but not sure how it is possible as there is a simple function which is transformed an array into a JSON and then it is saving it in the DB
I have been able to get the document (and it contains garbage inside. So, definitely something is very wrong)
{"app_uuid":"41354852-c166-46ee-b510-3f53ac800a0a","should_refresh":true,"country_code":"lb","sub_type":"app","app_store":{"app_id":1180905152,"should_refresh":true},"app_play":{"app_id":null,"should_refresh":false},"key":"meta:41354852-c166-46ee-b510-3f53ac800a0a:lb","created_timestamp":1602149598,"type":"tracker-app","version":2},!E��meta:41354852-c166-46ee-b510-3f53ac800a0a:lb��Z{"app_uuid":"41354852-c166-46ee-b510-3f53ac800a0a","should_refresh":true,"country_code":"lb*ub_typapp",4_store": � �(1180905152,Rh},D(_playD
appEnullF?fals@(key":"meta:��:�|created_timestamp":1602149598,"t �tracker- �(version":2}��,,,�meta:1cbc8404-ca72-48f1-bf3a-77e1912eb45d:lb,,D��meta:1cbc8404-ca72-48f1-bf3a-77e1912eb45d:lb��Z{"app_uuid":"1cbc8404-ca72-48f1-bf3a-77e1912eb45d","should_refresh":true,"country_code":"lb*ub_typapp",4_store": � �(1437710400,Rh} D(_playD
appEnullF?fals@(key":"meta:��:�|created_timestamp":1602149991,"t �tracker- �(version":2},,D��meta:1cbc8404-ca72-48f1-bf3a-77e1912eb45d:lb��Z{"app_uuid":"1cbc8404-ca72-48f1-bf3a-77e1912eb45d","should_refresh":true,"country_code":"lb*ub_typapp",4_store": � �(1437710400,Rh} D(_playD
app
the JSON object should have been like this.
{
"app_uuid": "41354852-c166-46ee-b510-3f53ac800a0a",
"should_refresh": true,
"country_code": "lb",
"sub_type": "app",
"app_store": {
"app_id": 1180905152,
"should_refresh": true,
},
"app_play": {
"app_id": null,
"should_refresh": false
},
"key": "meta:41354852-c166-46ee-b510-3f53ac800a0a:us",
"created_timestamp": 1602149430,
"type": "tracker-app",
"version": 2,
"updated_timestamp": 1602149596
}
Can anybody from Couchbase help me fix this bug?
Couchbase environment:
Runtime: Version=3.0.5, Changeset=b14a8e4c392add9ba367a47c4936a793ccb1c5fe
Headers: Version=3.0.5, Changeset=b14a8e4c392add9ba367a47c4936a793ccb1c5fe
Build Timestamp: 2020-09-21 11:33:37
Default plugin directory: /usr/lib64/libcouchbase
IO: Default=libevent, Current=select, Accessible=select
SSL Runtime: OpenSSL 1.0.2k-fips 26 Jan 2017
SSL Headers: OpenSSL 1.0.2k-fips 26 Jan 2017
Snappy: 1.1.1
Tracing: SUPPORTED
System: Linux-4.15.0-91-generic; x86_64
CC: GNU 4.8.5; -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fno-strict-aliasing -ggdb3 -pthread
CXX: GNU 4.8.5; -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fno-strict-aliasing -ggdb3 -pthread
Couchbase version 6.6 Enterprise
rpm -qa | grep couchbase
libcouchbase3-3.0.5-1.el7.x86_64
libcouchbase-devel-3.0.5-1.el7.x86_64
libcouchbase3-tools-3.0.5-1.el7.x86_64
I tried this on two different servers and it is happening the same. So I don’t suspect a hardware problem
I have updated the PHP from 7.4.9 to 7.4.11 and I have the same issues. Also, I have discovered some documents with keys and data from other documents, so this cannot happen from my current code.
It is either a problem on the Couchbase server or in the Coucbase lib couchbase.so
I have Couchbase in debug mode, so we can investigate the logs, not sure how I can correlate the PHP code and the Couchbase debug log.
Definitely, there is a problem outside of PHP, I am logging all the insert s and gets and logging all the documents which are not of type array/json. Always the error appears when I read it from the database, not before adding it in the database.
@ingenthr Can you please help?