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

Some logs are uploaded with corrupted JSON/inline garbage data #320

Closed
erichoracek opened this issue Mar 28, 2024 · 7 comments
Closed

Some logs are uploaded with corrupted JSON/inline garbage data #320

erichoracek opened this issue Mar 28, 2024 · 7 comments
Assignees
Labels

Comments

@erichoracek
Copy link

erichoracek commented Mar 28, 2024

Describe the bug
We are encountering an issue where the Segment SDK is uploading malformed JSON.

We believe approximately 2.5-5% of uploads are exhibiting this issue, and we see it across a large range of our app versions.

To Reproduce
We haven't been able to reproduce this locally in the debugger, but have many logs and examples from production.

Expected behavior
The SDK should not upload malformed JSON.

Screenshots
N/A

Platform (please complete the following information):

  • Library Version in use: 1.4.7 to 1.5.5
  • Platform being tested: iOS
  • Integrations in use: None

Additional context
Here are some examples:

Batch elements with garbage data

{
    "batch": [
        { "redacted", "redacted" },
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00,
        { "redacted", "redacted" },
    ],
    "sentAt": "redacted",
    "writeKey": "redacted"
}

Multiple concatenated batches in a single batch

{
    "batch": [
        { "redacted", "redacted" },
        { "redacted", "redacted" },
        { "redacted", "redacted" },
    ],
    "sentAt": "redacted",
    "writeKey": "redacted"
},
{ "redacted", "redacted" },
{ "redacted", "redacted" },
],
"sentAt": "redacted",
"writeKey": "redacted"
}

Empty batch

],
"sentAt": "redacted",
"writeKey": "redacted"
}
@erichoracek
Copy link
Author

We are currently updating our app to use SDK version 1.5.9 and will let you know if this continues to occur after, it appears that 1.5.5 did not contain these changes #304

@bsneed
Copy link
Contributor

bsneed commented Mar 28, 2024

Thanks @erichoracek, please keep me posted. I'm hoping that issue is now resolved (along with others). Please reopen this if you're seeing any problems and I'll jump on it.

@bsneed bsneed closed this as completed Mar 28, 2024
@erichoracek
Copy link
Author

@bsneed We have deployed newer versions of our app with those changes integrated and are unfortunately still seeing malformed JSON being uploaded with SDK versions above 1.5.9. Can we reopen this issue?

@bsneed
Copy link
Contributor

bsneed commented Apr 25, 2024

Hi @erichoracek, it might be best to reach out to [email protected] or contact support. They'll be able to dig into your sources/workspace and help troubleshoot or identify what's happening. Happy to reopen and work with you here on it as well, but I wouldn't have the visibility that they do.

If you have any additional details or info, lemme know! Thanks Eric!

@bsneed bsneed reopened this Apr 25, 2024
@erichoracek
Copy link
Author

We are using Segment with a custom apiHost and cdnHost, so it doesn't go through the segment.com backend systems.

@bsneed
Copy link
Contributor

bsneed commented May 8, 2024

Sorry I missed your reply Eric, was digging into this more today and came back. So you're not sending data to segment at all, just using the sdk?

@bsneed
Copy link
Contributor

bsneed commented May 13, 2024

Made some additional changes in #343 and more stress testing along with file validation during stress test. I don't think this needs to be open any longer.

@bsneed bsneed closed this as completed May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants