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

Error purging old files #455

Open
JimBacon opened this issue Sep 8, 2022 · 0 comments
Open

Error purging old files #455

JimBacon opened this issue Sep 8, 2022 · 0 comments
Assignees
Labels

Comments

@JimBacon
Copy link
Member

JimBacon commented Sep 8, 2022

While debugging a fault (which turned out to be due to some malformed data) I saw the error message

2022-09-08 11:35:21 +01:00 --- error: 
  Uncaught ErrorException: 
    unlink(D:\websites\warehouse\download/\download-6319b73b225071.19838332.json): 
      No such file or directory in file D:/websites/warehouse/application/helpers/warehouse.php on line 156

The cause of the unlink error in this case is the /\ file separator.
The purgeOldFiles() function where the error is happening specifies that it should be called with a 'folder path relative to the DOCROOT, without leading or trailing slash.'
However it had been called with a $path having a trailing '/'
This happens in a few places and needs fixing.

Note, the code at that point is supposed to supress errors caused by problems unlinking files. Indeed, I think it was succeeding, but when I hit a subsequent error, this supressed error was being logged. I.e. the error I was having a problem with had nothing to do with the message I was seeing which was confusing.

@JimBacon JimBacon added the bug label Sep 8, 2022
@JimBacon JimBacon self-assigned this Sep 8, 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

1 participant