Notice: tempnam(): file created in the system's temporary directory in Drupal\feeds\File\FeedsFileSystemBase->tempnam()

Created on 27 November 2024, 5 months ago

Problem/Motivation

Notice: tempnam(): file created in the system's temporary directory in Drupal\feeds\File\FeedsFileSystemBase->tempnam()

Callstack:

Notice: tempnam(): file created in the system's temporary directory in Drupal\feeds\File\FeedsFileSystemBase->tempnam() (line 76 of modules/contrib/feeds/src/File/FeedsFileSystemBase.php) #0 core/includes/bootstrap.inc(166): _drupal_error_handler_real()
#1 [internal function]: _drupal_error_handler()
#2 modules/contrib/feeds/src/File/FeedsFileSystemBase.php(76): tempnam()
#3 modules/contrib/feeds/src/Feeds/Fetcher/HttpFetcher.php(112): Drupal\feeds\File\FeedsFileSystemBase->tempnam()
#4 modules/contrib/feeds/src/EventSubscriber/LazySubscriber.php(91): Drupal\feeds\Feeds\Fetcher\HttpFetcher->fetch()
#5 [internal function]: Drupal\feeds\EventSubscriber\LazySubscriber->Drupal\feeds\EventSubscriber\{closure}()
#6 core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()
#7 modules/contrib/feeds/src/Event/EventDispatcherTrait.php(41): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#8 modules/contrib/feeds/src/FeedsExecutable.php(224): Drupal\feeds\FeedsExecutable->dispatchEvent()
#9 modules/contrib/feeds/src/FeedsExecutable.php(103): Drupal\feeds\FeedsExecutable->doFetch()
#10 modules/contrib/feeds/src/Plugin/QueueWorker/FeedRefresh.php(42): Drupal\feeds\FeedsExecutable->processItem()
#11 core/lib/Drupal/Core/Cron.php(270): Drupal\feeds\Plugin\QueueWorker\FeedRefresh->processItem()
#12 core/lib/Drupal/Core/Cron.php(235): Drupal\Core\Cron->processQueue()
#13 modules/contrib/ultimate_cron/src/UltimateCron.php(70): Drupal\Core\Cron->processQueues()
#14 modules/contrib/ultimate_cron/src/ProxyClass/UltimateCron.php(70): Drupal\ultimate_cron\UltimateCron->run()
#15 core/modules/system/src/CronController.php(38): Drupal\ultimate_cron\ProxyClass\UltimateCron->run()
#16 [internal function]: Drupal\system\CronController->run()
#17 core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#18 core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#19 core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext()
#20 core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#21 vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#22 vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#23 core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
#24 core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#25 core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#26 core/modules/page_cache/src/StackMiddleware/PageCache.php(191): Drupal\Core\StackMiddleware\ContentLength->handle()
#27 core/modules/page_cache/src/StackMiddleware/PageCache.php(128): Drupal\page_cache\StackMiddleware\PageCache->fetch()
#28 core/modules/page_cache/src/StackMiddleware/PageCache.php(82): Drupal\page_cache\StackMiddleware\PageCache->lookup()
#29 core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#30 core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#31 core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#32 core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#33 core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#34 index.php(19): Drupal\Core\DrupalKernel->handle()
#35 {main}.

Steps to reproduce

Trying to track down the steps but it's super hard. The attached patch was trying to track it down but no go.

Proposed resolution

I am thinking it would be better if we avoided using tempnam() because it falls back to /tmp which might not be the appropriate place if for example we are using:
$settings['file_temp_path'] = '/var/tmp';

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇨🇦Canada joelpittet Vancouver

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @joelpittet
  • 🇨🇦Canada joelpittet Vancouver

    More context: this is stored in our private directory which is mounted NFS, outside the webroot and this is only happening on 1 or 2 feeds at the moment. The other feeds seem to be fine.

    And it seems to happen on cron every hour after this error

    Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '9-141838' for key 'feeds_clean_list.PRIMARY': INSERT INTO "feeds_clean_list" ("feed_id", "entity_id") VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1), (:db_insert_placeholder_2, :db_insert_placeholder_3); Array
    (
        [:db_insert_placeholder_0] => 9
        [:db_insert_placeholder_1] => 141838
        [:db_insert_placeholder_2] => 9
        [:db_insert_placeholder_3] => 141914
    )

    The feeds are triggered every minute, though maybe the solution is to stop that...

  • 🇳🇱Netherlands megachriz

    It sounds like this could be related to or a duplicate of Add support for remote file systems for http downloaded data Active .

    The duplicate entry issue (for the feeds_clean_list table) could be a completely different issue, however.

  • 🇨🇦Canada joelpittet Vancouver

    Thanks @megachriz, I was going to post there (I linked it as a parent issue) but I wasn't quite sure if it's related. The feeds_clean_list seems to trigger this issue in my case because it always starts fine. I unlock the feed, it seems to work for a bit, then starts with that error, then later this tempnam() keeps happening.

    I feel like I am missing something in this and started a new issue as to not conflate the issues (yet) until I know for sure.

  • 🇳🇱Netherlands megachriz

    Alright, good idea to have this issue separate for now :)

  • Status changed to Closed: cannot reproduce 2 months ago
  • 🇨🇦Canada joelpittet Vancouver

    This was terribly tricky to reproduce so I will close for now.

Production build 0.71.5 2024