Comments (15)
Hi @Edujugon,
Didn't have time to test this in php7.1.4 nor in 7.0.18, but will do it next week, as I plan to update at least one of my servers. For now I am using self-written script which chunks data into smaller sets.
The payload which crashed in my case contains 1000tokens and one-two lines in the message body.
Best,
Daniel
from pushnotification.
Hi @efeferrari
Have you tried to test it in other environment?
from pushnotification.
I tried in local and development environments. In both, I set ini_set memory_limit to 1 GB.
from pushnotification.
Same issue, Any luck on finding a fix for this?
from pushnotification.
I try with a new iOS certificate and works fine, but it's still a bug get an "Out of memory" instead an "invalid certificate" 🤔
from pushnotification.
Hi @efeferrari @Drozes ,
I'm really busy these days and I'm not able to check out this issue.
For now, as @efeferrari said , you can generate a new certificate and try with it. It's not the first time that generating a new certificate solves some issues..
from pushnotification.
Hi also having this issue with a new cert, anyone find the issue?
from pushnotification.
Hi @gl3nda85 ,
Could you try to call apnsFeedback()
method and see if it returns any token?
Notice that method returns a list of tokes that should be removed from the deviceToken list to send the notification.
Then, try again to send the notification.
Let me know if that helped
from pushnotification.
Hi Edujugon,
I am experiencing kind of the same error: when trying to send pushes to APN the php starts consume memory, freezes and at the end I got "PHP Fatal error: Allowed memory....".
The feedback() method is not even called because all freezes on send().
Any clue?
Best,
Daniel
Laravel 5.2, PHP 7.0
from pushnotification.
Hi @danielz0 ,
In the next days I'll dig deeply into this issue. Would you share your certificate with me so I could do tests with that one as well? if so, send me a mail to [email protected]
In the meantime, have you tried to generate a new Certificate? most probably is Apple who is refusing the connection to its server..
from pushnotification.
Hi again,
I am sorry to say, but the same certificate used on another server works totally fine.
I have traced this for errors and I am sure that
class Apn extends PushService implements PushServiceInterface
public function send(array $deviceTokens,array $message)
is the one which generates problem.
In details I have two servers with Laravel 5.2 and PHP7.0
Both were working fine, until one day one of it stopped sending iOS pushes.
After days of tracing the only thing I got is
Symfony\Component\Debug\Exception\FatalErrorException: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /default/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:59
I have tried all tricks, from modules update to increasing memory limits - no luck so far.
When using strace I can see that the Apple push service returns 'operation in progress' all the time which increasing occupied memory and finally leads to memory exception.
Not sure, but personally I think it might be something connected with system libraries.
I am going to generate list of files your process is trying to open on both servers and compare.
Any suggestions are welcome.
Thanks!
Daniel
from pushnotification.
Maybe this will help you?
Strace:
[pid 27958] 19:53:56 recvmsg(12, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\24\0\0\0\3\0\2\0\244\253\25Z6m\0\0\0\0\0\0", 4096}], msg_controllen=0, msg_flags=0}, 0) = 20 [pid 27958] 19:53:56 close(12) = 0 [pid 27958] 19:53:56 socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 12 [pid 27958] 19:53:56 connect(12, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("17.188.135.152")}, 16) = 0 [pid 27958] 19:53:56 getsockname(12, {sa_family=AF_INET, sin_port=htons(40476), sin_addr=inet_addr("46.101.111.122")}, [16]) = 0 [pid 27958] 19:53:56 connect(12, {sa_family=AF_UNSPEC, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, 16) = 0 [pid 27958] 19:53:56 connect(12, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("17.188.129.28")}, 16) = 0 [pid 27958] 19:53:56 getsockname(12, {sa_family=AF_INET, sin_port=htons(56513), sin_addr=inet_addr("46.101.111.122")}, [16]) = 0 [pid 27958] 19:53:56 connect(12, {sa_family=AF_UNSPEC, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, 16) = 0 [pid 27958] 19:53:56 connect(12, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("17.188.137.23")}, 16) = 0 [pid 27958] 19:53:56 getsockname(12, {sa_family=AF_INET, sin_port=htons(40665), sin_addr=inet_addr("46.101.111.122")}, [16]) = 0 [pid 27958] 19:53:56 connect(12, {sa_family=AF_UNSPEC, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, 16) = 0 [pid 27958] 19:53:56 connect(12, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("17.188.135.148")}, 16) = 0 [pid 27958] 19:53:56 getsockname(12, {sa_family=AF_INET, sin_port=htons(59539), sin_addr=inet_addr("46.101.111.122")}, [16]) = 0 [pid 27958] 19:53:56 connect(12, {sa_family=AF_UNSPEC, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, 16) = 0 [pid 27958] 19:53:56 connect(12, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("17.188.130.23")}, 16) = 0 [pid 27958] 19:53:56 getsockname(12, {sa_family=AF_INET, sin_port=htons(56115), sin_addr=inet_addr("46.101.111.122")}, [16]) = 0 [pid 27958] 19:53:56 connect(12, {sa_family=AF_UNSPEC, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, 16) = 0 [pid 27958] 19:53:56 connect(12, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("17.188.141.156")}, 16) = 0 [pid 27958] 19:53:56 getsockname(12, {sa_family=AF_INET, sin_port=htons(54942), sin_addr=inet_addr("46.101.111.122")}, [16]) = 0 [pid 27958] 19:53:56 connect(12, {sa_family=AF_UNSPEC, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, 16) = 0 [pid 27958] 19:53:56 connect(12, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("17.188.135.26")}, 16) = 0 [pid 27958] 19:53:56 getsockname(12, {sa_family=AF_INET, sin_port=htons(37714), sin_addr=inet_addr("46.101.111.122")}, [16]) = 0 [pid 27958] 19:53:56 connect(12, {sa_family=AF_UNSPEC, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, 16) = 0 [pid 27958] 19:53:56 connect(12, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("17.188.130.157")}, 16) = 0 [pid 27958] 19:53:56 getsockname(12, {sa_family=AF_INET, sin_port=htons(43001), sin_addr=inet_addr("46.101.111.122")}, [16]) = 0 [pid 27958] 19:53:56 close(12) = 0 [pid 27958] 19:53:56 socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 12 [pid 27958] 19:53:56 fcntl(12, F_GETFL) = 0x2 (flags O_RDWR) [pid 27958] 19:53:56 fcntl(12, F_SETFL, O_RDWR|O_NONBLOCK) = 0 [pid 27958] 19:53:56 connect(12, {sa_family=AF_INET, sin_port=htons(2195), sin_addr=inet_addr("17.188.135.152")}, 16) = -1 EINPROGRESS (Operation now in progress)
This EINPROGRESS (Operation now in progress) lasts couple of minutes depend on how big is the memory limit and results in:
Symfony\Component\Debug\Exception\FatalErrorException: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /default/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:59 Stack trace: #0 {main}
from pushnotification.
Hi @Edujugon
I think I found the problem which might be here reactphp/stream#64
Let me know your thoughts.
Best,
Daniel
from pushnotification.
Hi @danielz0 ,
Thank you for your support, I really appreciate it :)
Have you tested it in PHP 7.1.4 or 7.0.18 ? Does that work for you?
It seems to have a work-around for PHP < 7.1.4 (and PHP < 7.0.18) but since it has a performance penalty it may be the reason of that issue.
I have to test it in different PHP versions with a big data/payload to send.
from pushnotification.
The new releases (3.x & 2.2.x) prevent of this error.
I'm closing this issue. feel free to open it again if the error persists.
from pushnotification.
Related Issues (20)
- Unable to send notifications via FCM.
- Content-Type:" is not valid header name HOT 6
- Document breaking change in v4.5.1?
- [L 6.0]Testing push notification
- Breaking change in 4.5.1: Undefined index: headers HOT 2
- loc-key and loc-args on the payload
- Undefined index: headers HOT 7
- Need support of Voip
- Badge count not working with fcm
- Push notiication not working on Ios
- update to newer versions
- notifications not sendings HOT 2
- Installation issue with laravle9.2 HOT 4
- Issue in Laravel 9.2 HOT 7
- FCM Api Key HOT 2
- add support for huawei
- cannot send push notifications(ios, android)
- Error al crear $push = new PushNotification
- MissingTopic HOT 1
- Migrating from legacy FCM to HTTP v1 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pushnotification.