Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating Deposit Transaction will produce "Array To String Exception" and could not edit the created transaction (It had ID 0) #4551

Closed
gthbusrr opened this issue Mar 29, 2021 · 7 comments
Labels
bug Verified and replicated bugs and issues. fixed Bugs that are fixed (in a coming release).

Comments

@gthbusrr
Copy link

Bug description
I am running Firefly III version 5.5.1, and my problem is:
Creating Deposit Transaction will produce "Array To String Exception" and could not edit the created transaction (It had ID 0)

Steps to reproduce

  • Create Deposit Transaction (With Category and Tags)
    Extra info

Debug information generated at 2021-03-29 10:47:25 Asia/Hong_Kong for Firefly III version 5.5.1.

Scope Version
Firefly III 5.5.1
Firefly III API 1.5.0
PHP 8.0.3
Host Linux
System info Value
Using docker? true
Telemetry false
Layout v2
App environment local
App debug mode true
App cache driver file
App logging notice, stack
Display errors Off
Error reporting ALL errors
Interface apache2handler
Default language en_US
Default locale equal
BCscale 12
DB drivers mysql, pgsql, sqlite
Current driver mysql
DB version 16 (exp. 16)
Login provider eloquent
Trusted proxies (.env) **
User info Value
Session start 2021-03-01 00:00:00
Session end 2021-03-31 23:59:59
Session first 2020-12-31 00:00:00
User ID 1
User language en_GB
User locale en_GB
Attempt at "en_GB.utf8" 'en_GB.utf8'
Attempt at "en_GB.UTF-8" 'en_GB.UTF-8'
User agent Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0
Truncated from this point <----|/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\\Pipeline\\Pipeline->then()
#43 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#44 /var/www/html/public/index.php(76): Illuminate\\Foundation\\Http\\Kernel->handle()
#45 {main}
"} 
[2021-03-29 10:32:07] local.ERROR: Exception is: {"class":"ErrorException","errorMessage":"Array to string conversion","time":"Mon, 29 Mar 2021 10:32:07 +0800","file":"\/var\/www\/html\/app\/Services\/Internal\/Support\/JournalServiceTrait.php","line":389,"code":0,"version":"5.5.1","url":"https:\/\/expenses.andrewinian.com\/api\/v1\/transactions","userAgent":"Mozilla\/5.0 (Windows NT 10.0; rv:78.0) Gecko\/20100101 Firefox\/78.0","json":true}  
[2021-03-29 10:32:07] local.ERROR: Exception when mailing: View [emails.error-html] not found.  
[2021-03-29 10:32:07] local.ERROR: Array to string conversion {"userId":1,"exception":"[object] (ErrorException(code: 0): Array to string conversion at /var/www/html/app/Services/Internal/Support/JournalServiceTrait.php:389)
[stacktrace]
#0 /var/www/html/app/Services/Internal/Support/JournalServiceTrait.php(389): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError()
#1 /var/www/html/app/Factory/TransactionJournalFactory.php(285): FireflyIII\\Factory\\TransactionJournalFactory->storeTags()
#2 /var/www/html/app/Factory/TransactionJournalFactory.php(118): FireflyIII\\Factory\\TransactionJournalFactory->createJournal()
#3 /var/www/html/app/Factory/TransactionGroupFactory.php(66): FireflyIII\\Factory\\TransactionJournalFactory->create()
#4 /var/www/html/app/Repositories/TransactionGroup/TransactionGroupRepository.php(357): FireflyIII\\Factory\\TransactionGroupFactory->create()
#5 /var/www/html/app/Api/V1/Controllers/Models/Transaction/StoreController.php(91): FireflyIII\\Repositories\\TransactionGroup\\TransactionGroupRepository->store()
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): FireflyIII\\Api\\V1\\Controllers\\Models\\Transaction\\StoreController->store()
#7 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction()
#8 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(254): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(197): Illuminate\\Routing\\Route->runController()
#10 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(693): Illuminate\\Routing\\Route->run()
#11 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#12 /var/www/html/app/Api/V1/Controllers/Models/Transaction/StoreController.php(68): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#13 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): FireflyIII\\Api\\V1\\Controllers\\Models\\Transaction\\StoreController->FireflyIII\\Api\\V1\\Controllers\\Models\\Transaction\\{closure}()
#14 /var/www/html/app/Api/V1/Controllers/Controller.php(64): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#15 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): FireflyIII\\Api\\V1\\Controllers\\Controller->FireflyIII\\Api\\V1\\Controllers\\{closure}()
#16 /var/www/html/app/Http/Middleware/Binder.php(79): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#17 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): FireflyIII\\Http\\Middleware\\Binder->handle()
#18 /var/www/html/app/Http/Middleware/Authenticate.php(74): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#19 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): FireflyIII\\Http\\Middleware\\Authenticate->handle()
#20 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#21 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(695): Illuminate\\Pipeline\\Pipeline->then()
#22 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(670): Illuminate\\Routing\\Router->runRouteWithinStack()
#23 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636): Illuminate\\Routing\\Router->runRoute()
#24 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\\Routing\\Router->dispatchToRoute()
#25 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(166): Illuminate\\Routing\\Router->dispatch()
#26 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#27 /var/www/html/app/Http/Middleware/InstallationId.php(54): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#28 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): FireflyIII\\Http\\Middleware\\InstallationId->handle()
#29 /var/www/html/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#30 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\\Proxy\\TrustProxies->handle()
#31 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#32 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#33 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#34 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#35 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#36 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#37 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#38 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#39 /var/www/html/app/Http/Middleware/SecureHeaders.php(51): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#40 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): FireflyIII\\Http\\Middleware\\SecureHeaders->handle()
#41 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#42 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\\Pipeline\\Pipeline->then()
#43 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#44 /var/www/html/public/index.php(76): Illuminate\\Foundation\\Http\\Kernel->handle()
#45 {main}
"} 
[2021-03-29 10:32:17] local.ERROR: Could not find group 0, so give big fat error.  
[2021-03-29 10:32:36] local.ERROR: Could not find group 0, so give big fat error.  
[2021-03-29 10:32:39] local.ERROR: Could not find group 846, so give big fat error.  
[2021-03-29 10:32:42] local.ERROR: Could not find group 847, so give big fat error.  
[2021-03-29 10:32:44] local.ERROR: Could not find group 848, so give big fat error.  
[2021-03-29 10:32:59] local.WARNING: GracefulNotFoundHandler cannot handle route with name "transactions.delete"  

Bonus points

  • I searched and nobody reported this bug before
  • I have added a stack trace from my log files
  • I have added a screenshot.
  • I was able to replicate it on the demo site https://demo.firefly-iii.org/
@JC5
Copy link
Member

JC5 commented Mar 29, 2021

Indeed. It's a bug in the new layout. I'll pick it up for 5.5.2.

@JC5 JC5 added bug Verified and replicated bugs and issues. fixed Bugs that are fixed (in a coming release). labels Mar 29, 2021
@luca-rhk
Copy link

luca-rhk commented Apr 1, 2021

Thanks for the quick fix! I have the same problem. Is it possible to delete such a transaction with ID = 0? When trying to delete/edit the transaction, I get the 404 error.

@JC5
Copy link
Member

JC5 commented Apr 1, 2021

Yes, but you'll have to fiddle in your database. Do you feel confident to do so? Can you make a backup?

@gthbusrr
Copy link
Author

gthbusrr commented Apr 1, 2021

Thanks for the quick fix! I have the same problem. Is it possible to delete such a transaction with ID = 0? When trying to delete/edit the transaction, I get the 404 error.

According to my experience, selecting the checkbox and "batch" delete the transaction does the trick every time

@luca-rhk
Copy link

luca-rhk commented Apr 2, 2021

Thank you both for your answer. Fortunately, the solution proposed by @gthbusrr worked like a charme. Keep up the good work.

@Styleflix
Copy link

Thanks for picking this up. I had/have the same issue. Also I dind't search properly and opened a new bug report Issue4648 - sorry. But I like to add that for me it only appeared when I used tags which wasn't mentioned here. Maybe that helps for solving it.

Nevertheless I am wondering what happens to all the id=0 entries. Actually I figured out how to delete the faulty transactions using the firefly UI too like @gthbusrr described.
But is there some further work to do in the database? I don't want it to be messed up and causing problems later on.

@JC5
Copy link
Member

JC5 commented Apr 11, 2021

The rest of the DB will be fine 👍

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Verified and replicated bugs and issues. fixed Bugs that are fixed (in a coming release).
Projects
None yet
Development

No branches or pull requests

4 participants