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
log actual mkdir() failure reason #554
Comments
mkdir()
failure reason
The error is actually quite helpful. It's telling you that PFC can't write on the disk. There's multiple potentials causes:
I'm not sure that Cheers, |
The stack overflow answer has quite a few upvotes... Don't you think
`error_get_last()` can contain the exact cause ?
Le 10 déc. 2017 12:03, "Georges.L" <notifications@github.com> a écrit :
The error is actually quite helpful. It's telling you that PFC can't write
on the disk. There's multiple potentials causes:
- No left space on disk
- Not owner of the target directory
- Incorrect chmod
I'm not sure that error_get_last() will return more pertinent information.
Cheers,
Georges
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#554 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABkILaduZY1UKnSn2mXSzfRgnnSFrqqEks5s-7p4gaJpZM4Q8VHK>
.
|
If there's an I/O issue, just check the php logs. That's simple, right ? |
I agree that the current error message covers 95% of the cases but adding
the last error could help the remaining 5% (me included :-) ).
Le 10 déc. 2017 12:10, "Olivier Adam" <olivier.adam@m4x.org> a écrit :
… The stack overflow answer has quite a few upvotes... Don't you think
`error_get_last()` can contain the exact cause ?
Le 10 déc. 2017 12:03, "Georges.L" ***@***.***> a écrit :
The error is actually quite helpful. It's telling you that PFC can't write
on the disk. There's multiple potentials causes:
- No left space on disk
- Not owner of the target directory
- Incorrect chmod
I'm not sure that error_get_last() will return more pertinent information.
Cheers,
Georges
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#554 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABkILaduZY1UKnSn2mXSzfRgnnSFrqqEks5s-7p4gaJpZM4Q8VHK>
.
|
I think the io error is suppressed by the use of `@` and won't be present
in the logs.
Le 10 déc. 2017 12:20, "Georges.L" <notifications@github.com> a écrit :
… If there's an I/O issue, just check the php logs. That's simple, right ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#554 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABkILUCNTUaXqsInYTxjwYkN3FJlzvA1ks5s-76ZgaJpZM4Q8VHK>
.
|
The "@" should not be used at all in php, it's a very bad practice. Hiding the error does not solve them :) |
The current code uses `@mkir` :
https://github.com/PHPSocialNetwork/phpfastcache/blob/67960f2864dbf8c7abc00140bc36a392781ef680/src/phpFastCache/Core/Pool/IO/IOHelperTrait.php
As you said this is not ideal but adding a get_last_error, as suggested by
my stackoverflow link, would make it acceptable.
Le 10 déc. 2017 13:50, "Georges.L" <notifications@github.com> a écrit :
… The "@" should not be used at all in php, it's a very bad practice. Hiding
the error does not solve them :)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#554 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABkILfeKlpbzUXGpdJaltW3tx7QDlRXcks5s-9N2gaJpZM4Q8VHK>
.
|
I can indeed work on |
If it's available, an additional information message will be appended to the Exception message. |
Configuration:
PhpFastCache version:
6.0.7
PHP version:
7.0.22-0ubuntu0.16.04.1
Operating system:
ubuntu
Issue description:
I'm using the files driver in production. Most of the time everything is working fine, but sometimes
mkdir
fails for an unknown reason (I'm almost sure it's not a permission issue), and phpFastCache logs an unhelpfulPLEASE CHMOD /mytmpdir - 511 OR ANY WRITABLE PERMISSION!
Would it be possible to update the file driver so that it returns the actual root cause ? A code similar to this (from https://stackoverflow.com/a/929490/436792) could be used :
The text was updated successfully, but these errors were encountered: