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

Exception when importing CSV in 4.6.4 #760

Closed
leander091 opened this issue Aug 13, 2017 · 11 comments
Closed

Exception when importing CSV in 4.6.4 #760

leander091 opened this issue Aug 13, 2017 · 11 comments
Assignees
Labels
bug Verified and replicated bugs and issues. fixed Bugs that are fixed (in a coming release).

Comments

@leander091
Copy link
Contributor

[2017-08-13 09:27:45] production.ERROR: ErrorException: Trying to get property of non-object in /var/www/finance/app/Import/Storage/ImportSupport.php:359 Stack trace: #0 /var/www/finance/app/Import/Storage/ImportSupport.php(359): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Trying to get p...', '/var/www/financ...', 359, Array) #1 /var/www/finance/app/Import/Storage/ImportStorage.php(162): FireflyIII\Import\Storage\ImportStorage->storeJournal(Array) #2 /var/www/finance/app/Import/Storage/ImportStorage.php(97): FireflyIII\Import\Storage\ImportStorage->storeImportJournal(0, Object(FireflyIII\Import\Object\ImportJournal)) #3 /var/www/finance/vendor/laravel/framework/src/Illuminate/Support/Collection.php(288): FireflyIII\Import\Storage\ImportStorage->FireflyIII\Import\Storage\{closure}(Object(FireflyIII\Import\Object\ImportJournal), 0) #4 /var/www/finance/app/Import/Storage/ImportStorage.php(102): Illuminate\Support\Collection->each(Object(Closure)) #5 /var/www/finance/app/Import/Routine/ImportRoutine.php(171): FireflyIII\Import\Storage\ImportStorage->store() #6 /var/www/finance/app/Import/Routine/ImportRoutine.php(66): FireflyIII\Import\Routine\ImportRoutine->storeObjects(Object(Illuminate\Support\Collection)) #7 /var/www/finance/app/Console/Commands/Import.php(81): FireflyIII\Import\Routine\ImportRoutine->run() #8 [internal function]: FireflyIII\Console\Commands\Import->handle() #9 /var/www/finance/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array) #10 /var/www/finance/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() #11 /var/www/finance/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure)) #12 /var/www/finance/vendor/laravel/framework/src/Illuminate/Container/Container.php(539): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL) #13 /var/www/finance/vendor/laravel/framework/src/Illuminate/Console/Command.php(182): Illuminate\Container\Container->call(Array) #14 /var/www/finance/vendor/symfony/console/Command/Command.php(264): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) #15 /var/www/finance/vendor/laravel/framework/src/Illuminate/Console/Command.php(167): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) #16 /var/www/finance/vendor/symfony/console/Application.php(874): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #17 /var/www/finance/vendor/symfony/console/Application.php(228): Symfony\Component\Console\Application->doRunCommand(Object(FireflyIII\Console\Commands\Import), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #18 /var/www/finance/vendor/symfony/console/Application.php(130): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #19 /var/www/finance/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #20 /var/www/finance/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #21 {main} [] []

@JC5
Copy link
Member

JC5 commented Aug 13, 2017

Damn, I thought I had covered all the edge cases. I'll get right on it.

For a fix, I'm not going to push a release again, I would suggest you manually replace the file until the next release. Is that OK?

JC5 added a commit that referenced this issue Aug 13, 2017
@JC5
Copy link
Member

JC5 commented Aug 13, 2017

I've updated three files, which together should catch this (or at least log it). Could you update your local files to see if this works?

@leander091
Copy link
Contributor Author

leander091 commented Aug 13, 2017

Sure, I'm testing this right now

EDIT: The error is gone, but the amounts are not registered. I see error messages like below in the console.
Error importing line #382: Amount is zero. Error importing line #383: Amount is zero.

The expense accounts and revenue accounts are also not created.

JC5 added a commit that referenced this issue Aug 13, 2017
@JC5
Copy link
Member

JC5 commented Aug 13, 2017

I think I've found something but I'm not sure if it will help. I can't be sure why the amount is registered as zero. What's the content of the "amount" field for those lines?

@leander091
Copy link
Contributor Author

leander091 commented Aug 13, 2017

The amount at line 382 is 6,95 and the amount of line 383 is 3,50.

@sprucify
Copy link

sprucify commented Aug 14, 2017

I got the same error.

`docker-compose exec firefly-app php artisan firefly:start-import sIvcXSSHXz5e
Going to import job with key "sIvcXSSHXz5e" of type "csv"
[2017-08-14 09:54:01] production.ERROR: Exception is: {"class":"ErrorException","errorMessage":"Trying to get property of non-object","time":"Mon, 14 Aug 2017 09:54:01 +0000","file":"/var/www/firefly-iii/app/Import/Storage/ImportSupport.php","line":359,"code":0,"version":"4.6.4"} [] []
[2017-08-14 09:54:01] production.ERROR: ErrorException: Trying to get property of non-object in /var/www/firefly-iii/app/Import/Storage/ImportSupport.php:359 Stack trace: #0 /var/www/firefly-iii/app/Import/Storage/ImportSupport.php(359): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Trying to get p...', '/var/www/firefl...', 359, Array) #1 /var/www/firefly-iii/app/Import/Storage/ImportStorage.php(162): FireflyIII\Import\Storage\ImportStorage->storeJournal(Array) #2 /var/www/firefly-iii/app/Import/Storage/ImportStorage.php(97): FireflyIII\Import\Storage\ImportStorage->storeImportJournal(0, Object(FireflyIII\Import\Object\ImportJournal)) #3 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Support/Collection.php(288): FireflyIII\Import\Storage\ImportStorage->FireflyIII\Import\Storage{closure}(Object(FireflyIII\Import\Object\ImportJournal), 0) #4 /var/www/firefly-iii/app/Import/Storage/ImportStorage.php(102): Illuminate\Support\Collection->each(Object(Closure)) #5 /var/www/firefly-iii/app/Import/Routine/ImportRoutine.php(171): FireflyIII\Import\Storage\ImportStorage->store() #6 /var/www/firefly-iii/app/Import/Routine/ImportRoutine.php(66): FireflyIII\Import\Routine\ImportRoutine->storeObjects(Object(Illuminate\Support\Collection)) #7 /var/www/firefly-iii/app/Console/Commands/Import.php(81): FireflyIII\Import\Routine\ImportRoutine->run() #8 [internal function]: FireflyIII\Console\Commands\Import->handle() #9 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array) #10 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container{closure}() #11 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure)) #12 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Container/Container.php(539): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL) #13 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Console/Command.php(182): Illuminate\Container\Container->call(Array) #14 /var/www/firefly-iii/vendor/symfony/console/Command/Command.php(264): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) #15 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Console/Command.php(167): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) #16 /var/www/firefly-iii/vendor/symfony/console/Application.php(874): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #17 /var/www/firefly-iii/vendor/symfony/console/Application.php(228): Symfony\Component\Console\Application->doRunCommand(Object(FireflyIII\Console\Commands\Import), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #18 /var/www/firefly-iii/vendor/symfony/console/Application.php(130): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #19 /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #20 /var/www/firefly-iii/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #21 {main} [] []

[ErrorException]
Trying to get property of non-object`

@sprucify
Copy link

develop branch is going fine, but had two Detected a possible duplicate, skip this one. rows

@JC5
Copy link
Member

JC5 commented Aug 15, 2017

Could you both send the the following things (over encrypted mail if you prefer):

  • A CSV file with the offending rows. You may censor if you want, but leave as much as you dare intact. The amounts should not be touched, and use a text-editor to change your file, do not use Excel / Numbers.
  • The import configuration you have used.

That will allow me to debug this. The duplicate may not be fixed with this but the amount thing certainly.

@JC5 JC5 self-assigned this Aug 15, 2017
@JC5 JC5 added bug Verified and replicated bugs and issues. waiting-for-user labels Aug 15, 2017
@leander091
Copy link
Contributor Author

leander091 commented Aug 15, 2017

I have sent the mail. I also have reduced the amount of transactions to a day, to check if the bug will be triggered. As you can see this is indeed the case.

@JC5 JC5 added fixed Bugs that are fixed (in a coming release). and removed waiting-for-user labels Aug 15, 2017
@JC5
Copy link
Member

JC5 commented Aug 16, 2017

It seems the bug has been fixed so I've labeled it as such. Next release should include this. Thanks @leander091 and @sprucify for helping me debug this 👍

@sprucify
Copy link

Thanks @JC5 . The duplicates in my case where legit (same amount, same day)

@lock lock bot locked as resolved and limited conversation to collaborators Jan 24, 2020
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

3 participants