firefly-iii / firefly-iii

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

Parameter must be an array or an object that implements Countable #1053

Closed bradc87 closed 6 years ago

bradc87 commented 6 years ago

I am running Firefly III version 4.6.11

Parameter must be an array or an object that implements Countable

this happens when trying to import csv

Other important details (log files, system info):

Please visit the /debug page to get extra debug information.

JC5 commented 6 years ago

Hi! Thanks for reporting this problem. I need some more information to debug this.

Could you describe during which step of the import routine the error occurred?

Could you go to storage/logs and open the latest log file? It should be called something like "ff3-fpm-fcgi-*.log". In it, you should be able to find the error along with its "stacktrace": this will tell me where Firefly III broke down.

Does the error occur even when you import just one line of your CSV file? If so, would you be willing to share that particular line, and your configuration file with me?

This would greatly help me figure out what went wrong. Thanks!

bradc87 commented 6 years ago

This happens when I importa a csv, just after the first dconfigurration page, when I click the button that says "step 2/3"

Then it just gives me a full screen "we'll be right back" message

ig" at line 56. {"userId":1,"email":"brad87@gmail.com","exception":"[object] (Twig_Error_Runtime(code: 0): An exception has been thrown during the rendering of a template (\"count(): Parameter must be an array or an object that implements Countable\") in \"/srv/http/firefly-iii/resources/views/import/csv/roles.twig\" at line 56. at /srv/http/firefly-iii/vendor/twig/twig/lib/Twig/Template.php:230, ErrorException(code: 0): count(): Parameter must be an array or an object that implements Countable at /srv/http/firefly-iii/vendor/twig/twig/lib/Twig/Extension/Core.php:1203)"} [2017-12-17 16:45:31] local.ERROR: An exception has been thrown during the rendering of a template ("count(): Parameter must be an array or an object that implements Countable") in "/srv/http/firefly-iii/resources/views/import/csv/roles.twig" at line 56. {"userId":1,"email":"brad87@gmail.com","exception":"[object] (Twig_Error_Runtime(code: 0): An exception has been thrown during the rendering of a template (\"count(): Parameter must be an array or an object that implements Countable\") in \"/srv/http/firefly-iii/resources/views/import/csv/roles.twig\" at line 56. at /srv/http/firefly-iii/vendor/twig/twig/lib/Twig/Template.php:230, ErrorException(code: 0): count(): Parameter must be an array or an object that implements Countable at /srv/http/firefly-iii/vendor/twig/twig/lib/Twig/Extension/Core.php:1203)"} [2017-12-17 16:45:32] local.ERROR: An exception has been thrown during the rendering of a template ("count(): Parameter must be an array or an object that implements Countable") in "/srv/http/firefly-iii/resources/views/import/csv/roles.twig" at line 56. {"userId":1,"email":"brad87@gmail.com","exception":"[object] (Twig_Error_Runtime(code: 0): An exception has been thrown during the rendering of a template (\"count(): Parameter must be an array or an object that implements Countable\") in \"/srv/http/firefly-iii/resources/views/import/csv/roles.twig\" at line 56. at /srv/http/firefly-iii/vendor/twig/twig/lib/Twig/Template.php:230, ErrorException(code: 0): count(): Parameter must be an array or an object that implements Countable at /srv/http/firefly-iii/vendor/twig/twig/lib/Twig/Extension/Core.php:1203)"} [2017-12-17 16:45:33] local.ERROR: An exception has been thrown during the rendering of a template ("count(): Parameter must be an array or an object that implements Countable") in "/srv/http/firefly-iii/resources/views/import/csv/roles.twig" at line 56. {"userId":1,"email":"brad87@gmail.com","exception":"[object] (Twig_Error_Runtime(code: 0): An exception has been thrown during the rendering of a template (\"count(): Parameter must be an array or an object that implements Countable\") in \"/srv/http/firefly-iii/resources/views/import/csv/roles.twig\" at line 56. at /srv/http/firefly-iii/vendor/twig/twig/lib/Twig/Template.php:230, ErrorException(code: 0): count(): Parameter must be an array or an object that implements Countable at /srv/http/firefly-iii/vendor/twig/twig/lib/Twig/Extension/Core.php:1203)"} [2017-12-17 16:47:03] local.ERROR: An exception has been thrown during the rendering of a template ("count(): Parameter must be an array or an object that implements Countable") in "/srv/http/firefly-iii/resources/views/import/csv/roles.twig" at line 56. {"userId":1,"email":"brad87@gmail.com","exception":"[object] (Twig_Error_Runtime(code: 0): An exception has been thrown during the rendering of a template (\"count(): Parameter must be an array or an object that implements Countable\") in \"/srv/http/firefly-iii/resources/views/import/csv/roles.twig\" at line 56. at /srv/http/firefly-iii/vendor/twig/twig/lib/Twig/Template.php:230, ErrorException(code: 0): count(): Parameter must be an array or an object that implements Countable at /srv/http/firefly-iii/vendor/twig/twig/lib/Twig/Extension/Core.php:1203)"} [2017-12-17 16:48:06] local.ERROR: An exception has been thrown during the rendering of a template ("count(): Parameter must be an array or an object that implements Countable") in "/srv/http/firefly-iii/resources/views/import/csv/roles.twig" at line 56. {"userId":1,"email":"brad87@gmail.com","exception":"[object] (Twig_Error_Runtime(code: 0): An exception has been thrown during the rendering of a template (\"count(): Parameter must be an array or an object that implements Countable\") in \"/srv/http/firefly-iii/resources/views/import/csv/roles.twig\" at line 56. at /srv/http/firefly-iii/vendor/twig/twig/lib/Twig/Template.php:230, ErrorException(code: 0): count(): Parameter must be an array or an object that implements Countable at /srv/http/firefly-iii/vendor/twig/twig/lib/Twig/Extension/Core.php:1203)"} [2017-12-17 16:50:06] local.ERROR: An exception has been thrown during the rendering of a template ("count(): Parameter must be an array or an object that implements Countable") in "/srv/http/firefly-iii/resources/views/import/csv/roles.twig" at line 56. {"userId":1,"email":"brad87@gmail.com","exception":"[object] (Twig_Error_Runtime(code: 0): An exception has been thrown during the rendering of a template (\"count(): Parameter must be an array or an object that implements Countable\") in \"/srv/http/firefly-iii/resources/views/import/csv/roles.twig\" at line 56. at /srv/http/firefly-iii/vendor/twig/twig/lib/Twig/Template.php:230, ErrorException(code: 0): count(): Parameter must be an array or an object that implements Countable at /srv/http/firefly-iii/vendor/twig/twig/lib/Twig/Extension/Core.php:1203)"}

JC5 commented 6 years ago

That's a very strange error. How did you configure your columns?

bradc87 commented 6 years ago

The only thing that I changed from default values was the date string m/d/Y

JC5 commented 6 years ago

Could you share one or two lines of your CSV file with me?

bradc87 commented 6 years ago

11/20/2017,CANADA CCB,,153.46,8430.95 11/20/2017,TD ATM W/D 001266,440.00,,7990.95 11/20/2017,LOBLAWS RCSS #1 ,25.24,,7965.71 11/21/2017,SSV TO: 32036389945,7.00,,7958.71 11/22/2017,PAYPAL MSP,15.93,,7942.78 11/23/2017,WSIB PAY,,1818.63,9761.41 11/24/2017,LN PYMT *150525101,115.34,,9646.07 11/24/2017,PC MASTRCRD A2J8X6 ,250.00,,9396.07 11/24/2017,SCOTIA VISA A2J8X7 ,130.00,,9266.07 11/24/2017,GC 3203-CASH WITHDRA,15.00,,9251.07

JC5 commented 6 years ago

OK, I've been able to import your data into a newer version of Firefly. That means either the issue is now fixed, or maybe something went wrong configuring the columns.

Here's what I did, and the result.

screen shot 2017-12-19 at 18 56 37

screen shot 2017-12-19 at 18 57 06

bradc87 commented 6 years ago

Seems to have something to do with file size

try my full file

On Tue, Dec 19, 2017 at 12:58 PM, James Cole notifications@github.com wrote:

OK, I've been able to import your data into a newer version of Firefly. That means either the issue is now fixed, or maybe something went wrong configuring the columns.

Here's what I did, and the result.

[image: screen shot 2017-12-19 at 18 56 37] https://user-images.githubusercontent.com/5889984/34171407-86d1c58e-e4ee-11e7-910c-4f091d543b2f.png

[image: screen shot 2017-12-19 at 18 57 06] https://user-images.githubusercontent.com/5889984/34171412-8bc1d0f2-e4ee-11e7-97fb-8054e7ba0647.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/firefly-iii/firefly-iii/issues/1053#issuecomment-352837299, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ-PEP8z-KNJPJXx43_AQOxHNYKOK3q6ks5tB_k0gaJpZM4REuB7 .

JC5 commented 6 years ago

I shall, could you send it to me over mail?

bradc87 commented 6 years ago

email addy?

On Tue, Dec 19, 2017 at 3:12 PM, James Cole notifications@github.com wrote:

I shall, could you send it to me over mail?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/firefly-iii/firefly-iii/issues/1053#issuecomment-352873094, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ-PEAjVjxHuEcHHW699qFxc1kVHdk7Kks5tCBi2gaJpZM4REuB7 .

JC5 commented 6 years ago

There's nothing there, I think Github strips them. You can send them to me personally at thegrumpydictator@gmail.com.

Findus23 commented 6 years ago

Just a quick note: Parameter must be an array or an object that implements Countable happens normally because of a change in PHP 7.2.

JC5 commented 6 years ago

I wasn’t aware, thanks. @bradc87, are you running PHP7.1?

JC5 commented 6 years ago

Errr, 7.2?

Findus23 commented 6 years ago

BTW: I'm running firefly with 7.2 without issues for few weeks now (But I haven't tried importing anything)

bradc87 commented 6 years ago

yes running 7.2

On Fri, Dec 22, 2017 at 5:05 AM, James Cole notifications@github.com wrote:

Errr, 7.2?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/firefly-iii/firefly-iii/issues/1053#issuecomment-353565678, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ-PEFEZIVhhmFVKCvVGjJ_XDMSAzrTUks5tC37ggaJpZM4REuB7 .

JC5 commented 6 years ago

Thanks for sending me the file. It works on my server when I use both PHP7.1 and PHP7.2.

What did you set the columns to?

JC5 commented 6 years ago

Release is live, issue will be closed.