CRON Configuration

Finally I have managed to get v5 running and my next challenge is the cron job.

I have followed the instructions here:

And have this cron job set:

cd /home/alltbilling/public_html/ && /usr/local/bin/php artisan schedule:run >> /dev/null 2>&1

But still get the warning triangle

Hi,

What do you see if you try running the cron command from the command line?

Good idea, I assume you mean the terminal?

I think you 'll need to include the app folder in cd /home/alltbilling/public_html/

Thanks.

So instead of

cd /home/alltbilling/public_html/ && /usr/local/bin/php artisan schedule:run >> /dev/null 2>&1

I should be using

cd /home/alltbilling/public_html/public && /usr/local/bin/php artisan schedule:run >> /dev/null 2>&1

If you’ve named the Invoice Ninja app folder ‘public’ then it would be correct

When I did the install I set the folder as:

sub.domain.com

And when I use it I use:

sub.domain.com/#/

I assume that was by mapping the web root to the public folder?

Hi

I didn’t map anything to be honest, I just set the folder when I did the install and that’s what I ended up with.

This is in the .env file:

APP_URL=“https://sub.domain.com/

@david any thoughts?

The configuration looks correct to me, it may take ~24 hrs for the triangle to remove itself after the next check is run.

Unfortunately I still have the red triangle there.

@infowhatnowebsite-co

Are you able to set a recurring invoice and see if it sends on schedule and/or reminders etc etc…

I think there are bigger issues than that to be fair. I can’t do ANYTHING with an invoice, even save. I just get a 500 error if I try to save, view PDF, anything.

500: Server Error

Please share details about the error from storage/logs and we’ll try to help

[2022-09-27 19:57:14] production.ERROR: Call to undefined function App\DataMapper\iconv_strlen() {“userId”:1,“exception”:"[object] (Error(code: 0): Call to undefined function App\DataMapper\iconv_strlen() at /home/alltbilling/public_html/app/DataMapper/ClientSettings.php:95)
[stacktrace]
#0 /home/alltbilling/public_html/app/Models/Client.php(357): App\DataMapper\ClientSettings::buildClientSettings(Object(stdClass), Object(stdClass))
#1 /home/alltbilling/public_html/app/Services/Invoice/UpdateReminder.php(34): App\Models\Client->getMergedSettings()
#2 /home/alltbilling/public_html/app/Services/Invoice/InvoiceService.php(278): App\Services\Invoice\UpdateReminder->run()
#3 /home/alltbilling/public_html/app/Repositories/BaseRepository.php(219): App\Services\Invoice\InvoiceService->setReminder()
#4 /home/alltbilling/public_html/app/Repositories/InvoiceRepository.php(35): App\Repositories\BaseRepository->alternativeSave(Array, Object(App\Models\Invoice))
#5 /home/alltbilling/public_html/app/Http/Controllers/InvoiceController.php(222): App\Repositories\InvoiceRepository->save(Array, Object(App\Models\Invoice))
#6 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\Http\Controllers\InvoiceController->store(Object(App\Http\Requests\Invoice\StoreInvoiceRequest))
#7 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction(‘store’, Array)
#8 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(261): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(App\Http\Controllers\InvoiceController), ‘store’)
#9 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(204): Illuminate\Routing\Route->runController()
#10 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(725): Illuminate\Routing\Route->run()
#11 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#12 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(126): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#13 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(62): Illuminate\Routing\Middleware\ThrottleRequests->handleRequest(Object(Illuminate\Http\Request), Object(Closure), Array)
#14 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Routing\Middleware\ThrottleRequests->handle(Object(Illuminate\Http\Request), Object(Closure), ‘300’, ‘1’)
#15 /home/alltbilling/public_html/app/Http/Middleware/QueryLogging.php(39): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#16 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\Http\Middleware\QueryLogging->handle(Object(Illuminate\Http\Request), Object(Closure))
#17 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#18 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))
#19 /home/alltbilling/public_html/app/Http/Middleware/Locale.php(46): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#20 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\Http\Middleware\Locale->handle(Object(Illuminate\Http\Request), Object(Closure))
#21 /home/alltbilling/public_html/app/Http/Middleware/TokenAuth.php(96): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#22 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\Http\Middleware\TokenAuth->handle(Object(Illuminate\Http\Request), Object(Closure))
#23 /home/alltbilling/public_html/app/Http/Middleware/SetDb.php(40): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#24 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\Http\Middleware\SetDb->handle(Object(Illuminate\Http\Request), Object(Closure))
#25 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#26 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(726): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#27 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(703): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#28 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(667): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
#29 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(656): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#30 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#31 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#32 /home/alltbilling/public_html/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestIpMiddleware.php(45): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#33 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Sentry\Laravel\Http\SetRequestIpMiddleware->handle(Object(Illuminate\Http\Request), Object(Closure))
#34 /home/alltbilling/public_html/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestMiddleware.php(42): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#35 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Sentry\Laravel\Http\SetRequestMiddleware->handle(Object(Illuminate\Http\Request), Object(Closure))
#36 /home/alltbilling/public_html/vendor/livewire/livewire/src/DisableBrowserCache.php(19): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#37 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Livewire\DisableBrowserCache->handle(Object(Illuminate\Http\Request), Object(Closure))
#38 /home/alltbilling/public_html/app/Http/Middleware/Cors.php(25): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#39 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\Http\Middleware\Cors->handle(Object(Illuminate\Http\Request), Object(Closure))
#40 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#41 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Http\Middleware\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#42 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#43 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#44 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle(Object(Illuminate\Http\Request), Object(Closure))
#45 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#46 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#47 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\TrimStrings->handle(Object(Illuminate\Http\Request), Object(Closure))
#48 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#49 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))
#50 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#51 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle(Object(Illuminate\Http\Request), Object(Closure))
#52 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#53 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#54 /home/alltbilling/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#55 /home/alltbilling/public_html/public/index.php(57): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#56 {main}
"}

From the error it looks like the iconv PHP extension needs to be enabled.

@david according to this post it looks like changing from iconv_strlen to mb_strlen may avoid this issue.

We have widespread usage of iconv to handle conversion from different char sets and in particular the strictness of the checks, it was a deliberate choice to use this particular function.

iconv should be a very standard inclusion in PHP, i am surprised it is not installed in the base packages.

I have enabled iconv and that seems to have fixed the save errors I was experiencing, thanks for that.

The CRON warning triangle is still present though, any suggestions…?