Created on 19 September 2024, 2 months ago

Problem/Motivation

Trying this solution out, got most everything to work. When I go to an application in results, and click the operator button "bundle" I get a 404 error and what look like some PHP warning error about the directory already exists, sure enough it has already been created (upon application submission):

Warning: mkdir(): File exists in Drupal\Core\File\FileSystem->mkdirCall() (line 249 of D:\wwwroot\pss_2024\web\core\lib\Drupal\Core\File\FileSystem.php)
#0 D:\wwwroot\pss_2024\web\core\includes\bootstrap.inc(164): _drupal_error_handler_real(2, 'mkdir(): File e...', 'D:\\wwwroot\\pss_...', 249)
#1 [internal function]: _drupal_error_handler(2, 'mkdir(): File e...', 'D:\\wwwroot\\pss_...', 249)
#2 D:\wwwroot\pss_2024\web\core\lib\Drupal\Core\File\FileSystem.php(249): mkdir('D:\\wwwroot\\pss_...', 509, false)
#3 D:\wwwroot\pss_2024\web\core\lib\Drupal\Core\File\FileSystem.php(235): Drupal\Core\File\FileSystem->mkdirCall('D:\\wwwroot\\pss_...', 509, false, NULL)
#4 D:\wwwroot\pss_2024\web\core\lib\Drupal\Core\StreamWrapper\LocalStream.php(346): Drupal\Core\File\FileSystem->mkdir('D:\\wwwroot\\pss_...', 509, true)
#5 [internal function]: Drupal\Core\StreamWrapper\LocalStream->mkdir('private://acade...', 509, 9)
#6 D:\wwwroot\pss_2024\web\core\lib\Drupal\Core\File\FileSystem.php(249): mkdir('private://acade...', 509, true)
#7 D:\wwwroot\pss_2024\web\core\lib\Drupal\Core\File\FileSystem.php(188): Drupal\Core\File\FileSystem->mkdirCall('private://acade...', 509, true, NULL)
#8 D:\wwwroot\pss_2024\web\modules\contrib\academic_applications\src\SubmissionBundler.php(96): Drupal\Core\File\FileSystem->mkdir('private://acade...', 509, true)
#9 D:\wwwroot\pss_2024\web\modules\contrib\academic_applications\src\Controller\BundleController.php(53): Drupal\academic_applications\SubmissionBundler->bundle(Object(Drupal\webform\Entity\WebformSubmission))
#10 [internal function]: Drupal\academic_applications\Controller\BundleController->bundleAction(Object(Drupal\webform\Entity\WebformSubmission))
#11 D:\wwwroot\pss_2024\web\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#12 D:\wwwroot\pss_2024\web\core\lib\Drupal\Core\Render\Renderer.php(627): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#13 D:\wwwroot\pss_2024\web\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#14 D:\wwwroot\pss_2024\web\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#15 D:\wwwroot\pss_2024\vendor\symfony\http-kernel\HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#16 D:\wwwroot\pss_2024\vendor\symfony\http-kernel\HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#17 D:\wwwroot\pss_2024\web\core\lib\Drupal\Core\StackMiddleware\Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 D:\wwwroot\pss_2024\web\core\lib\Drupal\Core\StackMiddleware\KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 D:\wwwroot\pss_2024\web\core\lib\Drupal\Core\StackMiddleware\ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 D:\wwwroot\pss_2024\web\core\modules\big_pipe\src\StackMiddleware\ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 D:\wwwroot\pss_2024\web\core\modules\page_cache\src\StackMiddleware\PageCache.php(106): Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 D:\wwwroot\pss_2024\web\core\modules\page_cache\src\StackMiddleware\PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 D:\wwwroot\pss_2024\web\core\modules\ban\src\BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 D:\wwwroot\pss_2024\web\core\lib\Drupal\Core\StackMiddleware\ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 D:\wwwroot\pss_2024\web\core\lib\Drupal\Core\StackMiddleware\NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 D:\wwwroot\pss_2024\web\core\lib\Drupal\Core\StackMiddleware\AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 D:\wwwroot\pss_2024\web\core\lib\Drupal\Core\StackMiddleware\StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 D:\wwwroot\pss_2024\web\core\lib\Drupal\Core\DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#29 D:\wwwroot\pss_2024\web\index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#30 {main}

Steps to reproduce

Install the latest, install GhostScript, configure all accordingly via readme.
PHP 8.1.29
Drupal 10.2

Use the application Example - submit an application.

Proposed resolution

May want to do a check if the directory does exists 1st :
https://stackoverflow.com/questions/99132/how-to-prevent-directory-alrea...

mkdir -p (note this does not work on a Windoze server)

My thinking is that the final bundled .PDF never gets created as it is tripped up by the directory existing already error, and quits?

Remaining tasks

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States goose2000

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

Comments & Activities

  • Issue created by @goose2000
  • πŸ‡ΊπŸ‡ΈUnited States goose2000

    Well, did a little test to see PHP run the command line version of GS on my server :

    <html>
    <head>
    <title>Test GS</title>
    </head>
    <body>
    <?php
    
    //$ver = shell_exec("gswin64c.exe --version");
    $ver = exec("gswin64c.exe" . " --version");
    print "$ver";
    print "<br>A";
    
    ?>
    </body>
    </html>

    And this returned fine :
    10.03.1
    A

    So not having a PHP / GS disconnect. I guess this is a permissions issue? I am on a Windows 2019 server.
    Thanks for ideas.

  • πŸ‡ΊπŸ‡ΈUnited States goose2000

    Any ideas? I can see my that my private file system is working with my web server IUSR fine, so doesn't appear to be a permissions issue.

Production build 0.71.5 2024