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

JsonException: Syntax error #204

Closed
leekung opened this issue Jun 12, 2024 · 4 comments · Fixed by #205
Closed

JsonException: Syntax error #204

leekung opened this issue Jun 12, 2024 · 4 comments · Fixed by #205
Assignees
Labels
bug Something isn't working module [Sentry]
Milestone

Comments

@leekung
Copy link

leekung commented Jun 12, 2024

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 butschster self-assigned this Jun 13, 2024
@butschster butschster added bug Something isn't working module [Sentry] labels Jun 13, 2024
@butschster butschster added this to the 1.0 milestone Jun 13, 2024
@butschster
Copy link
Member

Hi @leekung

Could you provide request payload?

@butschster
Copy link
Member

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
Copy link
Author

leekung commented Jun 14, 2024

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://[email protected]/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
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working module [Sentry]
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants