-
-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
saveDocument() - E_DEPRECATED: Couchbase\defaultDecoder(): Passing null to parameter #1 ($bytes) of type string is deprecated #918
Comments
Hello curious contributor !
|
Ok, i'll take a look this weekend |
I'm running into the same issue lately. Have you been able to check this @Geolim4 ? Thanks for reporting @MetroConductor |
@Fabbzz @MetroConductor The faulty line:
Seems not to need a parameter as per the official stubs: May @srjlewis do you have an idea on this ? |
@Geolim4 OK, good because I think we can't... or PHPfastcache needs to retry as I do myself before I totally let my script die so I actually never run into this issue. I made the following issue @couchbase-php-client : couchbase/couchbase-php-client#185 Let's hope they respond faster then we can try/catch/cache ;) |
I'm afraid that the issue will leads to nothing as the v3 extension is deprecated and replaced by the v4 since 2 years now :( |
@Geolim4 mhh, that means a huge refactor from your side ? |
No, the Couchbasev4 support already exists as an extension :) |
@Geolim4 Let me dive into that, thanks! Maybe add a deprecated warning for V3 then ? |
Hi It looks like it is link to either the following RFC's
@Fabbzz You have created your issue aginst SDK v4 which was completely rewritten. this is the defaultDecoder methordd within v3 https://github.com/couchbase/php-couchbase/blob/bb84ac2714b82f7df125855cb0949066eb10cbf5/couchbase.c#L914 and does not set bytes as nullable We could try making our own encoder/decoder $this->bucket->setTranscoder(
function ($value) {
return array(serialize($value), 0, 0);
},
function ($value, $flags, $datatype) {
/** @noinspection UnserializeExploitsInspection */
return unserialize($value);
}
); |
I have also check the upgrade path of the OS Alpine 3.16 and the OS is EOL as well as of 2024-05-23 Alpine 3.16 does have a package for SDK v4, but since it is the very first version of the v4 SDK, I would say "use at your own risk" |
No worries, now we did deprecate it all together 😄 (I remembered you did in the past!) |
You see issues with it ?? (Sorry for the extra reply) |
I see there has been a lot of changes and bug fixes between v4.0.0 to v4.2.3 so I cant predict what issues you could encouter, I have done my best to make the v4 driver within phpfastcache work with all versions of v4 that we could test with. You could always give it a try and see what success you have. or the other option is to turn off deprcations within PHP and then look at a migration to a up to date web stack. |
@srjlewis Yes indeed and with docker; it's easy to just fire another 3.20+ Alpine container! |
@Fabbzz If you are able to fire a 3.20+ container easily and use it (not all poeple have that option), that would be great and if you need a hand with thw v4 driver, drop me a message. |
@srjlewis Happily I am indeed! I build all my own images because of legacy which I don' t want or sometimes need. |
Hi guys, I've just read through the thread, did I got it right that there is nothing blocking the work of fastcache if it is using couchbase library v4? If the data should be treated as just bytes, you can use |
Hi @avsej Our v4 driver is having no issues and does not have this issue. The OP is use couchbase v3 and our v3 driver with PHP 8.1 PHP 8.1 introduce a RFC Deprecate passing null to non-nullable arguments of internal functions and within the couchbase v3 SDK it is doing a internal call. The deprcation warning is only being raised when a document does not exist. The deprication is being raised on the following line within our v3 driver.
Before PHP 8.1 the the $document->content() would return a false value without a deprication warning.
within the v4 driver we are able to check for the error, but the error method does not exist in the v3 SDK The transcoder you to point to are in the v4 SDK is there the equivalate within the v3 SDK and would it advoid the internal call on a non existant document when calling the ```$document->content()`` method? |
What type of issue is this?
Exception/Error/Warning/Notice/Deprecation
Operating system + version
Alpine 3.16
PHP version
8.1.22
Connector/Database version (if applicable)
Couchbase CE 7.2.2 + PECL Extension 3.2.2
Phpfastcache version
9.2.0 ✅
Describe the issue you're facing
Whenever storing a new document (that is, a document that doesn't exist yet), I'm faced with the following exception:
The interesting thing is, this is only when saving a document that didn't exist previously; updating works without a hitch. I searched high and low, but I couldn't find anyone describing anything similar. Is anyone familiar with this issue?
Suggestion to fix the issue (optional)
It seems like somehow Couchbase's defaultDecoder is called without a payload, which could be because the document indeed doesn't exist yet. If you ask me, there should be a if to prevent the decoder from being called without data
Have you searched in our Wiki before posting ?
The text was updated successfully, but these errors were encountered: