Error uploading events from batch file
abdullahjhussein opened this issue · comments
Describe the bug
message= Error uploading events from batch file
fileUrl="/data/user/0/package_id/app_segment-disk-queue/UfVKIEDDpKxJ37CXxuFpSsOybierN7HW-778"
msg=/data/user/0/package_id/app_segment-disk-queue/UfVKIEDDpKxJ37CXxuFpSsOybierN7HW-778: open failed: ENOENT (No such file or directory), event=null
Platform (please complete the following information):
- Library Version in use: com.segment.analytics.kotlin:android:1.7.0
- Platform being tested: Android
hey @abdullahjhussein, this looks like the sdk is trying to upload a file that's been already uploaded. can you provided more context in terms of the following:
- are you still experiencing this issue? if so, how often do you see this happening?
- does this error interrupt the sdk or crash your app? if it does crash your app, can you provide a stack trace?
theoretically this issue shouldn't happen, since we serializes the file uploading with a single thread. even if it does, it shouldn't interrupt anything.
@wenxi-zeng
Thank you for your response
This issue is still appearing in the LogCat but not interrupt the SDK or crash the app
I'm also seeing this issue. Here's a sample error message:
message= Error uploading events from batch file
fileUrl="/data/user/0/my.package.name.here/app_segment-disk-queue/ddMUo4VVm1FQiNDZBBGJlaHG5y9l5wsX-26"
msg=/data/user/0/my.package.name.here/app_segment-disk-queue/ddMUo4VVm1FQiNDZBBGJlaHG5y9l5wsX-26: open failed: ENOENT (No such file or directory)
I'm on v1.10.6:
implementation("com.segment.analytics.kotlin:android:1.10.6")
I see this error on Android APIs 30 and 33; those are the only ones I've tested so far.
When I open the directory referenced in the error, that directory is empty, so the error makes sense. It seems like Segment is not writing the file to begin with.
This appears to be stopping the app from sending data from the device, so we're kind of blocked without a fix for this issue. It appears that data is coming through in the debugger, but it's hard to tell if there are any intermittent failures. Please let me know if there was anything discovered to resolve this.
hey @benbackstrom, thanks for providing more context. there should not be any intermittent failures, since the batch is uploaded as a file. it's an atomic operation. if it fails, it all fails. no event will be uploaded. similarly, if it succeed, it all succeed. you should see all you events in debugger. also, if a batch filed, the SDK will not remove the batch, instead will re-try it in next flush until it succeed.
what happens to this issue is likely a file is not completely deleted after a successful upload, and the next flush cycle comes, trying to upload an already uploaded file. there currently are no workaround to this, but you can always turn off segment log to avoid pollution.
we are adding a feature to allow developer customizing their storage implementation. this issue should be addressed by then.
@wenxi-zeng thanks for the reply. That's good information to have. I'll let you know if I do see any failures to upload, but for now this doesn't seem to be causing any, so I'll look at the log settings.