Problem migrating documents from V4 to V5

Hey guys o/ I currently try to migrate from V4 to V5 but I’m facing a problem which is as follows:

Environment:

  • V4 installed in: /var/www/html/ninja-old
  • V5 installed in: /var/www/html/ninja

I started creating a DB backup of my V4 installation and I also backed up the application folder. Afterwards I renamed the old V4 application directory into “ninja-old” (was originally /var/www/html/ninja). I also changed the domain name from invoices.something to invoices-old.something and the database name from ninja to ninja_old. Everything worked well so far so I started installing V5 in the directory /var/www/html/ninja. The database is called ninja and well, thats it. Everythings great so far. I then tried to start the migration and everything looked good (in the frontend) but it never finished. I had a look into the laravel.log but was not able to find something so I triggered the migration again (with the force overwrite option) with having a closer look in the laravel.log and I found the following error:

[2021-02-06 19:06:25] production.INFO: Importing tasks
[2021-02-06 19:06:25] production.INFO: Importing documents
[2021-02-06 19:06:59] production.INFO: Unable to open file for reading [https://<hidden>/storage/whz6j2hmc6aorqaibm88uulunxjwhfso/Pr9fBKsdNZ7k1vjVxyCPzTlE0eFCzoQdCLdhjXCs/invoices/R2020-0012.pdf]
[2021-02-06 19:07:00] production.ERROR: Unable to open file for reading [https://<hidden>/storage/whz6j2hmc6aorqaibm88uulunxjwhfso/Pr9fBKsdNZ7k1vjVxyCPzTlE0eFCzoQdCLdhjXCs/invoices/R2020-0012.pdf] {"userId":1,"exception":"[object] (Swift_IoException(code: 0): Unable to open file for reading [https://<hidden>/storage/whz6j2hmc6aorqaibm88uulunxjwhfso/Pr9fBKsdNZ7k1vjVxyCPzTlE0eFCzoQdCLdhjXCs/invoices/R2020-0012.pdf] at /var/www/html/ninja/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/FileByteStream.php:131)
[stacktrace]
#0 /var/www/html/ninja/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/FileByteStream.php(77): Swift_ByteStream_FileByteStream->getReadHandle()
#1 /var/www/html/ninja/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php(40): Swift_ByteStream_FileByteStream->read(8192)
#2 /var/www/html/ninja/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php(555): Swift_Mime_ContentEncoder_Base64ContentEncoder->encodeByteStream(Object(Swift_ByteStream_FileByteStream), Object(Swift_Transport_StreamBuffer), 0, 76)
#3 /var/www/html/ninja/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php(532): Swift_Mime_SimpleMimeEntity->bodyToByteStream(Object(Swift_Transport_StreamBuffer))
#4 /var/www/html/ninja/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php(570): Swift_Mime_SimpleMimeEntity->toByteStream(Object(Swift_Transport_StreamBuffer))
#5 /var/www/html/ninja/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php(532): Swift_Mime_SimpleMimeEntity->bodyToByteStream(Object(Swift_Transport_StreamBuffer))
#6 /var/www/html/ninja/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php(601): Swift_Mime_SimpleMimeEntity->toByteStream(Object(Swift_Transport_StreamBuffer))
#7 /var/www/html/ninja/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php(162): Swift_Mime_SimpleMessage->toByteStream(Object(Swift_Transport_StreamBuffer))
#8 /var/www/html/ninja/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(401): Swift_Message->toByteStream(Object(Swift_Transport_StreamBuffer))
#9 /var/www/html/ninja/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(503): Swift_Transport_AbstractSmtpTransport->streamMessage(Object(Swift_Message))
#10 /var/www/html/ninja/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(519): Swift_Transport_AbstractSmtpTransport->doMailTransaction(Object(Swift_Message), 'invoices@mg-web...', Array, Array)
#11 /var/www/html/ninja/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(206): Swift_Transport_AbstractSmtpTransport->sendTo(Object(Swift_Message), 'invoices@mg-web...', Array, Array)
#12 /var/www/html/ninja/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php(71): Swift_Transport_AbstractSmtpTransport->send(Object(Swift_Message), Array)
#13 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(521): Swift_Mailer->send(Object(Swift_Message), Array)
#14 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(288): Illuminate\\Mail\\Mailer->sendSwiftMessage(Object(Swift_Message))
#15 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(186): Illuminate\\Mail\\Mailer->send('email.import.co...', Array, Object(Closure))
#16 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Support/Traits/Localizable.php(19): Illuminate\\Mail\\Mailable->Illuminate\\Mail\\{closure}()
#17 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(187): Illuminate\\Mail\\Mailable->withLocale(NULL, Object(Closure))
#18 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(304): Illuminate\\Mail\\Mailable->send(Object(Illuminate\\Mail\\Mailer))
#19 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(258): Illuminate\\Mail\\Mailer->sendMailable(Object(App\\Mail\\MigrationCompleted))
#20 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Mail/PendingMail.php(121): Illuminate\\Mail\\Mailer->send(Object(App\\Mail\\MigrationCompleted))
#21 /var/www/html/ninja/app/Jobs/Util/Import.php(211): Illuminate\\Mail\\PendingMail->send(Object(App\\Mail\\MigrationCompleted))
#22 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\\Jobs\\Util\\Import->handle()
#23 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#24 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure))
#25 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))
#26 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Container/Container.php(610): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)
#27 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): Illuminate\\Container\\Container->call(Array)
#28 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}(Object(App\\Jobs\\Util\\Import))
#29 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(App\\Jobs\\Util\\Import))
#30 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#31 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Foundation/Bus/Dispatchable.php(67): Illuminate\\Bus\\Dispatcher->dispatchNow(Object(App\\Jobs\\Util\\Import))
#32 /var/www/html/ninja/app/Jobs/Util/StartMigration.php(113): App\\Jobs\\Util\\Import::dispatchNow('/var/www/html/n...', Object(App\\Models\\Company), Object(App\\Models\\User))
#33 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\\Jobs\\Util\\StartMigration->handle()
#34 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#35 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure))
#36 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))
#37 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Container/Container.php(610): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)
#38 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): Illuminate\\Container\\Container->call(Array)
#39 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}(Object(App\\Jobs\\Util\\StartMigration))
#40 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(App\\Jobs\\Util\\StartMigration))
#41 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#42 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(118): Illuminate\\Bus\\Dispatcher->dispatchNow(Object(App\\Jobs\\Util\\StartMigration), false)
#43 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Queue\\CallQueuedHandler->Illuminate\\Queue\\{closure}(Object(App\\Jobs\\Util\\StartMigration))
#44 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(App\\Jobs\\Util\\StartMigration))
#45 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(120): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#46 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(70): Illuminate\\Queue\\CallQueuedHandler->dispatchThroughMiddleware(Object(Illuminate\\Queue\\Jobs\\DatabaseJob), Object(App\\Jobs\\Util\\StartMigration))
#47 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(98): Illuminate\\Queue\\CallQueuedHandler->call(Object(Illuminate\\Queue\\Jobs\\DatabaseJob), Array)
#48 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(406): Illuminate\\Queue\\Jobs\\Job->fire()
#49 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(356): Illuminate\\Queue\\Worker->process('database', Object(Illuminate\\Queue\\Jobs\\DatabaseJob), Object(Illuminate\\Queue\\WorkerOptions))
#50 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(158): Illuminate\\Queue\\Worker->runJob(Object(Illuminate\\Queue\\Jobs\\DatabaseJob), 'database', Object(Illuminate\\Queue\\WorkerOptions))
#51 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(116): Illuminate\\Queue\\Worker->daemon('database', 'default', Object(Illuminate\\Queue\\WorkerOptions))
#52 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(100): Illuminate\\Queue\\Console\\WorkCommand->runWorker('database', 'default')
#53 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\Queue\\Console\\WorkCommand->handle()
#54 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#55 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure))
#56 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))
#57 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Container/Container.php(610): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)
#58 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Console/Command.php(136): Illuminate\\Container\\Container->call(Array)
#59 /var/www/html/ninja/vendor/symfony/console/Command/Command.php(256): Illuminate\\Console\\Command->execute(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle))
#60 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\\Component\\Console\\Command\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle))
#61 /var/www/html/ninja/vendor/symfony/console/Application.php(971): Illuminate\\Console\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#62 /var/www/html/ninja/vendor/symfony/console/Application.php(290): Symfony\\Component\\Console\\Application->doRunCommand(Object(Illuminate\\Queue\\Console\\WorkCommand), Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#63 /var/www/html/ninja/vendor/symfony/console/Application.php(166): Symfony\\Component\\Console\\Application->doRun(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#64 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Console/Application.php(93): Symfony\\Component\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#65 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#66 /var/www/html/ninja/artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#67 {main}
"}
[2021-02-06 19:07:00] production.INFO: latest version = 5.1.1

Looks like it can’t open one of my invoice documents, but I don’t know why and how to fix that :frowning: Can anybody help me? Thank you in advance!

I also can’t view any PDF file because it cannot be found if I try to create an invoice manually without the migration. I guess there is a general problem with the storage. Permissions look good though :frowning:

I continued playing around and I cannot view a PDF (just created a test customer and a test invoice and I click on “View PDF”) in a fresh installation. I’m getting an error 500 and the log says:

[2021-02-06 21:49:04] production.INFO: latest version = 5.1.1
[2021-02-06 21:49:55] production.ERROR: The file "/var/www/html/ninja/public/storage/9OXSLn1KgaT22dvIkD7l1P0fnlQ5JgGLIjRZulnRsTzx7phiWAHjEDzhDDGdvQkz/Ag5K7x5IFmHJg3mgGyiQ5yUaSkfwHQxNOTUWEdNz/invoices/0001.pdf" does not exist {"exception":"[object] (Symfony\\Component\\HttpFoundation\\File\\Exception\\FileNotFoundException(code: 0): The file \"/var/www/html/ninja/public/storage/9OXSLn1KgaT22dvIkD7l1P0fnlQ5JgGLIjRZulnRsTzx7phiWAHjEDzhDDGdvQkz/Ag5K7x5IFmHJg3mgGyiQ5yUaSkfwHQxNOTUWEdNz/invoices/0001.pdf\" does not exist at /var/www/html/ninja/vendor/symfony/http-foundation/File/File.php:36)
[stacktrace]
#0 /var/www/html/ninja/vendor/symfony/http-foundation/BinaryFileResponse.php(93): Symfony\\Component\\HttpFoundation\\File\\File->__construct('/var/www/html/n...')
#1 /var/www/html/ninja/vendor/symfony/http-foundation/BinaryFileResponse.php(51): Symfony\\Component\\HttpFoundation\\BinaryFileResponse->setFile('/var/www/html/n...', 'attachment', false, true)
#2 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(165): Symfony\\Component\\HttpFoundation\\BinaryFileResponse->__construct('/var/www/html/n...', 200, Array, true, 'attachment')
#3 /var/www/html/ninja/app/Http/Controllers/InvoiceController.php(793): Illuminate\\Routing\\ResponseFactory->download('/var/www/html/n...', '0001.pdf')
#4 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\InvoiceController->downloadPdf('IIUqQb8pl52QC38...')
#5 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction('downloadPdf', Array)
#6 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Routing/Route.php(254): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(App\\Http\\Controllers\\InvoiceController), 'downloadPdf')
#7 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Routing/Route.php(197): Illuminate\\Routing\\Route->runController()
#8 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Routing/Router.php(693): Illuminate\\Routing\\Route->run()
#9 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#10 /var/www/html/ninja/app/Http/Middleware/SetInviteDb.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#11 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\SetInviteDb->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#12 /var/www/html/ninja/app/Http/Middleware/QueryLogging.php(38): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#13 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\QueryLogging->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#14 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#15 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#16 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#17 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#18 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#19 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#20 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#21 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(63): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest(Object(Illuminate\\Http\\Request), Object(Illuminate\\Session\\Store), Object(Closure))
#22 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#23 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#24 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#25 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#26 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#27 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#28 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Routing/Router.php(695): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#29 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Routing/Router.php(670): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))
#30 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))
#31 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))
#32 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(166): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))
#33 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))
#34 /var/www/html/ninja/app/Http/Middleware/Cors.php(34): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#35 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\Cors->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#36 /var/www/html/ninja/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#37 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\\Proxy\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#38 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#39 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#40 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#41 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#42 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#43 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#44 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#45 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#46 /var/www/html/ninja/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Middleware.php(46): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#47 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Sentry\\Laravel\\Tracing\\Middleware->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#48 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#49 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#50 /var/www/html/ninja/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#51 /var/www/html/ninja/public/index.php(57): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#52 {main}
"}

Creating the test.pdf worked fine though…How can I fix that?

PS: Just tried the auto updater, doesn’t work too. No messages in the laravel.log, no error in the frontend. The page just reloads and is still on the same version.

After enabling expanded logging, found the following error message:

[2021-02-07 14:10:19] production.INFO: The command "'/var/www/html/ninja/vendor/beganovich/snappdf/versions/850397-Linux_x64/chrome-linux/chrome' '--headless' '--disable-gpu' '--disable-translate' '--disable-extensions' '--disable-sync' '--disable-background-networking' '--disable-software-rasterizer' '--disable-default-apps' '--disable-dev-shm-usage' '--safebrowsing-disable-auto-update' '--run-all-compositor-stages-before-draw' '--no-first-run' '--no-margins' '--no-sandbox' '--print-to-pdf-no-header' '--hide-scrollbars' '--print-to-pdf=/tmp/pdf_6Gek1B.pdf' '/tmp/html_pkHhmC.html'" failed.

Exit Code: 2(Misuse of shell builtins)

Working directory: /var/www/html/ninja/public

Output:
================


Error Output:
================
sh: 1: exec: /var/www/html/ninja/vendor/beganovich/snappdf/versions/850397-Linux_x64/chrome-linux/chrome: Exec format error

I guess this is related to me using an x86 environment? Can I fix this somehow or do I really have to change my OS from x86 to x64?

what environment are you using? shared host?

Hey :slight_smile: No it is not shared. It’s a physical PC in my private workspace at home.

I backed everything up on that Maschine yesterday and installed Debian 64Bit. Has been on my todo list anyway for a while because I also run a Nextcloud on it and the file size limitation with 2 Gb was already annoying in the past. I hope that this thing is fixed then.

Why do you think it fails?

I’m not sure, I haven’t seen this error before. Most likely it is a permissions issue and your system is not allowing the app to call this particular command.

Also it might help if you provide Chrome binary from your OS. Install Chrome/Chromium on your Debian & then set environment variable (globally, not .env file):

SNAPPDF_EXECUTABLE_PATH=/path/to/your/chrome

Is it really required to install Chrome in a server environment without any GUI ? As I said, I reset the system and installed the 64Bit version of the OS. If this still doesn’t solve the issue, I’ll give other options a try. Thanks for the suggestions :slight_smile:

In version 5 we use Chrome to generate PDFs. It is the most reliable option, so we have to go that path.

To install it you don’t need to use any GUI. As I said, I think your current situation might be a bug, so you can try the following:

  1. Install Chromium system-wide: sudo apt install chromium (https://packages.debian.org/stable/web/chromium)

  2. Find where it is installed: whereis chromium

  3. Then just export environment SNAPPDF_EXECUTABLE_PATH=/path/to/chromium

If that solves your issue, then there’s the problem with snappdf downloader.

Edit: … and of course, we provide Docker version of Invoice Ninja, both v4 & v5. That should be one-click install: https://github.com/invoiceninja/dockerfiles/

1 Like

I’ll give it a try when the problem pops up again on the new installation. Don’t know when I will have the time to update though. Maybe next weekend or something ,( I’ll get back :slight_smile: Thanks for the suggestion!

1 Like

How can I pull the docker image for Version v4.5.13 ?
Is there any variable that I can mention in the docker-compose file ?

So I just had some spare time and installed v5 again. It is working now. The only annoying thing is that the dependencies are nowhere documented. I had to try to render a PDF, check the log and install the missing dependency. This is everything I had to install to get the PDF generation running:

apt install libnss3 libatk1.0 libatk-bridge2.0-0 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxrandr2 libgbm1 libgtk-3-0 libasound2 libxshmfence1

This should really be documented somewhere…I’ll try to migrate now. Let’s see if it works finally.

1 Like

Migration went through finally:

[2021-02-11 19:01:03] production.INFO: Importing account
[2021-02-11 19:01:03] production.INFO: Importing company
[2021-02-11 19:01:03] production.INFO: Importing users
[2021-02-11 19:01:04] production.INFO: Importing payment_terms
[2021-02-11 19:01:04] production.INFO: Importing tax_rates
[2021-02-11 19:01:04] production.INFO: Importing clients
[2021-02-11 19:01:09] production.INFO: Importing company_gateways
[2021-02-11 19:01:09] production.INFO: Importing client_gateway_tokens
[2021-02-11 19:01:09] production.INFO: Importing vendors
[2021-02-11 19:01:10] production.INFO: Importing projects
[2021-02-11 19:01:10] production.INFO: Importing products
[2021-02-11 19:01:10] production.INFO: Importing credits
[2021-02-11 19:01:10] production.INFO: Importing invoices
[2021-02-11 19:01:16] production.INFO: Importing recurring_invoices
[2021-02-11 19:01:22] production.INFO: Importing quotes
[2021-02-11 19:01:22] production.INFO: Importing payments
[2021-02-11 19:01:28] production.INFO: Importing expense_categories
[2021-02-11 19:01:28] production.INFO: Importing task_statuses
[2021-02-11 19:01:28] production.INFO: in task statuses
[2021-02-11 19:01:29] production.INFO: finished task statuses
[2021-02-11 19:01:29] production.INFO: Importing expenses
[2021-02-11 19:01:29] production.INFO: Importing tasks
[2021-02-11 19:01:29] production.INFO: Importing documents
[2021-02-11 19:01:37] production.INFO: Completed​:rocket::rocket::rocket::rocket::rocket: at 2021-02-11 19:01:37

Now seriously, this is not a release candidate. This is still buggy as hell. Here is my buglist or things I want to complain about:

  • placeholders in products (like :MONTH or :YEAR) don’t work
  • user documentation is incomplete at invoiceninja.github.io
  • the customer has to login in the portal although it worked without a password in V4
    • he has to reset his password
    • this will increase providing support on my end (because I have to explain them how they have to login now)
  • the bold invoice design looks good in the “editor”, but when I create an actual invoice, it just looks weird (like the address at the top is bold?)
  • creating a custom invoice design, which is not used at the end although saved and set
  • after importing my old invoices, I can’t select / define which invoice design to use for them
    • this is confusing for customers when they have a look at old invoices and suddenly they look totally different

That’s it so far. I stop using it now and I just shut it down and stay with V4. Thanks for the effort so far but this is way to buggy.

Hi @Respig

I have seen some of your issues at well and I am certain that almost all of your issues are already being worked on or at least filed as an issue at GitHub.

I have seen a difference between invoice preview in the editor and the actual pdf file in case the pdf was generated through PhantomJS. I haven’t seen any differences when using Chrome/SnapPDF. What does you .env file say at “PHANTOMJS_PDF_GENERATION”? If true, try to set it to false.

This can be set at the bottom at “settings”.

Cheers,
Gijs

2 Likes

Thanks for the explanation. AFAIK phantomJS was disabled. I removed the V5 installation for now and I give it another try when it is stable.

No offense though and I hope nobody got offended by my last post. I appreciate your work, just took the decision for me personally to wait a little longer because I don’t have that much time to deal with large issues. It just has to work and currently v4 does exactly that.

What I liked about V5 so far was the easy installation process (besides of the missing libraries).

So I’ll be back in about 3 months or so I guess.

We’re happy to try to help resolve these problems but will need more details:

  • placeholders in products (like :MONTH or :YEAR) don’t work
    @ben thoughts on this, I believe this was recently added

  • user documentation is incomplete at invoiceninja.github.io
    – Not sure I’d consider this one a bug but we’re working to improve the docs

  • the customer has to login in the portal although it worked without a password in V4, he has to reset his password this will increase providing support on my end (because I have to explain them how they have to login now)
    – That shouldn’t be the case, please check the password is disabled on Settings > Client Portal

  • the bold invoice design looks good in the “editor”, but when I create an actual invoice, it just looks weird (like the address at the top is bold?)
    – Can you please post screenshots showing the difference

  • creating a custom invoice design, which is not used at the end although saved and set
    – Sorry, I don’t understand this

1 Like

Reserved keywords pull request is still in progress and it should be completed soon with support for overlaps :+1:

1 Like