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

Uncaught UnderflowException: Frame #150

Open
aeonwy opened this issue Sep 20, 2023 · 0 comments
Open

Uncaught UnderflowException: Frame #150

aeonwy opened this issue Sep 20, 2023 · 0 comments

Comments

@aeonwy
Copy link

aeonwy commented Sep 20, 2023

Of the two original examples, I can get the first to run as a command line fired PHP script. If I put either example into an existing PHP application I get the following:

[Wed Sep 20 16:23:08.502653 2023] [php:notice] [pid 1396:tid 139932718855872] [client 10.0.3.20:54307] Unhandled promise rejection with UnderflowException: Frame must be coalesced before applying mask in /nvme/apache2/qa.bei-oregon.com/htdocs/bei2/global/includes/vendor/ratchet/rfc6455/src/Messaging/Frame.php:78
Stack trace:
#0 [internal function]: Ratchet\\RFC6455\\Messaging\\Frame::Ratchet\\RFC6455\\Messaging\\{closure}()
#1 /nvme/apache2/qa.bei-oregon.com/htdocs/bei2/global/includes/vendor/ratchet/rfc6455/src/Messaging/Frame.php(287): call_user_func()
#2 /nvme/apache2/qa.bei-oregon.com/htdocs/bei2/global/includes/vendor/ratchet/rfc6455/src/Messaging/Frame.php(267): Ratchet\\RFC6455\\Messaging\\Frame->unMaskPayload()
#3 /nvme/apache2/qa.bei-oregon.com/htdocs/bei2/global/includes/vendor/ratchet/pawl/src/WebSocket.php(131): Ratchet\\RFC6455\\Messaging\\Frame->maskPayload()
#4 /nvme/apache2/qa.bei-oregon.com/htdocs/bei2/scheduleThree/includes/php/scheduleFunctions.inc.php(495): Ratchet\\Client\\WebSocket->send()
#5 /nvme/apache2/qa.bei-oregon.com/htdocs/bei2/global/includes/vendor/react/promise/src/Internal/FulfilledPromise.php(47): {closure}()
#6 /nvme/apache2/qa.bei-oregon.com/htdocs/bei2/global/includes/vendor/react/promise/src/Promise.php(169): React\\Promise\\Internal\\FulfilledPromise->then()
#7 /nvme/apache2/qa.bei-oregon.com/htdocs/bei2/global/includes/vendor/react/promise/src/Promise.php(217): React\\Promise\\Promise::React\\Promise\\{closure}()
#8 /nvme/apache2/qa.bei-oregon.com/htdocs/bei2/global/includes/vendor/react/promise/src/Promise.php(279): React\\Promise\\Promise->settle()
#9 /nvme/apache2/qa.bei-oregon.com/htdocs/bei2/global/includes/vendor/react/promise/src/Deferred.php(42): React\\Promise\\Promise::React\\Promise\\{closure}()
#10 /nvme/apache2/qa.bei-oregon.com/htdocs/bei2/global/includes/vendor/ratchet/pawl/src/Connector.php(106): React\\Promise\\Deferred->resolve()
#11 /nvme/apache2/qa.bei-oregon.com/htdocs/bei2/global/includes/vendor/evenement/evenement/src/EventEmitterTrait.php(143): Ratchet\\Client\\Connector->Ratchet\\Client\\{closure}()
#12 /nvme/apache2/qa.bei-oregon.com/htdocs/bei2/global/includes/vendor/react/stream/src/Util.php(71): Evenement\\EventEmitter->emit()
#13 /nvme/apache2/qa.bei-oregon.com/htdocs/bei2/global/includes/vendor/evenement/evenement/src/EventEmitterTrait.php(143): React\\Stream\\Util::React\\Stream\\{closure}()
#14 /nvme/apache2/qa.bei-oregon.com/htdocs/bei2/global/includes/vendor/react/stream/src/DuplexResourceStream.php(196): Evenement\\EventEmitter->emit()
#15 /nvme/apache2/qa.bei-oregon.com/htdocs/bei2/global/includes/vendor/react/event-loop/src/StreamSelectLoop.php(246): React\\Stream\\DuplexResourceStream->handleData()
#16 /nvme/apache2/qa.bei-oregon.com/htdocs/bei2/global/includes/vendor/react/event-loop/src/StreamSelectLoop.php(213): React\\EventLoop\\StreamSelectLoop->waitForStreamActivity()
#17 /nvme/apache2/qa.bei-oregon.com/htdocs/bei2/scheduleThree/includes/php/scheduleFunctions.inc.php(501): React\\EventLoop\\StreamSelectLoop->run()
#18 /nvme/apache2/qa.bei-oregon.com/htdocs/bei2/scheduleThree/scheduleAJAX_copyOrClearCell.php(112): schedulerBroadcast()
#19 {main}, referer: http://qa.bei-oregon.com/bei2/scheduleThree/schedule.php?uid=X650b7c7b8c23b350750961&deptID=4&runType=day

Code that generated the above:

 $connString = "ws://qa.bei-oregon.com:8084";
 $loginString="valid_user=999999&uid=LKLO&@#NC(*#@";
 // $bcastData is passed into the function that runs the below

   // Pawl extended example
   $reactConnector = new \React\Socket\Connector();
   $loop = \React\EventLoop\Loop::get();
   $connector = new \Ratchet\Client\Connector($loop);

  $connector($connString, [], ['Origin' => 'http://qa.bei-oregon.com'])
    ->then(function(Ratchet\Client\WebSocket $conn) use ( $loop ) {
         global $loginString;  // Only way to get the $loginString into this area;
         global $bcastData; // Only way that I can figure out how to get this usable inside the $connector->then
        // Simple echo on message received for the test.
        $conn->on('message', function(\Ratchet\RFC6455\Messaging\MessageInterface $msg) use ($conn) {
            echo "Received: {$msg}\n";
        });

        $conn->on('close', function($code = null, $reason = null) {
            echo "Connection closed ({$code} - {$reason})\n";
        });
        $conn->send($loginString);
        $conn->send($bcastData);
    }, function(\Exception $e) use ($loop) {
        echo "Could not connect: {$e->getMessage()}\n";
        $loop->stop();
    });

Edited: Please take the time to properly report and format tickets, thank you.

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

No branches or pull requests

1 participant