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

[Segment ERROR - finish(file:):320] Unable to rename to temp warning/error #162

Closed
malhotrachetan opened this issue Oct 14, 2022 · 15 comments
Assignees
Labels

Comments

@malhotrachetan
Copy link

Describe the bug
A clear and concise description of what the bug is.

Coming across a very weird debug message lately since the last update. The message appears around 20 secs post starting the app. The message says:

[Segment ERROR - finish(file:):320] Unable to rename to temp: file:///Users/chetanmalhotra/Library/Developer/CoreSimulator/Devices/094C9BEE-0AB5-4345-AB1D-2CA907B66033/data/Containers/Data/Application/1688B1EE-1CCC-44B7-AA72-FB7A9A272B3E/Documents/segment/XVFH4DGT0ufXKfxlMQzNMQDosdD9eKLW/7-segment-events, Error: Error Domain=NSCocoaErrorDomain Code=4 "“7-segment-events” couldn’t be moved to “XVFH4DGT0ufXKfxlMQzNMQDosdD9eKLW” because either the former doesn’t exist, or the folder containing the latter doesn’t exist." UserInfo={NSSourceFilePathErrorKey=/Users/chetanmalhotra/Library/Developer/CoreSimulator/Devices/094C9BEE-0AB5-4345-AB1D-2CA907B66033/data/Containers/Data/Application/1688B1EE-1CCC-44B7-AA72-FB7A9A272B3E/Documents/segment/XVFH4DGT0ufXKfxlMQzNMQDosdD9eKLW/7-segment-events, NSUserStringVariant=( Move ), NSDestinationFilePath=/Users/chetanmalhotra/Library/Developer/CoreSimulator/Devices/094C9BEE-0AB5-4345-AB1D-2CA907B66033/data/Containers/Data/Application/1688B1EE-1CCC-44B7-AA72-FB7A9A272B3E/Documents/segment/XVFH4DGT0ufXKfxlMQzNMQDosdD9eKLW/7-segment-events.temp, NSFilePath=/Users/chetanmalhotra/Library/Developer/CoreSimulator/Devices/094C9BEE-0AB5-4345-AB1D-2CA907B66033/data/Containers/Data/Application/1688B1EE-1CCC-44B7-AA72-FB7A9A272B3E/Documents/segment/XVFH4DGT0ufXKfxlMQzNMQDosdD9eKLW/7-segment-events, NSUnderlyingError=0x600001e34e40 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

To Reproduce
Steps to reproduce the behavior:

  1. Just run any project that uses identify() and track()
  2. Wait for ~20 secs
  3. See error

Expected behavior
There should be no warnings/werrors

Screenshots
If applicable, add screenshots to help explain your problem.
Screenshot 2022-10-15 at 2 54 57 AM

Platform (please complete the following information):

  • Library Version in use: 1.3.1
  • Platform being tested: Ios 15
  • Integrations in use: Firebase and Amplitude

Additional context
Kinda urgent. Pls help saviours

@malhotrachetan
Copy link
Author

Updated to 1.3.2, still happening.

@bsneed
Copy link
Contributor

bsneed commented Oct 15, 2022

looking ...

@bsneed
Copy link
Contributor

bsneed commented Oct 15, 2022

I'm unable to reproduce this. I'm using the example app located in analytics-swift/examples/apps/BasicExample.xcworkspace. From the looks of it, it seems to be failing to create the directory for the given writekey. Line 196 in Storage.swift. Can you see what the results of that are on your end?

@bsneed
Copy link
Contributor

bsneed commented Oct 16, 2022

You might try the branch above and see if that helps any.

@malhotrachetan
Copy link
Author

Hey! Just tried out with the above mentioned branch. Now i am getting:
Screenshot 2022-10-16 at 11 46 56 PM

@bsneed
Copy link
Contributor

bsneed commented Oct 16, 2022

Can you verify if those files or folders exist and those error messages are legit?

@malhotrachetan
Copy link
Author

malhotrachetan commented Oct 16, 2022

Yes the directory with writeKey name does infact exist, thus the file name "14-segment-events" or is missing.

@bsneed
Copy link
Contributor

bsneed commented Oct 16, 2022

I didn't quite understand that last part.

You should have a 14-segment-events or a 14-segment-events.temp.

@malhotrachetan
Copy link
Author

I meant there is a directory created with the writeKey name but neither 14-segment-events nor 14-segment-events.temp is created.

@bsneed
Copy link
Contributor

bsneed commented Oct 17, 2022

Are you able to create and write to files manually in that directory?

@malhotrachetan
Copy link
Author

Good point. Let me check this.

@malhotrachetan
Copy link
Author

hey! As you feared, no I cannot create manually too. Got this:

mkdir: /20-segment-events: Read-only file system

@bsneed
Copy link
Contributor

bsneed commented Oct 18, 2022

Ok, gotcha. So it's all explained now. I'm not sure why you have a read-only file system. Do you know?

@malhotrachetan
Copy link
Author

Idk. Apple ships it like this maybe? Anyway, so I got around making the root volume writable. Now i can make a directory/file manually in the writeKey named folder but I still get the message.

@bsneed
Copy link
Contributor

bsneed commented Oct 25, 2022

Apple doesn't ship a readonly file system (not intentionally anyway). Closing this as I've merged the PR and it should be good. Please let me know if you see issues. I need lots of details about what you're seeing etc to further assist.

@bsneed bsneed closed this as completed Oct 25, 2022
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