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

The file "" couldn’t be opened because there is no such file #180

Closed
john1452 opened this issue Apr 8, 2018 · 6 comments
Closed

The file "" couldn’t be opened because there is no such file #180

john1452 opened this issue Apr 8, 2018 · 6 comments

Comments

@john1452
Copy link

john1452 commented Apr 8, 2018

Hi I am getting some strange errors. It seems the cache is clearing it self after some time..

The error i receive is the following.

The file “48D236928EDB4A0D5601D267C5182EEB” couldn’t be opened because there is no such file
The cache it self clearer knows the file it wants to access but for some reason the file is deleted.
Any ideas when this can occur? Here is the initialization of my storage.

func loadStorage(){

    do {
        let diskConfig = DiskConfig(name: storageDiskConfig,expiry: .never,protectionType: .complete)
        self.storage = try Storage(diskConfig: diskConfig)

    } catch {
        self.logger.information(source, "Init", "Failed to initialise storage instance error: \(error.localizedDescription). ")
    }
}
@onmyway133
Copy link
Contributor

@john1452 Hi, do you specify expiry? That could cause objects to be cleared after some time

@Erumaru
Copy link

Erumaru commented Jul 14, 2018

@onmyway133 I don't specify expiry, but often my cached user account becomes nil and it leads to logout him from account. Is it known issue? May be I'm doing something wrong? I've heard that creating new variables in model, which is cached leads it to become nil, if I don't process it properly. Can you please give me some links related to that one, please.

@tguidon
Copy link

tguidon commented Dec 13, 2018

I'm seeing this issue quite a bit now. My storage is being set as a global variable (maybe a problem here?) and with an expirary of 8 hours. After 2-4 hours of the app in the background, the user comes back to the app and sees that same long string filename can not be opened error.

Is there a best practice for defining storage?

Also, I am using Cache in a private Pod as an SDKs caching layer if that helps.

@Erumaru
Copy link

Erumaru commented Mar 19, 2019

Hi @tguidon @john1452 did you find out what was the problem? I still can't solve it and using workarounds :(

@tguidon
Copy link

tguidon commented Mar 19, 2019

@Erumaru I was never able to find out what the issue was. My workaround was to make two storage containers. One for arrays of data and one for objects.

What workaround are you using?

@Erumaru
Copy link

Erumaru commented Mar 20, 2019

@tguidon thank you for response, my cached user sometimes become nil and I have to update it from backend when this happens at app start. I store token in Keychain.

@3lvis 3lvis closed this as completed Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants