firefly-iii / firefly-iii

Firefly III: a personal finances manager
https://firefly-iii.org/
GNU Affero General Public License v3.0
16.38k stars 1.49k forks source link

Fatal Exception after import job #2856

Closed kaysond closed 4 years ago

kaysond commented 5 years ago

Bug description I am running Firefly III version 4.8.0.3, and my problem is:

After running an import, I get a fatal error, but the import seems to have run successfully.

Steps to reproduce Import a csv file

Extra info Debug information generated at 2019-11-23 20:23:05 America/Los_Angeles for Firefly III version 4.8.0.3.

Variable Content
FF version 4.8.0.3
FF API version 0.10.1
App environment local
App debug mode false
App cache driver file
App logging , daily
PHP version 7.2.24-0ubuntu0.18.04.1
Display errors Off
Session start 2019-11-01 00:00:00
Session end 2019-11-30 23:59:59
Session first 2017-02-04 00:00:00
Error reporting ALL errors
Host Linux
Interface fpm-fcgi
UserID 1
Attempt at "en" false
Attempt at "English" false
Attempt at "en_US.utf8" 'en_US.utf8'
Attempt at "en_US.UTF-8" 'en_US.UTF-8'
DB drivers mysql, sqlite
Current driver mysql
Login provider
Storage disks local-upload
Using Sandstorm? no
Is Sandstorm (.env) false
Is Docker (.env) false
bunq uses sandbox false
Trusted proxies (.env)
User agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0
Loaded extensions Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, sodium, session, standard, cgi-fcgi, mysqlnd, PDO, xml, bcmath, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, iconv, igbinary, imagick, intl, json, ldap, exif, mysqli, pdo_mysql, pdo_sqlite, Phar, posix, readline, redis, shmop, SimpleXML, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, Zend OPcache

Bonus points

[2019-11-23 20:08:15] local.DEBUG: RuleTrigger ToAccountIs for journal #2063: "paypal" is NOT "amex", return false.
[2019-11-23 20:08:15] local.DEBUG: Result of triggered() {"hitTriggers":1,"foundTriggers":3,"result":false}
[2019-11-23 20:08:15] local.DEBUG: Set status of job "O170vbmnNMEI" to "rules_applied"
[2019-11-23 20:08:15] local.DEBUG: In event RequestedReportOnJournals.
[2019-11-23 20:08:15] local.DEBUG: In reportJournals.
[2019-11-23 20:08:15] local.DEBUG: Trying to mail...
[2019-11-23 20:08:15] local.DEBUG: Going to try to decrypt users currency preference.
[2019-11-23 20:08:15] local.DEBUG: Could not decrypt "USD". The payload is invalid.
[2019-11-23 20:08:18] local.ERROR: Exception is: {"class":"Symfony\\Component\\Debug\\Exception\\FatalThrowableError","errorMessage":"Return value of FireflyIII\\Transformers\\TransactionGroupTransformer::getSourceTransaction() must be an instance of FireflyIII\\Models\\Transaction, null returned","time":"Sat, 23 Nov 2019 20:08:18 -0800","file":"\/var\/www\/firefly-iii\/app\/Transformers\/TransactionGroupTransformer.php","line":150,"code":0,"version":"4.8.0.3","url":"https:\/\/firefly.iamnub.com\/import\/job\/store\/O170vbmnNMEI","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko\/20100101 Firefox\/70.0","json":true}
[2019-11-23 20:08:18] local.ERROR: Return value of FireflyIII\Transformers\TransactionGroupTransformer::getSourceTransaction() must be an instance of FireflyIII\Models\Transaction, null returned {"userId":1,"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Return value of FireflyIII\\Transformers\\TransactionGroupTransformer::getSourceTransaction() must be an instance of FireflyIII\\Models\\Transaction, null returned at /var/www/firefly-iii/app/Transformers/TransactionGroupTransformer.php:150)
[stacktrace]
#0 /var/www/firefly-iii/app/Transformers/TransactionGroupTransformer.php(164): FireflyIII\\Transformers\\TransactionGroupTransformer->getSourceTransaction(Object(FireflyIII\\Models\\TransactionJournal))
#1 /var/www/firefly-iii/app/Transformers/TransactionGroupTransformer.php(110): FireflyIII\\Transformers\\TransactionGroupTransformer->transformJournals(Object(Illuminate\\Database\\Eloquent\\Collection))
#2 /var/www/firefly-iii/app/Mail/ReportNewJournalsMail.php(93): FireflyIII\\Transformers\\TransactionGroupTransformer->transformObject(Object(FireflyIII\\Models\\TransactionGroup))
#3 /var/www/firefly-iii/app/Mail/ReportNewJournalsMail.php(80): FireflyIII\\Mail\\ReportNewJournalsMail->transform()
#4 [internal function]: FireflyIII\\Mail\\ReportNewJournalsMail->build()
#5 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(32): call_user_func_array(Array, Array)
#6 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(90): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#7 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(34): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))
#8 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Container/Container.php(576): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)
#9 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(151): Illuminate\\Container\\Container->call(Array)
#10 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Support/Traits/Localizable.php(19): Illuminate\\Mail\\Mailable->Illuminate\\Mail\\{closure}()
#11 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(160): Illuminate\\Mail\\Mailable->withLocale(NULL, Object(Closure))
#12 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(275): Illuminate\\Mail\\Mailable->send(Object(Illuminate\\Mail\\Mailer))
#13 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(229): Illuminate\\Mail\\Mailer->sendMailable(Object(FireflyIII\\Mail\\ReportNewJournalsMail))
#14 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Mail/PendingMail.php(127): Illuminate\\Mail\\Mailer->send(Object(FireflyIII\\Mail\\ReportNewJournalsMail))
#15 /var/www/firefly-iii/app/Handlers/Events/AutomationHandler.php(61): Illuminate\\Mail\\PendingMail->send(Object(FireflyIII\\Mail\\ReportNewJournalsMail))
#16 [internal function]: FireflyIII\\Handlers\\Events\\AutomationHandler->reportJournals(Object(FireflyIII\\Events\\RequestedReportOnJournals))
#17 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(366): call_user_func_array(Array, Array)
#18 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(196): Illuminate\\Events\\Dispatcher->Illuminate\\Events\\{closure}('FireflyIII\\\\Even...', Array)
#19 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(482): Illuminate\\Events\\Dispatcher->dispatch('FireflyIII\\\\Even...')
#20 /var/www/firefly-iii/app/Import/Storage/ImportArrayStorage.php(183): event(Object(FireflyIII\\Events\\RequestedReportOnJournals))
#21 /var/www/firefly-iii/app/Support/Http/Controllers/CreateStuff.php(214): FireflyIII\\Import\\Storage\\ImportArrayStorage->store()
#22 /var/www/firefly-iii/app/Http/Controllers/Import/JobStatusController.php(217): FireflyIII\\Http\\Controllers\\Import\\JobStatusController->storeTransactions(Object(FireflyIII\\Models\\ImportJob))
#23 [internal function]: FireflyIII\\Http\\Controllers\\Import\\JobStatusController->store(Object(FireflyIII\\Models\\ImportJob))
#24 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array)
#25 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction('store', Array)
#26 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Routing/Route.php(219): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(FireflyIII\\Http\\Controllers\\Import\\JobStatusController), 'store')
#27 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Routing/Route.php(176): Illuminate\\Routing\\Route->runController()
#28 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Routing/Router.php(680): Illuminate\\Routing\\Route->run()
#29 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#30 /var/www/firefly-iii/app/Http/Controllers/Import/JobStatusController.php(59): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
JC5 commented 5 years ago

"Import a csv" is a bit broad of a description. Could you try to find out which lines are causing this, and send me those lines + your import configuration over email?

BobWs commented 5 years ago

Looks the same as my problem facing a few weeks a go #2792 After that I stopped using Firefly for now...

JC5 commented 5 years ago

That explains why you haven't sent me any log files.

kaysond commented 5 years ago

I got a different error message on the page. Something about internal server error.

@JC5 As far as I can tell, all of the transactions imported successfully and all of my rules got applied, so I'm not sure its a specific line in the csv. I nuked my DB so I can try reimporting, and I'll double check the dates this time.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.