IRC logs for #farmOS, 2019-05-25 (GMT)

2019-05-24
2019-05-26
TimeNickMessage
[22:45:52]* JustTB has quit (Ping timeout: 252 seconds)
[23:01:01]* JustTB has joined #farmos
[03:25:55]* JustTB has quit (Quit: Leaving.)
[04:18:11]* skipper_is[m] has joined #farmos
[04:25:25]<skipper_is[m]>ACTION uploaded an image: FarmOSError.png (20KB) < https://matrix.org/_matrix/media/v1/download/matrix.org/zCFUiSyAUVXkPArO... >
[04:25:26]<skipper_is[m]>Hello all, I've just installed FarmOS on my server. I tried it yesterday, and as soon as I add any assets/fields etc in it says "The website encountered an unexpected error. Please try again later". Based off of one of the issue logs on GitHub, I tried a downgrade from php7.2 to 7.1, and I'm still getting the error. The actual issue log is this:
[04:31:31]<skipper_is[m]>ACTION sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/wetJuaXYnXaHVRlk... >
[04:32:16]<skipper_is[m]>ACTION sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/VcYDBzFFqBXiYInc... >
[04:34:11]<skipper_is[m]>(Not getting the hang of the posting window here.... ) So, I removed the field I had digitized, and the home page then worked fine, but with no records of any sort. I tried then to add an asset (100 ewes, in a group called ewes), which threw a different error:
[04:34:12]<skipper_is[m]>PDOException: SQLSTATE[42803]: Grouping error: 7 ERROR: column "ss_log.timestamp" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: SELECT ss_log.timestamp AS ss_logtimestamp, ss_log.id AS ss_... ^: SELECT ss_log.timestamp AS ss_logtimestamp, ss_log.id AS ss_logid, SUM(ss_fdffiv.field_farm_inventory_value_numerator / ss_fdffiv.field_farm_inventory_value_denominator) AS inventory FROM {log}
[04:34:13]<skipper_is[m]>ss_log INNER JOIN {field_data_field_farm_inventory} ss_fdffi ON ss_fdffi.entity_type = 'log' AND ss_fdffi.entity_id = ss_log.id AND ss_fdffi.deleted = 0 INNER JOIN {field_data_field_farm_inventory_asset} ss_fdffia ON ss_fdffia.entity_id = ss_fdffi.field_farm_inventory_value AND ss_fdffia.deleted = 0 INNER JOIN {field_data_field_farm_inventory_value} ss_fdffiv ON ss_fdffiv.entity_id = ss_fdffi.field_farm_inventory_value
[04:34:13]<skipper_is[m]>AND ss_fdffiv.deleted = 0 WHERE (ss_log.timestamp <= 1558772937) AND (ss_log.done = 1) AND (ss_fdffia.field_farm_inventory_asset_target_id = 1) ORDER BY ss_log.timestamp DESC, ss_log.id DESC LIMIT 1 OFFSET 0; Array ( ) in farm_inventory() (line 417 of /var/www/html/farmOS/profiles/farm/modules/farm/farm_inventory/farm_inventory.module).
[04:36:25]<skipper_is[m]>FarmOS version is 7.x-1.1, php version is 7.1.29, DB is Postgresql 10.8
[05:13:56]* JustTB has joined #farmos
[05:23:48]<skipper_is[m]>With the field side of things: I've partially made some progress... Though I think I might be just treating symptoms rather than the underlying cause.
[05:24:34]<skipper_is[m]>"Error: Unsupported operand types in farm_area_convert_area_units() (line 600 of /var/www/html/farmOS/profiles/farm/modules/farm/farm_area/farm_area.module)."
[05:24:35]<skipper_is[m]>Seemed to be fixed by changing "$output = $input * $conversion;"
[05:24:52]<skipper_is[m]>On line 600
[05:25:04]<skipper_is[m]>But that brought another error along for the ride:
[05:26:24]<skipper_is[m]>Warning: A non-numeric value encountered in farm_area_calculate_area_multiple() (line 475 of /var/www/html/farmOS/profiles/farm/modules/farm/farm_area/farm_area.module).
[05:26:24]<skipper_is[m]>Which seemed to be fixed by changing "$total_area = '';" to "$total_area = 0;" on Line 468, casting total area to a numeric value, so when the addition operand is called on 475, it isn't trying to add the area to a string... I think..
[06:20:08]<mstenta[m]>Hi @skipper_is
[06:20:17]<mstenta[m]>I'm on the road today
[06:20:33]<mstenta[m]>But I have hunches about what's causing your issues...
[06:20:51]<mstenta[m]>First, farmOS is only somewhat tested on PostgreSQL
[06:21:25]<mstenta[m]>We have been fixing minor bugs here and there as people experiment with it
[06:21:46]<mstenta[m]>I have always used MariaDB myself
[06:22:14]<mstenta[m]>However, I do want to support PGSQL, so it's good to find and fix the issues
[06:22:40]<mstenta[m]>Generally they have been small and easy to fix
[06:23:31]<mstenta[m]>Second, I wonder if you have BCMath PHP extension installed and enabled?
[06:24:05]<mstenta[m]>The "non numeric" error could be related to that
[06:24:20]<mstenta[m]>Or it could be related to PHP version
[06:27:50]<mstenta[m]>Thanks for creating the GitHub issue! Let's focus our attention there... Easy to get lost on Twitter and chat, and The GitHub issue will be easier to link to for others when we solve it
[06:28:22]<mstenta[m]>I'm traveling at the moment so just replying from my phone. It will be easier when I'm back at my computer
[06:29:10]<mstenta[m]>Talk to you later. Thanks for reporting the bugs!
[08:19:03]<skipper_is[m]>No worries, I've added bcmath now as well, though now I've cast the variable to numeric, it doesn't show up as a bug to test!
[08:20:12]<skipper_is[m]>I'll roll it back and try with bcmath
[08:20:13]<mstenta[m]>I've always tested with BCMath, but I'd like it to work without it too
[08:20:20]<mstenta[m]>Ok thanks!
[08:20:42]<mstenta[m]>That will be good to know
[08:21:01]<skipper_is[m]>Yea, seems to work without my patch with BCMath installed
[08:21:19]<mstenta[m]>Oh wonderful! That must be it then!
[08:21:28]<mstenta[m]>Great. Should be easy to fix then
[08:21:44]<mstenta[m]>Can you document that in the issue so I remember? :-)
[08:21:50]<skipper_is[m]>Of course
[08:22:01]<mstenta[m]>Thanks @skipper_is !!
[08:25:49]<skipper_is[m]>Once I've figured out how all this works, I've got another little project that I might try and integrate, a hand-held bluetooth EID reader for ear tags (probably works on other RFID tags... I've only tried it on sheep EIDs)
[08:28:25]<skipper_is[m]>At the moment it is just a phone app and little prototype scanner, but it is probably possible to hook into FarmOS API
[08:31:52]<mstenta[m]>Oh awesome!
[08:31:55]<mstenta[m]>I've talked with a few folks about that idea! Seems like there is a lot of interest!
[08:32:02]<mstenta[m]>Would be great to see what you come up with!
[08:32:39]<mstenta[m]>Also have you seen the farmOS Android app?
[08:32:51]<mstenta[m]>Could be interesting to integrate with that
[08:43:15]<skipper_is[m]>Yea, I saw it, but haven't yet had a proper look
[09:18:58]<skipper_is[m]>ACTION sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/IhAhfGlJFwDrCaqQ... >
[09:20:02]<mstenta[m]>That appears to be an inventory query
[09:20:18]<mstenta[m]>What context does the error occur in?
[09:20:28]<mstenta[m]>Viewing an asset with an inventory?
[09:28:33]<skipper_is[m]>Creating a new animal asset. In this case it was a flock of 100 ewes. So I entered the name "Ewes", Species is "Aberfield Ewes", and it said that for multiple animals, use the inventory field, so I entered 100 in there, pressed save and "Error"
[09:28:50]<skipper_is[m]>I also tried it with a single animal, a ram in this case, with just the name and the species
[09:29:14]<skipper_is[m]>And got the same error
[09:30:12]<mstenta[m]>Ok thanks is there a GitHub issue for this one?
[09:39:43]<skipper_is[m]>Done. I ran the same query in PostGresql, on it's own, and it returned the same error
[09:58:00]<mstenta[m]>Great thanks!!
[10:10:00]<skipper_is[m]>From what it says, does SUM require a Group By?
[10:48:37]<skipper_is[m]>I've created another install of FarmOS, same server, but using mySQL instead of Postgresql, just to see whether the bugs are me installing it wrong, or actual bugs. So far, the SQL bug is appearing to be a bug, not me installing it wrong!
[10:49:43]<mstenta[m]>Oh interesting! So it's not a PostgreSQL-only issue?
[10:50:11]<mstenta[m]>Huh. Wonder why it is just coming up now. Maybe something changed recently...
[10:50:12]<skipper_is[m]>Sorry, I should've clarified, yea, it is a bug, and it appears to be related to PostgreSQL
[10:50:30]<mstenta[m]>Oohh ok
[10:50:30]<skipper_is[m]>MySQL is running fine, no issues at all yet
[10:50:30]<mstenta[m]>Gotcha
[10:50:58]<mstenta[m]>Cool. Should be easy to fix. It's been kinda fun learning the little differences with PostgreSQL
[10:51:15]<mstenta[m]>Overall I've learned that PostgreSQL is just more strict. Which is a good thing :+)
[10:51:19]<mstenta[m]>:-)
[10:52:04]<skipper_is[m]>Yea, though aren't most of the queries abstracted away by Drupal? And if they're supporting PostgreSQL, is that then a bug on their end?
[10:52:22]<mstenta[m]>I am actually considering using PostgreSQL as the default in the Drupal 8 version of farmOS
[10:52:49]<mstenta[m]>Yea that is true, but we do some extra stuff in farmOS in certain cases
[10:54:51]<mstenta[m]>Although I have patched Drupal core to fix one issue: https://github.com/farmOS/farmOS/blob/7.x-1.x/drupal-org-core.make#L14
[10:54:59]<mstenta[m]>So yea... A mix
[10:56:34]<mstenta[m]>Drupal "supports" PostgreSQL, but the huge majority of users still use MySQL/MariaDB, so PostgreSQL bugs don't always get fixed as quickly
[10:56:48]<mstenta[m]>(my understanding)
[19:38:11]* JustTB has quit (Quit: Leaving.)
[19:40:56]* JustTB has joined #farmos