buggregator / server

Buggregator is a lightweight, standalone server that offers a range of debugging features for PHP applications.
https://buggregator.dev/
Other
648 stars 23 forks source link

JsonException: Syntax error #204

Closed leekung closed 2 months ago

leekung commented 2 months ago

Logs from running pod (ghcr.io/buggregator/server:1.10.1) ` root@g2cv9w0s:~# k logs -f --tail=20 buggregator-7555b6f47b-gm5qz [INFO] RoadRunner server started; version: 2023.3.7, buildtime: 2023-11-30T19:15:58+0000 [INFO] sdnotify: not notified 2024-06-12T08:55:27+0000 ERROR app JsonException: Syntax error in /app/app/modules/Sentry/Interfaces/Http/Handler/JsEventHandler.php at line 43 [] []

`

app/modules/Sentry/Interfaces/Http/Handler/JsEventHandler.php

        $payloads = \array_map(
            static fn(string $payload): array => \json_decode($payload, true, 512, \JSON_THROW_ON_ERROR),
            \explode("\n", (string) $request->getBody()),
        );

request made from vue.js v3 POST /api/1/envelope/?sentry_key=sentry&sentry_version=7&sentry_client=sentry.javascript.vue%2F8.7.0

butschster commented 2 months ago

Hi @leekung

Could you provide request payload?

butschster commented 2 months ago

I created a PR with some fix. Probably it's your case, but I'm not sure. It would be great to look at your payload

leekung commented 2 months ago

I created a PR with some fix. Probably it's your case, but I'm not sure. It would be great to look at your payload

I see error related to your PR too. but it is not related to this case

Here is the payload

https://gist.github.com/leekung/6ba8e10565ac875ea283191a24dd249d

I think the problem maybe the session recording payload as it contains illegal characters

here is my init

import { createApp } from 'vue'
import App from '@/App.vue'

import * as Sentry from '@sentry/vue'

const app = createApp(App)

Sentry.init({
  app,
  dsn: import.meta.env.VITE_SENTRY_DSN, //"https://sentry@bug.mysite.cc/1"
  environment: import.meta.env.VITE_SENTRY_ENVIRONMENT || 'development',
  integrations: [
    Sentry.browserTracingIntegration(),
    Sentry.replayIntegration(),
  ],
  tracesSampleRate: 1.0,
  replaysSessionSampleRate: 0.1,
  replaysOnErrorSampleRate: 1.0,
})

Note: you have to make script error somewhere so it can post session replay data

butschster commented 2 months ago

Hey! I've been looking into an issue with replays. Right now, Buggregator doesn't support them. However, we're planning to focus next on adding support for transactions and replays.

I've fixed an exception, but you still won't see replays for now.