barryvdh / laravel-snappy

Laravel Snappy PDF
MIT License
2.59k stars 289 forks source link

The process has been signaled with signal "11". #527

Closed vaibhavsingh31390 closed 4 months ago

vaibhavsingh31390 commented 4 months ago

I have been successfully using the Snappy library to generate PDFs on my Windows machine. However, when attempting to generate the same PDF on a CentOS-based server, I encountered an error. This issue seems to occur specifically when dealing with large datasets, resulting in PDFs exceeding 3000 pages.

Steps Taken:

Installed CentOS 7 specific version of Snappy. Attempted to utilize Snappy via Composer library directly. Error Encountered: Symfony\Component\Process\Exception\ProcessSignaledException The process has been signaled with signal "11".

do { $this->checkTimeout(); $running = $this->isRunning() && ('\' === \DIRECTORY_SEPARATOR || $this->processPipes->areOpen()); $this->readPipes($running, '\' !== \DIRECTORY_SEPARATOR || !$running); } while ($running); while ($this->isRunning()) { $this->checkTimeout(); usleep(1000); }

    if ($this->processInformation['signaled'] && $this->processInformation['termsig'] !== $this->latestSignal) {
        throw new ProcessSignaledException($this);
    }

Additional Information:

The error occurs consistently when processing large datasets. The PDF generation process works without issue on a Windows environment. This issue impedes the functionality of the application on the CentOS server. I would appreciate any insights or suggestions on how to resolve this issue and successfully generate PDFs on the CentOS server using the Snappy library. image

vaibhavsingh31390 commented 4 months ago
         $body = view('ENG.Reports.Bomrep.BomRepdtlallpdfBody', compact('fdatas', 'unit_detail', 'unit_code', 'unitname', 'pcode', 'userData'))->render();
            $snappy = app('snappypdf'); // Use the 'snappypdf' service
            $header = view('ENG.Reports.Header')->render();
            $pdf = $snappy->loadHTML($body, [], [
                'enable-local-file-access' => true,
                'orientation' => 'portrait',
                'encoding' => 'UTF-8',
                'dpi' => 72,
            ]);
            $pdf->setTimeout(100000000);
            $pdf->setOption('margin-top', 12);
            $pdf->setOption('header-html', $header);
            $pdf->setOption('header-spacing', 2);
            return $pdf->download('BOMdetail.pdf');

The code I am using to create the PDF, this works until 800 pages after that it gives the same error but only on centOS server environment.

vaibhavsingh31390 commented 4 months ago

The issue was my global header and the JS

`

`