Looking for some directions on where to go from here. I tried developing a script that creates expenses based on a csv file, but now my Expenses page wont load after running it - “An error occurred, please refresh the page and try again.” and none of the expenses show up.
From the Dashboard’s Recent Activity I can click on one of the recent expenses and it opens and everything looks pretty good except the “Date” field didn’t get put in like I wanted, it’s just empty. Date was supposed to be used to prevent duplicates, so when I ran it a second time, it created more expenses (not sure if that matters)
hillel
September 3, 2024, 4:53pm
2
Hi,
Are there any errors in storage/logs?
Are you able to see the expenses with the desktop app?
Desktop and web show the same error. Here’s the logs
#67 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\\Pipeline\\Pipeline->then()
#68 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(145): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#69 /var/www/app/public/index.php(56): Illuminate\\Foundation\\Http\\Kernel->handle()
#70 {main}
"}
[2024-09-03 16:50:47] production.ERROR: SQLSTATE[42000]: Syntax error or access violation: 1305 FUNCTION ninja.REGEXP_REPLACE does not exist (Connection: mysql, SQL: select * from `expenses` where `expenses`.`company_id` = 1 and (exists (select * from `clients` where `expenses`.`client_id` = `clients`.`id` and `is_deleted` = 0 and `deleted_at` is null and `clients`.`deleted_at` is null) or `client_id` is null) and (exists (select * from `vendors` where `expenses`.`vendor_id` = `vendors`.`id` and `is_deleted` = 0 and `deleted_at` is null and `vendors`.`deleted_at` is null) or `vendor_id` is null) and (`deleted_at` is null) order by REGEXP_REPLACE(number,'[^0-9]+','')+0 asc limit 50 offset 0) {"userId":1,"exception":"[object] (Illuminate\\Database\\QueryException(code: 42000): SQLSTATE[42000]: Syntax error or access violation: 1305 FUNCTION ninja.REGEXP_REPLACE does not exist (Connection: mysql, SQL: select * from `expenses` where `expenses`.`company_id` = 1 and (exists (select * from `clients` where `expenses`.`client_id` = `clients`.`id` and `is_deleted` = 0 and `deleted_at` is null and `clients`.`deleted_at` is null) or `client_id` is null) and (exists (select * from `vendors` where `expenses`.`vendor_id` = `vendors`.`id` and `is_deleted` = 0 and `deleted_at` is null and `vendors`.`deleted_at` is null) or `vendor_id` is null) and (`deleted_at` is null) order by REGEXP_REPLACE(number,'[^0-9]+','')+0 asc limit 50 offset 0) at /var/www/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:825)
[stacktrace]
#0 /var/www/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(779): Illuminate\\Database\\Connection->runQueryCallback()
#1 /var/www/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(398): Illuminate\\Database\\Connection->run()
#2 /var/www/app/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3088): Illuminate\\Database\\Connection->select()
#3 /var/www/app/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3073): Illuminate\\Database\\Query\\Builder->runSelect()
#4 /var/www/app/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3661): Illuminate\\Database\\Query\\Builder->Illuminate\\Database\\Query\\{closure}()
#5 /var/www/app/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3072): Illuminate\\Database\\Query\\Builder->onceWithColumns()
#6 /var/www/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(759): Illuminate\\Database\\Query\\Builder->get()
#7 /var/www/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(741): Illuminate\\Database\\Eloquent\\Builder->getModels()
#8 /var/www/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(985): Illuminate\\Database\\Eloquent\\Builder->get()
#9 /var/www/app/app/Http/Controllers/BaseController.php(957): Illuminate\\Database\\Eloquent\\Builder->paginate()
#10 /var/www/app/app/Http/Controllers/ExpenseController.php(109): App\\Http\\Controllers\\BaseController->listResponse()
#11 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\ExpenseController->index()
#12 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\\Routing\\Controller->callAction()
#13 /var/www/app/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Routing/TracingControllerDispatcherTracing.php(21): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#14 /var/www/app/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Routing/TracingRoutingDispatcher.php(18): Sentry\\Laravel\\Tracing\\Routing\\TracingControllerDispatcherTracing->Sentry\\Laravel\\Tracing\\Routing\\{closure}()
#15 /var/www/app/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Routing/TracingControllerDispatcherTracing.php(20): Sentry\\Laravel\\Tracing\\Routing\\TracingRoutingDispatcher->wrapRouteDispatch()
#16 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Route.php(260): Sentry\\Laravel\\Tracing\\Routing\\TracingControllerDispatcherTracing->dispatch()
#17 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Route.php(206): Illuminate\\Routing\\Route->runController()
#18 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(808): Illuminate\\Routing\\Route->run()
#19 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#20 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(124): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#21 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(89): Illuminate\\Routing\\Middleware\\ThrottleRequests->handleRequestUsingNamedLimiter()
#22 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Routing\\Middleware\\ThrottleRequests->handle()
#23 /var/www/app/app/Http/Middleware/QueryLogging.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#24 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\QueryLogging->handle()
#25 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(51): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#26 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#27 /var/www/app/app/Http/Middleware/Locale.php(95): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#28 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\Locale->handle()
#29 /var/www/app/app/Http/Middleware/TokenAuth.php(102): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#30 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\TokenAuth->handle()
#31 /var/www/app/app/Http/Middleware/SetDb.php(40): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#32 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\SetDb->handle()
#33 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#34 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(807): Illuminate\\Pipeline\\Pipeline->then()
#35 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(786): Illuminate\\Routing\\Router->runRouteWithinStack()
#36 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(750): Illuminate\\Routing\\Router->runRoute()
#37 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(739): Illuminate\\Routing\\Router->dispatchToRoute()
#38 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(201): Illuminate\\Routing\\Router->dispatch()
#39 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#40 /var/www/app/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/FlushEventsMiddleware.php(13): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#41 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Sentry\\Laravel\\Http\\FlushEventsMiddleware->handle()
#42 /var/www/app/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestIpMiddleware.php(45): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#43 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Sentry\\Laravel\\Http\\SetRequestIpMiddleware->handle()
#44 /var/www/app/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestMiddleware.php(31): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#45 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Sentry\\Laravel\\Http\\SetRequestMiddleware->handle()
#46 /var/www/app/vendor/livewire/livewire/src/Features/SupportDisablingBackButtonCache/DisableBackButtonCacheMiddleware.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#47 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Livewire\\Features\\SupportDisablingBackButtonCache\\DisableBackButtonCacheMiddleware->handle()
#48 /var/www/app/app/Http/Middleware/Cors.php(24): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#49 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\Cors->handle()
#50 /var/www/app/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#51 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\TrustProxies->handle()
#52 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#53 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#54 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#55 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#56 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(51): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#57 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#58 /var/www/app/vendor/laravel/framework/src/Illuminate/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#59 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\ValidatePostSize->handle()
#60 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(110): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#61 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#62 /var/www/app/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Middleware.php(79): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#63 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Sentry\\Laravel\\Tracing\\Middleware->handle()
#64 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#65 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\\Pipeline\\Pipeline->then()
#66 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(145): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#67 /var/www/app/public/index.php(56): Illuminate\\Foundation\\Http\\Kernel->handle()
#68 {main}
[previous exception] [object] (PDOException(code: 42000): SQLSTATE[42000]: Syntax error or access violation: 1305 FUNCTION ninja.REGEXP_REPLACE does not exist at /var/www/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:407)
[stacktrace]
#0 /var/www/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(407): PDO->prepare()
#1 /var/www/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(812): Illuminate\\Database\\Connection->Illuminate\\Database\\{closure}()
#2 /var/www/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(779): Illuminate\\Database\\Connection->runQueryCallback()
#3 /var/www/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(398): Illuminate\\Database\\Connection->run()
#4 /var/www/app/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3088): Illuminate\\Database\\Connection->select()
#5 /var/www/app/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3073): Illuminate\\Database\\Query\\Builder->runSelect()
#6 /var/www/app/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3661): Illuminate\\Database\\Query\\Builder->Illuminate\\Database\\Query\\{closure}()
#7 /var/www/app/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3072): Illuminate\\Database\\Query\\Builder->onceWithColumns()
#8 /var/www/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(759): Illuminate\\Database\\Query\\Builder->get()
#9 /var/www/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(741): Illuminate\\Database\\Eloquent\\Builder->getModels()
#10 /var/www/app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(985): Illuminate\\Database\\Eloquent\\Builder->get()
#11 /var/www/app/app/Http/Controllers/BaseController.php(957): Illuminate\\Database\\Eloquent\\Builder->paginate()
#12 /var/www/app/app/Http/Controllers/ExpenseController.php(109): App\\Http\\Controllers\\BaseController->listResponse()
#13 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\ExpenseController->index()
#14 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\\Routing\\Controller->callAction()
#15 /var/www/app/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Routing/TracingControllerDispatcherTracing.php(21): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#16 /var/www/app/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Routing/TracingRoutingDispatcher.php(18): Sentry\\Laravel\\Tracing\\Routing\\TracingControllerDispatcherTracing->Sentry\\Laravel\\Tracing\\Routing\\{closure}()
#17 /var/www/app/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Routing/TracingControllerDispatcherTracing.php(20): Sentry\\Laravel\\Tracing\\Routing\\TracingRoutingDispatcher->wrapRouteDispatch()
#18 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Route.php(260): Sentry\\Laravel\\Tracing\\Routing\\TracingControllerDispatcherTracing->dispatch()
#19 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Route.php(206): Illuminate\\Routing\\Route->runController()
#20 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(808): Illuminate\\Routing\\Route->run()
#21 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#22 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(124): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#23 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(89): Illuminate\\Routing\\Middleware\\ThrottleRequests->handleRequestUsingNamedLimiter()
#24 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Routing\\Middleware\\ThrottleRequests->handle()
#25 /var/www/app/app/Http/Middleware/QueryLogging.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#26 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\QueryLogging->handle()
#27 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(51): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#28 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#29 /var/www/app/app/Http/Middleware/Locale.php(95): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#30 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\Locale->handle()
#31 /var/www/app/app/Http/Middleware/TokenAuth.php(102): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#32 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\TokenAuth->handle()
#33 /var/www/app/app/Http/Middleware/SetDb.php(40): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#34 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\SetDb->handle()
#35 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#36 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(807): Illuminate\\Pipeline\\Pipeline->then()
#37 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(786): Illuminate\\Routing\\Router->runRouteWithinStack()
#38 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(750): Illuminate\\Routing\\Router->runRoute()
#39 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(739): Illuminate\\Routing\\Router->dispatchToRoute()
#40 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(201): Illuminate\\Routing\\Router->dispatch()
#41 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#42 /var/www/app/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/FlushEventsMiddleware.php(13): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#43 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Sentry\\Laravel\\Http\\FlushEventsMiddleware->handle()
#44 /var/www/app/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestIpMiddleware.php(45): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#45 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Sentry\\Laravel\\Http\\SetRequestIpMiddleware->handle()
#46 /var/www/app/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestMiddleware.php(31): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#47 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Sentry\\Laravel\\Http\\SetRequestMiddleware->handle()
#48 /var/www/app/vendor/livewire/livewire/src/Features/SupportDisablingBackButtonCache/DisableBackButtonCacheMiddleware.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#49 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Livewire\\Features\\SupportDisablingBackButtonCache\\DisableBackButtonCacheMiddleware->handle()
#50 /var/www/app/app/Http/Middleware/Cors.php(24): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#51 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\Cors->handle()
#52 /var/www/app/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#53 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\TrustProxies->handle()
#54 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#55 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#56 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#57 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#58 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(51): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#59 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#60 /var/www/app/vendor/laravel/framework/src/Illuminate/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#61 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\ValidatePostSize->handle()
#62 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(110): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#63 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#64 /var/www/app/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Middleware.php(79): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#65 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Sentry\\Laravel\\Tracing\\Middleware->handle()
#66 /var/www/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#67 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\\Pipeline\\Pipeline->then()
#68 /var/www/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(145): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#69 /var/www/app/public/index.php(56): Illuminate\\Foundation\\Http\\Kernel->handle()
#70 {main}
"}
And here is my code that created the expenses if it’s relevent:
def create_expense(expense_data, dry_run=False, existing_expenses=[]):
# ... (other logic)
if not dry_run:
if not is_duplicate(expense_data, existing_expenses):
response = requests.post(f"{BASE_URL}/expenses", json=expense_data, headers=headers)
if response.status_code == 200:
logger.info(f"Created expense: {expense_data['amount']} on {expense_data['date']} for '{client_name}' - {title_preview}")
reconciliation["expenses_created"] += 1
reconciliation["total_amount_processed"] += float(expense_data['amount'])
else:
error_msg = f"Failed to create expense: {response.status_code}"
logger.error(f"{error_msg}\nResponse: {response.text}")
reconciliation["errors"].append(error_msg)
else:
logger.info(f"Skipping duplicate expense: {expense_data['amount']} on {expense_data['date']} for '{client_name}' - {title_preview}")
reconciliation["expenses_skipped"] += 1
hillel
September 3, 2024, 5:19pm
4
I’m realizing in my Docker setup, I’m running the :latest copy of invoiceninja/invoiceninja but I’m using an old mysql:5 version. Is this easy to update/migrate this? I kinda feel like I’m going down a rabbit hole here though to be honest.
The expense page was working, then I made an API call and the expense page quit working…I cant reconcile how suddenly I need update my sql version. And I’m past the API step, so I’m just trying to view the same page I was just viewing… (just trying to rationalize what’s happening, I’m half panicking right now )
hillel
September 3, 2024, 6:05pm
6
Are you using this docker file?
It’s possible the problem was always there but was triggered by adding data.
That is quite old. Current version is 8.x and if you’re using MariaDB it is 10.11.8. There have been numerous security and performance updates since then. It is recommended to upgrade.
Here are upgrade instructions for MySQL from the developers:
https://dev.mysql.com/blog-archive/inplace-upgrade-from-mysql-5-7-to-mysql-8-0/
Here are upgrade instructions with a few extra tips from a relatively reliable source. I have generally found the guides in this site to be reliable and accurate.
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
Based on the fact you’ve said you are using version 5, I think it’s safe to assume you’re using the Oracle MySQL. However, if you use MariaDB, it should be upgraded when you update Ubuntu or Debian. If not, here are instructions, including how to upgrade between major versions.
Another option would be to use mysqldump
and dump the contents of your database to a file. Then save your .env
file and standup a new instance, copy over the .env
and import your database file on the new instance. The only other thing you may need to do is re-upload your business logo. Just don’t delete the old instance until everything is setup and working on the new one.
1 Like