< 242019-05-25⋎26 >

farmOS (farmos.org) is a free and open source, web-based farm management system. User guide: farmos.org/guide/ - Feature requests and bug reports: github.com/farmOS/farmOS/issuesSet by ChanServ on 2018-08-16 at 14:32
02:45*JustTB has quit (Ping timeout: 252 seconds)
03:01*JustTB has joined
07:25*JustTB has quit (Quit: Leaving.)
08:18*skipper_is[m] has joined
08:25*uploaded an image: FarmOSError.png (20KB) < matrix.org/_matrix/media/v1/download/mat >
08:25skipper_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:
08:31*sent a long message: < matrix.org/_matrix/media/v1/download/mat >
08:32*sent a long message: < matrix.org/_matrix/media/v1/download/mat >
08:34skipper_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:
08:34skipper_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}
08:34skipper_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
08:34skipper_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).
08:36skipper_is[m]FarmOS version is 7.x-1.1, php version is 7.1.29, DB is Postgresql 10.8
09:13*JustTB has joined
09:23skipper_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.
09:24skipper_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)."
09:24skipper_is[m]Seemed to be fixed by changing "$output = $input * $conversion;"
09:24skipper_is[m]On line 600
09:25skipper_is[m]But that brought another error along for the ride:
09:26skipper_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).
09:26skipper_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..
10:20mstenta[m]Hi @skipper_is
10:20mstenta[m]I'm on the road today
10:20mstenta[m]But I have hunches about what's causing your issues...
10:20mstenta[m]First, farmOS is only somewhat tested on PostgreSQL
10:21mstenta[m]We have been fixing minor bugs here and there as people experiment with it
10:21mstenta[m]I have always used MariaDB myself
10:22mstenta[m]However, I do want to support PGSQL, so it's good to find and fix the issues
10:22mstenta[m]Generally they have been small and easy to fix
10:23mstenta[m]Second, I wonder if you have BCMath PHP extension installed and enabled?
10:24mstenta[m]The "non numeric" error could be related to that
10:24mstenta[m]Or it could be related to PHP version
10:27mstenta[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
10:28mstenta[m]I'm traveling at the moment so just replying from my phone. It will be easier when I'm back at my computer
10:29mstenta[m]Talk to you later. Thanks for reporting the bugs!
12:19skipper_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!
12:20skipper_is[m]I'll roll it back and try with bcmath
12:20mstenta[m]I've always tested with BCMath, but I'd like it to work without it too
12:20mstenta[m]Ok thanks!
12:20mstenta[m]That will be good to know
12:21skipper_is[m]Yea, seems to work without my patch with BCMath installed
12:21mstenta[m]Oh wonderful! That must be it then!
12:21mstenta[m]Great. Should be easy to fix then
12:21mstenta[m]Can you document that in the issue so I remember? :-)
12:21skipper_is[m]Of course
12:22mstenta[m]Thanks @skipper_is !!
12:25skipper_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)
12:28skipper_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
12:31mstenta[m]Oh awesome!
12:31mstenta[m]I've talked with a few folks about that idea! Seems like there is a lot of interest!
12:32mstenta[m]Would be great to see what you come up with!
12:32mstenta[m]Also have you seen the farmOS Android app?
12:32mstenta[m]Could be interesting to integrate with that
12:43skipper_is[m]Yea, I saw it, but haven't yet had a proper look
13:18*sent a long message: < matrix.org/_matrix/media/v1/download/mat >
13:20mstenta[m]That appears to be an inventory query
13:20mstenta[m]What context does the error occur in?
13:20mstenta[m]Viewing an asset with an inventory?
13:28skipper_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"
13:28skipper_is[m]I also tried it with a single animal, a ram in this case, with just the name and the species
13:29skipper_is[m]And got the same error
13:30mstenta[m]Ok thanks is there a GitHub issue for this one?
13:39skipper_is[m]Done. I ran the same query in PostGresql, on it's own, and it returned the same error
13:58mstenta[m]Great thanks!!
14:10skipper_is[m]From what it says, does SUM require a Group By?
14:48skipper_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!
14:49mstenta[m]Oh interesting! So it's not a PostgreSQL-only issue?
14:50mstenta[m]Huh. Wonder why it is just coming up now. Maybe something changed recently...
14:50skipper_is[m]Sorry, I should've clarified, yea, it is a bug, and it appears to be related to PostgreSQL
14:50mstenta[m]Oohh ok
14:50skipper_is[m]MySQL is running fine, no issues at all yet
14:50mstenta[m]Gotcha
14:50mstenta[m]Cool. Should be easy to fix. It's been kinda fun learning the little differences with PostgreSQL
14:51mstenta[m]Overall I've learned that PostgreSQL is just more strict. Which is a good thing :+)
14:51mstenta[m]:-)
14:52skipper_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?
14:52mstenta[m]I am actually considering using PostgreSQL as the default in the Drupal 8 version of farmOS
14:52mstenta[m]Yea that is true, but we do some extra stuff in farmOS in certain cases
14:54mstenta[m]Although I have patched Drupal core to fix one issue: github.com/farmOS/farmOS/blob/7.x-1.x/dr
14:54mstenta[m]So yea... A mix
14:56mstenta[m]Drupal "supports" PostgreSQL, but the huge majority of users still use MySQL/MariaDB, so PostgreSQL bugs don't always get fixed as quickly
14:56mstenta[m](my understanding)
23:38*JustTB has quit (Quit: Leaving.)
23:40*JustTB has joined

< 242019-05-25⋏26 >