Closed momar3632 closed 3 weeks ago
Thank you for the report, there seems to be some place in the SDK in which the exception matching doesn't cover the ConnectException
case, I'll look into it.
However - you can't solve the underlying problem by defining the undefined constant, it will still fail because your environment can't make the connection to Firebase. It looks as if you have a fairly recent version of cURL and an SSL binding installed, so I'm at a loss why the connection can't be made 🤔
I have a server using the CWP control panel with PHP 8.2. Initially, the cURL version was:
curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.90 zlib/1.2.7 libidn/1.28 libssh2/1.8.0
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz unix-sockets
However, after some research, I found that CURL_SSLVERSION_TLSv1_2 doesn't work with this version, so I tried to update the version to 7.88.0.
curl 7.88.1 (x86_64-pc-linux-gnu) libcurl/7.88.1 OpenSSL/1.0.2k-fips zlib/1.2.7 nghttp2/1.33.0
Release-Date: 2023-02-20
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS HSTS HTTP2 HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL UnixSockets
Unfortunately, I can't provide free support for problems that might be related to the environment in which a project using the SDK is running, only share my thoughts and give suggestions when I see something that stands out in a reported issue. Here, I can't see where the Laravel package or the SDK could be the cause of the problem.
I also looked into the code base of the SDK to find out where the "expected RequestException, got ConnectException" error might occur, but couldn't find it. All exceptions related to the messaging component are handled by the MessagingApiExceptionConverter
, and it can handle any exception, and explicitly Guzzle's ConnectException
(which is a class implementing Psr\Http\Client\NetworkExceptionInterface
.
The only suggestion left for me to give is to do a composer update -W
to update all composer dependencies in your projects. After that, see which depenencies you can upgrade to a next major version by checking composer outdated
.
If you're experiencing the problem in one environment, but not the other, make sure that both environment are identical (same PHP versions, same cURL versions, etc.).
I'm closing this issue now because I currently don't see where the SDK or the Laravel package might be involved in the problem, but if you can find the problem in the underlying SDK, please point me to it and I'll do my best to find a solution.
If you find a solution to the problem, please feel free to share your findings here so that others might benefit from them.
Actually, the issue was with the environment where the project was located. I reinstalled PHP, and now everything is working without any problems.
Thank you very much
Great to hear and that you got it worked out! 🙌🏻
Describe the bug
Argument #1 ($reason) must be of type
Installed packages
PHP version and extensions
Steps to reproduce the issue.
Error message/Stack trace
Additional information
At first there was no problem: :"Undefined constant \"CURL_SSLVERSION_TLSv1_2\"
I used this code and solved the problem :
After that, this problem appeared and I was unable to solve it Kreait\Firebase\Messaging::Kreait\Firebase{closure}(): Argument #1 ($reason) must be of type GuzzleHttp\Exception\RequestException, GuzzleHttp\Exception\ConnectException given, called in /home/fireapps/fireapp.com/vendor/guzzlehttp/promises/src/EachPromise.php on line 183
Note that I am using a library https://tenancyforlaravel.com/
And use this code to update config
in provider tenant
code :
and i try this
Same mistake