Jump to content

Error: SeekingLimitStream::getSize() must be compatible with StreamInterface::getSize()


Joo32
Go to solution Solved by websavers,

Recommended Posts

After upgrading to whmcs v8.8, we have a problem piping emails into ticket.
When an email comes to our inbox, we do a pipe forward to create a ticket like this(as we were already using it without any problem):

/opt/cpanel/ea-php81/root/usr/bin/php -q /home/----------/public_html/my/crons/pipe.php

But instead of creating a ticket, it shows an error in ActivityLog as below:

Whoops\Exception\ErrorException: Declaration of ZBateson\StreamDecorators\SeekingLimitStream::getSize() must be compatible with Psr\Http\Message\StreamInterface::getSize(): ?int in /home/-----------/public_html/my/vendor/zbateson/stream-decorators/src/SeekingLimitStream.php:74
#0 /home/-----------/public_html/my/vendor/whmcs/whmcs-foundation/lib/Utility/Error/Run.php(0): WHMCS\Utility\Error\Run->handleError(64, 'Declaration of ...', '/home/-----------/...', 74)
#1 [internal function]: WHMCS\Utility\Error\Run->handleShutdown()
#2 {main}

 

Any clue?

 

Thanks

 

Link to comment
Share on other sites

  • 1 month later...
  • 4 months later...

The error "Error: SeekingLimitStream::getSize() must be compatible with StreamInterface::getSize()" suggests a mismatch in the getSize() method between the SeekingLimitStream class and the StreamInterface interface in the PHP code. To fix this, ensure that the getSize() method in SeekingLimitStream has the same parameters and return type as specified in StreamInterface. This alignment should resolve the compatibility issue and eliminate the error.

Link to comment
Share on other sites

  • 1 year later...
  • 4 months later...
  • Solution

Encountered this same problem, preventing POP import to ticket from working. The issue was because of an addon that was updated with a newer version of the Guzzle Psr Library. Whomever is developing the addon would likely need to set Guzzle to version 7.0.1 only to match what WHMCS has in v8.x

For those with their own addons, here's how to do that in your addon (prior to upload to WHMCS):

Edit composer.json so that in the "require" section it has this: "guzzlehttp/guzzle": "7.0.1"

Since that needs PHP 7.2, we need to tell it to ignore the PHP requirements with --ignore-platform-reqs during 'update':

php composer.phar update --ignore-platform-reqs

Edited by websavers
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated