RempadDesign
RempadDesign

Hi, We have updated 2 of our clients websites from 464 to 465 and we get this error every time we try to send an email via the form that since now worked just great:

ErrorException: mkdir(): No such file or directory in /home/website-name/public_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php:247

0[internal function]:Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'mkdir(): No suc...', '/home/website-name/p...', 247, Array)

1/home/website-name/public_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php(247): mkdir('/tmp/fa0a958b88...')

The error thrown in the form is mkdir(): No such file or directory. We also have tested another website that is stil on 464 with same form developed by us and everything works just great. How can we solve this issue? Please guide us on it.

Thank you in advance. PS: we didn't changed any folder permisions or something like this on the server side by ourselves.

Last updated

RempadDesign
RempadDesign

Solved like this for the moment: In the Constructor Swiftmailer/lib/classes/swift/KeyCache/DiskKeyCache.php I had to replace:

$this->path = $path;

with:

$this->path = dirname(DIR, 7) . '/storage/temp'; to make sending campaigns via the scheduler work. So this code in fact points to the directory [OctoberInstallationDir]/storage/temp.

The many dirname calls are needed because $_SERVER['DOCUMENT_ROOT'] is not available when running PHP via a cronjob.

AND ALSO

by modifying vendor/swiftmailer/swiftmailer/lib/preferences.php:

I've commented out this block of code: if (@is_writable($tmpDir = sys_get_temp_dir())) { $preferences->setTempDir($tmpDir)->setCacheType('disk'); }

and I've replaced it by this:

$preferences->setTempDir($_SERVER['DOCUMENT_ROOT'] . '/[OctoberInstallationDir]/storage/temp')->setCacheType('disk');

All this is because servers don't allow to write on /tmp folder from the route and that is a good security point. Please fix this in the future realeases and point directly to the cache of October like storage/cache

Cheers!

Last updated

BennoThommo
BennoThommo

@RempadDesign this is a complex case and there's not enough information here to determine if there's a fault with October - your fixes seem to be made directly with the Swiftmailer library which is outside our control. While I can understand that it seems to have broken in between an upgrade, without context (such as what it is you are attempting to do with the cron job), we have nowhere to begin an investigation.

RempadDesign
RempadDesign

BennoThommo said:

@RempadDesign this is a complex case and there's not enough information here to determine if there's a fault with October - your fixes seem to be made directly with the Swiftmailer library which is outside our control. While I can understand that it seems to have broken in between an upgrade, without context (such as what it is you are attempting to do with the cron job), we have nowhere to begin an investigation.

Hi, the problem is indeed complex. Eaven if this is not linked to a cron job that will send email notifications, after the upgrade the sending email process get stuck with the mentioned error (the project here is not working as well in terms of sending emails: http://cnpcd.ro/contact via contact form). What should I give you from the error log so you can investigate the link betwen email sending via Sendmail , Swiftmailer and the upgrade from 464 to 465?

Waiting for you reply. Thank you in advance.

1-4 of 4