Skip to content
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

Undefined constant "Couchbase\COUCHBASE_EXTENSION_NAMESPACE" #193

Closed
srjlewis opened this issue Nov 27, 2024 · 3 comments · Fixed by #196
Closed

Undefined constant "Couchbase\COUCHBASE_EXTENSION_NAMESPACE" #193

srjlewis opened this issue Nov 27, 2024 · 3 comments · Fixed by #196
Assignees

Comments

@srjlewis
Copy link
Contributor

srjlewis commented Nov 27, 2024

I am getting to following error when calling public static function notifyFork(string $event)

Error Object
(
    [message:protected] => Undefined constant "Couchbase\COUCHBASE_EXTENSION_NAMESPACE"
    [string:Error:private] =>.
    [code:protected] => 0
    [file:protected] => /opt/xxx/api/vendor/couchbase/couchbase/Couchbase/Cluster.php
    [line:protected] => 141
)
@srjlewis
Copy link
Contributor Author

srjlewis commented Nov 27, 2024

I have done a bit more testing.

I am usingPHP 8.3.14 (cli), It works with "couchbase/couchbase": "4.2.4"

It looks to be related to #187

@avsej
Copy link
Member

avsej commented Dec 2, 2024

@srjlewis thank you for your report. I will look into it and report shortly

@srjlewis
Copy link
Contributor Author

srjlewis commented Dec 2, 2024

@avsej I have figured out what is causing the issue, we use lazy loading for our caching drivers.

In some instances we are forking the process before calling any caching calls, so a Cluster object has not been initialized.

But since Cluster::notifyFork() is a static call and can be called independent of a Cluster object being initialized, so should not be depentant on a defined value that is only set when a Cluster object is created.

Hope the above is helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants