PlatformException(error, Promise was rejected with a value of 'undefined'.,null, null)

try changing PDF_GENERATOR=hosted_ninja

2 Likes

@david thank you!
ā€œPDF_GENERATOR=hosted_ninjaā€ worked.

1 Like

PDF Generator is BROKEN again. I have not changed anything, it was working 30 minutes ago, not anymore.

500: Internal Server Error

<head>
    <!-- Error:  -->

                <script>
            function gtag() {
            }
        </script>
    
    <!-- Title -->
                <title>Server Error ā€” Anri Studio</title>
    
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content=""/>

    <!-- CSRF Token -->
    <meta name="csrf-token" content="V0F7pg9l0nagmojjQAATpz2MXENNiKyS6JNI7AAN">

    <!-- Scripts -->
    <script src="https://billing2.mydomain.com/js/app.js?id=696e8203d5e8e7cf5ff5" defer></script>
    <script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.7.x/dist/alpine.min.js" defer></script>

    <!-- Fonts -->
    <link rel="dns-prefetch" href="https://fonts.gstatic.com">
    <link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet" type="text/css">

    <!-- Styles -->
    <link href="https://billing2.mydomain.com/css/app.css?id=46021f35ee55aca9ff20" rel="stylesheet">
    

    <link rel="canonical" href="https://billing2.mydomain.com/client/invoice/MKSuHCvagMq5BU4NgPNczoQ6sQSBBVsVlV5CfABCBpLPSvh9Em0BCVs0EP7jnN32/download_pdf"/>

    
    
    <style >[wire\:loading], [wire\:loading\.delay], [wire\:loading\.inline-block], [wire\:loading\.inline], [wire\:loading\.block], [wire\:loading\.flex], [wire\:loading\.table], [wire\:loading\.grid] {display: none;}[wire\:offline] {display: none;}[wire\:dirty]:not(textarea):not(input):not(select) {display: none;}input:-webkit-autofill, select:-webkit-autofill, textarea:-webkit-autofill {animation-duration: 50000s;animation-name: livewireautofill;}@keyframes livewireautofill { from {} }</style>

    <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.css" />
</head>

<style>
:root {
    --primary-color: #ff0f00;
}

.bg-primary {
    background-color: var(--primary-color);
}

.bg-primary-darken {
    background-color: var(--primary-color);
    filter: brightness(90%);
}

.text-primary {
    color: var(--primary-color);
}
<body class="antialiased ">
    
        <div class="grid lg:grid-cols-3">
    <div class="hidden lg:block col-span-1 bg-red-100 h-screen">
        <img src="https://billing2.mydomain.com/images/client-portal-new-image.jpg"
             class="w-full h-screen object-cover"
             alt="Background image">
    </div>

    <div class="col-span-2 h-screen flex">
        <div class="m-auto md:w-1/2 lg:w-1/4 flex flex-col items-center">
            <span class="flex items-center text-2xl">
                500 ā€” Server Error                </span>

            <a class="button-link text-sm mt-2" href="https://billing2.mydomain.com/client">
                Back to billing2.mydomain.com
            </a>
        </div>
    </div>
</div>

    <script {$nonce}>console.warn("Livewire: The published Livewire assets are out of date\n See: https://laravel-livewire.com/docs/installation/")</script><script src="https://billing2.mydomain.com/vendor/livewire/livewire.js?id=b09cb328e689f1bb8d77" data-turbo-eval="false" data-turbolinks-eval="false"></script><script data-turbo-eval="false" data-turbolinks-eval="false">window.livewire = new Livewire();window.Livewire = window.livewire;window.livewire_app_url = 'https://billing2.mydomain.com';window.livewire_token = 'V0F7pg9l0nagmojjQAATpz2MXENNiKyS6JNI7AAN';window.deferLoadingAlpine = function (callback) {window.addEventListener('livewire:load', function () {callback();});};let started = false;window.addEventListener('alpine:initializing', function () {if (! started) {window.livewire.start();started = true;}});document.addEventListener("DOMContentLoaded", function () {if (! started) {window.livewire.start();started = true;}});</script>

    <script src="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js" data-cfasync="false"></script>
    <script>
        window.addEventListener("load", function(){
            if (! window.cookieconsent) {
                return;
            }
            window.cookieconsent.initialise({
                "palette": {
                    "popup": {
                        "background": "#000"
                    },
                    "button": {
                        "background": "#f1d600"
                    },
                },
                "content": {
                    "href": "https://www.invoiceninja.com/privacy-policy/",
                    "message": "This website uses cookies to ensure you get the best experience on our website.",
                    "dismiss": "Got it!",
                    "link": "Learn more",
                }
            })}
        );
    </script>
</body>

<footer>
                </footer>
1 Like

FYI
PDF Generator is WORKING again. So the issue is not related to my own server or applications setup. ā€œHosted_ninjaā€ services were not working at the time I was trying to create INVOICE.

Hi, Iā€™m having the same problem right now, pdf generation for new/draft invoices was working correclty a few minutes ago, and now I have PlateformException(error, Promise was rejected with a value of ā€™undefinedā€™ ., null, null). Canā€™t have the preview loaded either if I go to modifiy custom invoice model.

No message of the system logs.

My default is set to PDF_GENERATOR=phantom

Iā€™m trying to troubleshoot this, where do I put the command ā€œphp artisan optimizeā€ ?

You should be able to update the config cache by loading /update?secret= in your browser.

You can confirm the changes using the health check option by clicking about in the lower left corner of the app.

so the error appears. I donā€™t know what I should do to make it work again

500:

There was an error generating the PDF with Phantom JS

NINJA_ENVIRONMENT=selfhost

PHANTOMJS_PDF_GENERATION=true
PHANTOMJS_KEY=
PHANTOMJS_SECRET=secret

UPDATE_SECRET=secret

I will greatly appreciate your help.

Are there any details about the 500 in storage/logs/

Same errors on self hosted ubuntu server, fresh install.
Not using https though - could be that the problem?

I ran into the very same issue, shortly after update to the newest version. It all worked, I created a dozen of quotes for testing and all of a sudden Error 500 hit me. The last entry in laravel.log:

[2022-02-02 01:13:41] production.INFO: https://invoice.mydomain.org/public/phantom/quote/VQRluHCasdsadRGgRDkzmDm34UK4ubZkiM?phantomjs_secret=secret  
[2022-02-02 01:13:46] production.ERROR: There was an error generating the PDF with Phantom JS {"exception":"[object] (App\\Exceptions\\PhantomPDFFailure(code: 0): There was an error generating the PDF with Phantom JS at /home/mydomainh/invoice.mydomain.org/app/Utils/PhantomJS/Phantom.php:150)
[stacktrace]
#0 /home/mydomainh/invoice.mydomain.org/app/Utils/PhantomJS/Phantom.php(100): App\\Utils\\PhantomJS\\Phantom->checkMime('{\"name\":\"TypeEr...', Object(App\\Models\\QuoteInvitation), 'quote')
#1 /home/mydomainh/invoice.mydomain.org/app/Jobs/Entity/CreateEntityPdf.php(119): App\\Utils\\PhantomJS\\Phantom->generate(Object(App\\Models\\QuoteInvitation))
#2 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\\Jobs\\Entity\\CreateEntityPdf->handle()
#3 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#4 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure))
#5 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))
#6 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Container/Container.php(653): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)
#7 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): Illuminate\\Container\\Container->call(Array)
#8 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}(Object(App\\Jobs\\Entity\\CreateEntityPdf))
#9 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(App\\Jobs\\Entity\\CreateEntityPdf))
#10 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#11 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Foundation/Bus/Dispatchable.php(69): Illuminate\\Bus\\Dispatcher->dispatchNow(Object(App\\Jobs\\Entity\\CreateEntityPdf))
#12 /home/mydomainh/invoice.mydomain.org/app/Services/Quote/GetQuotePdf.php(45): App\\Jobs\\Entity\\CreateEntityPdf::dispatchNow(Object(App\\Models\\QuoteInvitation))
#13 /home/mydomainh/invoice.mydomain.org/app/Services/Quote/QuoteService.php(66): App\\Services\\Quote\\GetQuotePdf->run()
#14 /home/mydomainh/invoice.mydomain.org/app/Http/Controllers/QuoteController.php(743): App\\Services\\Quote\\QuoteService->getQuotePdf(Object(App\\Models\\ClientContact))
#15 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\QuoteController->downloadPdf('VQRluHCKhRi0cXR...')
#16 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction('downloadPdf', Array)
#17 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Routing/Route.php(262): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(App\\Http\\Controllers\\QuoteController), 'downloadPdf')
#18 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
#19 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Routing/Router.php(721): Illuminate\\Routing\\Route->run()
#20 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#21 /home/mydomainh/invoice.mydomain.org/app/Http/Middleware/QueryLogging.php(40): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#22 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\QueryLogging->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#23 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#24 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#25 /home/mydomainh/invoice.mydomain.org/app/Http/Middleware/SetInviteDb.php(81): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#26 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\SetInviteDb->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#27 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#28 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#29 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#30 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#31 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#32 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest(Object(Illuminate\\Http\\Request), Object(Illuminate\\Session\\Store), Object(Closure))
#33 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#34 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#35 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#36 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#37 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#38 /home/mydomainh/invoice.mydomain.org/app/Http/Middleware/SessionDomains.php(32): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#39 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\SessionDomains->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#40 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#41 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Routing/Router.php(723): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#42 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Routing/Router.php(698): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))
#43 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Routing/Router.php(662): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))
#44 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Routing/Router.php(651): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))
#45 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))
#46 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))
#47 /home/mydomainh/invoice.mydomain.org/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestIpMiddleware.php(45): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#48 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Sentry\\Laravel\\Http\\SetRequestIpMiddleware->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#49 /home/mydomainh/invoice.mydomain.org/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestMiddleware.php(42): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#50 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Sentry\\Laravel\\Http\\SetRequestMiddleware->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#51 /home/mydomainh/invoice.mydomain.org/vendor/livewire/livewire/src/DisableBrowserCache.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#52 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Livewire\\DisableBrowserCache->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#53 /home/mydomainh/invoice.mydomain.org/app/Http/Middleware/Cors.php(25): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#54 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\Cors->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#55 /home/mydomainh/invoice.mydomain.org/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#56 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\\Proxy\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#57 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#58 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#59 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#60 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#61 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#62 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#63 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#64 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#65 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#66 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#67 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#68 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#69 /home/mydomainh/invoice.mydomain.org/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#70 /home/mydomainh/invoice.mydomain.org/public/index.php(57): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#71 {main}
"}

@Jazz

Have you created a API key for PhantomJS?

Yes I have. Hereā€™s a list of some important parts from my .env (hiding the API key for obvious reasons):

DEMO_MODE=false
REQUIRE_HTTPS=true
NINJA_ENVIRONMENT=selfhost
PHANTOMJS_PDF_GENERATION=true
PHANTOMJS_KEY='xx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx'
PHANTOMJS_SECRET=secret

@Jazz

The only other thing I can think of would be file permissions?

Would a file permission issue work as I described: ā€œit worked flawlessly, than it stopped without any change on the server sideā€? E.g. today it works again, but there is a certain scenario when it just stops working. Is there an hourly limit, or could be too quickly navigating through the web app while it still generates the previous PDF, Iā€™m not quite sure - but itā€™s quite a big issue for users.

@Jazz

one thing to check. if you log into PhantomJS cloud, they should have metrics on how many PDFs you are generating with your APIKeyā€¦ If it is zero (which i think it may be) then the system is most likely still trying to use the original APIkey.

Youā€™ll want to flush the cache by either deleting the contents of bootstrap/cache or run the /update?secret=secret from your browser.

1 Like

I re-created the new API key (just in case), updated the .env file, ran php artisan optimize and then noticed the error message Your Composer dependencies require a PHP version ">= 7.4.0". You are running 7.3.33.. I updated my PHP to the most recent version, cleared the bootstrap/cache and hopefully that will resolve the issue. Thank you.

UPDATE: If youā€™ve tried this and still have issues, go into Settings > Company Details > Logo and delete your logo or reupload it. This also solved the issue for me when it returned again after an update.

1 Like

Well Iā€™m here continuing this discussion as I still encounter this issue.

Every time I update Invoiceninja, PDF generation breaks. Iā€™m using snappdf.

I get " I get PlatformException(error, Promise was rejected with a value of ā€˜undefinedā€™.,null, null) as usual.

The solution provided by SalesNinja works to resolve this each time, which is to force an update of the latest snappdf and set the permissions accordingly.

Iā€™m not sure why this is required every time I update Invoiceninja but perhaps updating of snappdf needs to be part of the update process?

Otherwise perhaps some explanation would be potentially provided as to why this keeps happening.

The last error in laravel before I updated snappdf and it worked again was:

production.ERROR: The process has been signaled with signal ā€œ11ā€. {ā€œuserIdā€:1,ā€œexceptionā€:"[object] (Symfony\Component\Process\Exception\ProcessSignaledException(code: 0): The process has been signaled with signal ā€œ11ā€. at /home/techbuddy.net.au/domains/billing.techbuddy.net.au/public_html/vendor/symfony/process/Process.php:441)
[stacktrace]

Any ideas why I always have to do this?

@david do you have any thoughts?

@kylegp

Are you using the internal update mechanism, or something else?

We bundle snappdf and the binary in the prebuilt invoiceninja.zip file, so there should be no reason to re-download it.

@ben can you think of a reason why a user may need to force the download again?