bref icon indicating copy to clipboard operation
bref copied to clipboard

Weird errors popping up occassionally

Open RikudouSage opened this issue 2 years ago • 5 comments

Description:

I got weird errors from time to time and I can't pinpoint why:

  • "Call to undefined method Symfony\Component\HttpClient\Response\AsyncResponse::schedule()" at /var/task/vendor/symfony/http-client/Response/AsyncResponse.php line 147 - the line 147 contains only {
  • "Symfony\Component\HttpClient\Response\CurlResponse::initialize(): Argument #1 ($response) must be of type Symfony\Component\HttpClient\Response\CurlResponse, Symfony\Component\HttpClient\Response\CurlResponse given, called in /var/task/vendor/symfony/http-client/Response/CommonResponseTrait.php on line 41" at /var/task/vendor/symfony/http-client/Response/CommonResponseTrait.php line 132 - line 41 contains self::initialize($this);, I don't see how this can happen
  • "SplObjectStorage::offsetSet(): Argument #1 ($object) must be of type object, null given" at /var/task/vendor/symfony/http-client/Response/TransportResponseTrait.php line 230 - That line doesn't contain anything related to SplObjectStorage

How to reproduce:

It's this project: https://github.com/RikudouSage/SlackChatGPT

Configure .env variables and deploy using serverless.

RikudouSage avatar Jun 02 '23 09:06 RikudouSage

Hi, any reason to think this is related to Bref?

mnapoli avatar Jun 02 '23 13:06 mnapoli

Well, something like that never happened to me on a standard setup, bref is the only non-standard thing in the stack. I can't really think of anything else causing this.

Edit: Especially the 2nd error sounds like something's wrong with the runtime.

RikudouSage avatar Jun 02 '23 16:06 RikudouSage

I spent 5 minutes looking into this and indeed, the errors don't make any sense…

I have no idea, only throwing random ideas: could it be the cache created locally is very different to the code deployed in Lambda? Could it be something with opcache caching alternative versions of the file (but why and how)?

Oh also just to be sure: could it be PHP objects serialized and sent to SQS, and then a deployment happens, and the worker deserializes the objects but the code has changed in the meantime?

Nothing serialized into the DB either?

Cool project btw!

mnapoli avatar Jun 05 '23 10:06 mnapoli

could it be the cache created locally is very different to the code deployed in Lambda?

Nope.

Could it be something with opcache caching alternative versions of the file (but why and how)?

That's the only conclusion I came to, but the why and how still escapes me.

could it be PHP objects serialized and sent to SQS, and then a deployment happens, and the worker deserializes the objects but the code has changed in the meantime?

In theory yes, but those weren't the cases. Also the first and second error couldn't happen because of serialization, only the property values are serialized.

Nothing serialized into the DB either?

Nothing that seems related, there's only Symfony's rate limiter SlidingWindow object serialized.

Cool project btw!

Thanks!

Currently I've disabled the advanced opcache parameters and am waiting to see if that solved it.

RikudouSage avatar Jun 05 '23 11:06 RikudouSage

Ohh the jit could be the culprit maybe 🤔

mnapoli avatar Jun 05 '23 17:06 mnapoli

Closing because of inactivity.

mnapoli avatar Mar 19 '24 14:03 mnapoli