Couchbase::get(): could not decompress value (bad content) when inserted with PHP7 extension and retrieved via PHP5 extension

When using the PHP7 couchbase extension to insert documents, it works fine, and documents are viewable via the web interface. However when trying to pull down the documents using the PHP5 SDK, this error is thrown:

“Couchbase::get(): could not decompress value (bad content)”. Is there a way to configure the compression on the PHP7 library to be compatible with the old one? Any advice would be appreciated.

You can use setTranscoder : https://github.com/couchbase/php-couchbase/blob/master/stub/CouchbaseBucket.class.php#L445

Could you specify extension version?

PHP7 is latest cloned directly from git master branch this morning.

PHP5 is couchbase-1.2.2 installed via PECL.

Can you lend any insight on what the appropriate value to pass to setTranscoder is to get it to work with couchbase-1.2.2?

I would recommend to install current version 2.2.1 if it is possible. Let me check 1.2.2 version, and I will put a snippet to make transition.

Do you use all default couchbase serialization settings?

It is unfortunately impossible to upgrade from 1.2.2 on the legacy machines right now (the purpose of getting this integration with the PHP7 client is to decomission the old code in a reasonable amount of time, but we’re not there yet).

Yes, we’re using all defaults.

Thanks for the help.

Hi avsej - I seem to have solved this issue!

I used settranscoder to set ‘couchbase_passthru_encoder’ and ‘couchbase_passthru_decoder’ and it worked!

Thanks to both your and srm!