Clarification on V5 Software Updates

Thanks @david , I’ve made the change to my .env file. I’ll see what happens in a few days. I’ll start with not accessing /update?secret= and see if the log starts rotating on its own. Just to be clear, I did not run:

php artisan optimize

Is that right that I don’t need to do that?

Also, the .env documentation doesn’t seem to mention the option for LOG_CHANNEL=daily at all. Should this be updated?

I updated to 5.5.104 the other night, and I’m still a bit concerned about the log file growth. After the upgrade, I deleted the /storage/logs/laravel.log file after making a backup of it. In the last 24 hours I only sent one invoice and entered one payment, and the log is 600MB in size. Is it expected to grow that much?

Every once in awhile, Invoice Ninja seems to lock up the web server entirely for a minute or sometimes more, to the point of text not even being able to be entered in the CLI of my SSH session. Even trying to run top to see what the process is that’s eating resources doesn’t even run until whatever it’s doing is finished. Last night I managed to trigger this by editing an invoice and the bottom preview was stuck trying to render (I use snappdf). The server locked up, no other websites hosted on it would respond, and the SSH session locked up. A minute or so later, and it was okay again. Websites started responding, Invoice Ninja was fine again, and I regained control of the CLI via SSH. Exiting and going back into the same invoice rendered the invoice almost immediately in the preview section at the bottom, which is the way it happens normally, so it’s definitely hit and miss and the lockups seem to happen at random. I opened a few other invoices and they all opened fine as well.

Are these known issues that are being worked on with performance of the application server side? Could this be contributing to the large log files? Is it normal they grow so much, or does that indicate there’s a problem?

Thanks very much for all your help so far. I wouldn’t go to the effort of ensuring the documentation was correct and working through all of these issues if I didn’t really believe in the Invoice Ninja project and want to see it keep getting better. Really, really appreciate all the work you guys are doing on this.

The LOG_CHANNEL variable is controlled by the framework we use for the API, https://laravel.com so a lot of base functionality is derived from there and it really isn’t feasible to put all the possible configurations into our documentation.

600mb of log files in a day is not normal, can you advise what is filling up the logs?

The optimize command should not be required after updating to .104

In regards to the lockup, can you identify when this happens? The app does fire a lot of jobs if it is being used intensively. If you are on shared hosting, it may be possible that your webhost is throttling your account due to excessive resource consumption.

I think the first place to start here is to see what is exactly being logged to the logs as stopping this may help performance a fair bit.

The LOG_CHANNEL variable is controlled by the framework we use for the API, https://laravel.com so a lot of base functionality is derived from there and it really isn’t feasible to put all the possible configurations into our documentation.

Ah, got it, understandable.

The optimize command should not be required after updating to .104

Perfect, thanks @david !

600mb of log files in a day is not normal, can you advise what is filling up the logs?

You bet. In fact, just to see what would happen, I haven’t used Invoice Ninja for a little over a day now. I’m the only user, so nobody else would be doing anything with it. Other websites on the server were accessed, but I’m the only one to uses Invoice Ninja.

Without loading Invoice Ninja once, via web or mobile app, the log file from the last day is 630MB. I downloaded the log to my machine and opened it in Notepad, which took forever, but when it finally opened, this is what I see spewed out over and over again. I’ve replaced the name of the actual path with /invoiceninja/path.

laravel-2023-04-21.log:

[2023-04-21 23:59:59] production.ERROR: Error retrieving credentials from the instance profile metadata service. (cURL error 7: Failed to connect to 169.254.169.254 port 80 after 1 ms: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://169.254.169.254/latest/meta-data/iam/security-credentials/) {"exception":"[object] (Aws\\Exception\\CredentialsException(code: 0): Error retrieving credentials from the instance profile metadata service. (cURL error 7: Failed to connect to 169.254.169.254 port 80 after 1 ms: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://169.254.169.254/latest/meta-data/iam/security-credentials/) at /invoiceninja/path/vendor/aws/aws-sdk-php/src/Credentials/InstanceProfileProvider.php:264)
[stacktrace]
#0 /invoiceninja/path/vendor/aws/aws-sdk-php/src/Credentials/InstanceProfileProvider.php(139): Aws\\Credentials\\InstanceProfileProvider->handleRetryableException()
#1 [internal function]: Aws\\Credentials\\InstanceProfileProvider->Aws\\Credentials\\{closure}()
#2 /invoiceninja/path/vendor/guzzlehttp/promises/src/Coroutine.php(160): Generator->throw()
#3 /invoiceninja/path/vendor/guzzlehttp/promises/src/Promise.php(204): GuzzleHttp\\Promise\\Coroutine->_handleFailure()
#4 /invoiceninja/path/vendor/guzzlehttp/promises/src/Promise.php(153): GuzzleHttp\\Promise\\Promise::callHandler()
#5 /invoiceninja/path/vendor/guzzlehttp/promises/src/TaskQueue.php(48): GuzzleHttp\\Promise\\Promise::GuzzleHttp\\Promise\\{closure}()
#6 /invoiceninja/path/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(159): GuzzleHttp\\Promise\\TaskQueue->run()
#7 /invoiceninja/path/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(184): GuzzleHttp\\Handler\\CurlMultiHandler->tick()
#8 /invoiceninja/path/vendor/guzzlehttp/promises/src/Promise.php(248): GuzzleHttp\\Handler\\CurlMultiHandler->execute()
#9 /invoiceninja/path/vendor/guzzlehttp/promises/src/Promise.php(224): GuzzleHttp\\Promise\\Promise->invokeWaitFn()
#10 /invoiceninja/path/vendor/guzzlehttp/promises/src/Promise.php(269): GuzzleHttp\\Promise\\Promise->waitIfPending()
#11 /invoiceninja/path/vendor/guzzlehttp/promises/src/Promise.php(226): GuzzleHttp\\Promise\\Promise->invokeWaitList()
#12 /invoiceninja/path/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\\Promise\\Promise->waitIfPending()
#13 /invoiceninja/path/vendor/guzzlehttp/promises/src/Coroutine.php(67): GuzzleHttp\\Promise\\Promise->wait()
#14 /invoiceninja/path/vendor/guzzlehttp/promises/src/Promise.php(248): GuzzleHttp\\Promise\\Coroutine->GuzzleHttp\\Promise\\{closure}()
#15 /invoiceninja/path/vendor/guzzlehttp/promises/src/Promise.php(224): GuzzleHttp\\Promise\\Promise->invokeWaitFn()
#16 /invoiceninja/path/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\\Promise\\Promise->waitIfPending()
#17 /invoiceninja/path/vendor/guzzlehttp/promises/src/Coroutine.php(103): GuzzleHttp\\Promise\\Promise->wait()
#18 /invoiceninja/path/vendor/guzzlehttp/promises/src/Promise.php(274): GuzzleHttp\\Promise\\Coroutine->wait()
#19 /invoiceninja/path/vendor/guzzlehttp/promises/src/Promise.php(226): GuzzleHttp\\Promise\\Promise->invokeWaitList()
#20 /invoiceninja/path/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\\Promise\\Promise->waitIfPending()
#21 /invoiceninja/path/vendor/aws/aws-sdk-php/src/AwsClientTrait.php(58): GuzzleHttp\\Promise\\Promise->wait()
#22 /invoiceninja/path/vendor/aws/aws-sdk-php/src/AwsClientTrait.php(86): Aws\\AwsClient->execute()
#23 /invoiceninja/path/vendor/laravel/framework/src/Illuminate/Queue/SqsQueue.php(172): Aws\\AwsClient->__call()
#24 /invoiceninja/path/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(342): Illuminate\\Queue\\SqsQueue->pop()
#25 /invoiceninja/path/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(351): Illuminate\\Queue\\Worker->Illuminate\\Queue\\{closure}()
#26 /invoiceninja/path/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(160): Illuminate\\Queue\\Worker->getNextJob()
#27 /invoiceninja/path/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(148): Illuminate\\Queue\\Worker->daemon()
#28 /invoiceninja/path/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(131): Illuminate\\Queue\\Console\\WorkCommand->runWorker()
#29 /invoiceninja/path/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\Queue\\Console\\WorkCommand->handle()
#30 /invoiceninja/path/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#31 /invoiceninja/path/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
#32 /invoiceninja/path/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod()
#33 /invoiceninja/path/vendor/laravel/framework/src/Illuminate/Container/Container.php(661): Illuminate\\Container\\BoundMethod::call()
#34 /invoiceninja/path/vendor/laravel/framework/src/Illuminate/Console/Command.php(183): Illuminate\\Container\\Container->call()
#35 /invoiceninja/path/vendor/symfony/console/Command/Command.php(312): Illuminate\\Console\\Command->execute()
#36 /invoiceninja/path/vendor/laravel/framework/src/Illuminate/Console/Command.php(153): Symfony\\Component\\Console\\Command\\Command->run()
#37 /invoiceninja/path/vendor/symfony/console/Application.php(1022): Illuminate\\Console\\Command->run()
#38 /invoiceninja/path/vendor/symfony/console/Application.php(314): Symfony\\Component\\Console\\Application->doRunCommand()
#39 /invoiceninja/path/vendor/symfony/console/Application.php(168): Symfony\\Component\\Console\\Application->doRun()
#40 /invoiceninja/path/vendor/laravel/framework/src/Illuminate/Console/Application.php(102): Symfony\\Component\\Console\\Application->run()
#41 /invoiceninja/path/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(155): Illuminate\\Console\\Application->run()
#42 /invoiceninja/path/artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle()
#43 {main}
"} 
Error retrieving credentials from the instance profile metadata service. (cURL error 7: Failed to connect to 169.254.169.254 port 80 after 1 ms: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://169.254.169.254/latest/meta-data/iam/security-credentials/)

This indicates the system is attempting to authenticate with AWS, do you have any configurations enabled for s3 storage? you should not be seeing this message at all.

do you have any configurations enabled for s3 storage?

None. The error seems specific to Invoice Ninja as no other standard web server logs are showing anything out of the ordinary, and this is a new server OS installation (Ubuntu 22.04 LTS) as of a few weeks ago. Is there somewhere in Invoice Ninja that has a configuration for AWS/S3 that I should check?

@david Nevermind, got it. It’s related to Supervisor. I’m going to update my post here so people can find it more easily.

1 Like