Skip to content

Uncaught UnderflowException: Frame #150

Open
@aeonwy

Description

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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions