firefly-iii / firefly-iii

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

CategoryController bug for Categories chart in Dashboard and Categories section #2796

Closed Syakyr closed 5 years ago

Syakyr commented 5 years ago

Bug description I am running Firefly III version 4.8.2-alpha.1, and my problem is:

The Category chart in the Dashboard section as well as charts in the Category section are unable to be generated.

Steps to reproduce

  1. Go to Dashboard, see the Categories chart.

Extra info Debug information generated at 2019-11-06 07:39:23 Asia/Singapore for Firefly III version 4.8.2-alpha.1.

Variable Content
FF version 4.8.2-alpha.1
FF API version 0.10.5
App environment local
App debug mode false
App cache driver file
App logging , daily
PHP version 7.3.11-1+ubuntu18.04.1+deb.sury.org+1
Display errors Off
Session start 2019-10-01 00:00:00
Session end 2019-12-31 00:00:00
Session first 2018-01-01 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, pgsql, sqlite
Current driver sqlite
Login provider
Storage disks local-upload
Using Sandstorm? no
Is Sandstorm (.env) false
bunq uses sandbox false
Trusted proxies (.env)
User agent Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36
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, imagick, imap, intl, json, ldap, exif, mysqli, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, readline, shmop, SimpleXML, soap, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlrpc, xmlwriter, xsl, zip, Zend OPcache

Bonus points This is a bug similar to #2783. I have written a fix similar to bed182c , sending PR soon.

Syakyr commented 5 years ago

Seems that the categories chart for each category in the Categories section is handled by another script called WholePeriodChartGenerator.php. Releasing fix soon.

Edit: fixed released at 677a0ed7301f1da29f48bd5da3427951fd963412.

JC5 commented 5 years ago

Thanks for the suggestion and the added PR. Since this is SQLite, I'll look for the root cause rather than include your PR for the moment. My own SQLite database does not suffer from this issue and I'm not yet sure why not.

Syakyr commented 5 years ago

I initialised the database on either 4.6 or 4.8.1. I hope that info may help if you had changed any sqlite generation between those versions (or artisan had initialised sqlite differently between them).

Syakyr commented 5 years ago

Another piece of info I just remembered: the graph looks alright at first after reverted back from the fix to master (to clean up the fix and pushed it to another branch), but after adding a dummy transaction entry, it gives back the 500 error again. It persists after removing the transaction. Hope this helps.

JC5 commented 5 years ago

I pushed a fix that will hopefully fix this at the root of the problem: where the data is collected from the database. It will be available in the next (alpha) release of Firefly III.