opensourcepos / opensourcepos

Open Source Point of Sale is a web based point of sale application written in PHP using CodeIgniter framework. It uses MySQL as the data back end and has a Bootstrap 3 based user interface.

Home Page:http://www.opensourcepos.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error 500 after login on new install V3.3.9

SidSkiba opened this issue · comments

commented

Bug Description?

New setup using Laragon (PHP 7.4.9, Apache 2.4.54, MySQL 8.0.30). I create the database and run the database.sql in MySQL and it seems to create all the tables correctly. I http://localhost and it redirects to http://localhost/public/ and I get the Welcome to OSPOS! login. I login with admin/pointofsale and get a delay for a bit then a redirect to http://localhost/public/logon with a This page isn’t working / localhost is currently unable to handle this request./ HTTP ERROR 500.

I see a number of errors in the PHP logs:

[16-Apr-2024 17:11:58 America/New_York] Migrating to 3.1.1 (file: C:\Users\Sid\Documents\Laragon\www\application\migrations/sqlscripts/3.0.2_to_3.1.1.sql)
[16-Apr-2024 17:11:58 America/New_York] error: 1060
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate column name 'stock_type'
[16-Apr-2024 17:11:58 America/New_York] error: 1060
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate column name 'item_id'
[16-Apr-2024 17:11:58 America/New_York] error: 1060
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate column name 'kit_sequence'
[16-Apr-2024 17:11:58 America/New_York] error: 1060
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate column name 'print_option'
[16-Apr-2024 17:11:58 America/New_York] error: 1146
[16-Apr-2024 17:11:58 America/New_York] error: Table 'ospos.ospos_sales_suspended' doesn't exist
[16-Apr-2024 17:11:58 America/New_York] error: 1146
[16-Apr-2024 17:11:58 America/New_York] error: Table 'ospos.ospos_sales_suspended_items' doesn't exist
[16-Apr-2024 17:11:58 America/New_York] error: 1054
[16-Apr-2024 17:11:58 America/New_York] error: Unknown column 'pic_id' in 'ospos_items'
[16-Apr-2024 17:11:58 America/New_York] error: 1062
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate entry '1' for key 'ospos_dinner_tables.PRIMARY'
[16-Apr-2024 17:11:58 America/New_York] error: 1060
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate column name 'dinner_table_id'
[16-Apr-2024 17:11:58 America/New_York] error: 1061
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate key name 'dinner_table_id'
[16-Apr-2024 17:11:58 America/New_York] error: 1146
[16-Apr-2024 17:11:58 America/New_York] error: Table 'ospos.ospos_sales_suspended' doesn't exist
[16-Apr-2024 17:11:58 America/New_York] error: 1146
[16-Apr-2024 17:11:58 America/New_York] error: Table 'ospos.ospos_sales_suspended' doesn't exist
[16-Apr-2024 17:11:58 America/New_York] error: 1062
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate entry 'date_or_time_format' for key 'ospos_app_config.PRIMARY'
[16-Apr-2024 17:11:58 America/New_York] error: 1062
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate entry '1' for key 'ospos_customers_packages.PRIMARY'
[16-Apr-2024 17:11:58 America/New_York] error: 1060
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate column name 'package_id'
[16-Apr-2024 17:11:58 America/New_York] error: 1062
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate entry 'customer_reward_enable' for key 'ospos_app_config.PRIMARY'
[16-Apr-2024 17:11:58 America/New_York] error: 1050
[16-Apr-2024 17:11:58 America/New_York] error: Table 'ospos_sales_taxes' already exists
[16-Apr-2024 17:11:58 America/New_York] error: 1060
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate column name 'quote_number'
[16-Apr-2024 17:11:58 America/New_York] error: 1060
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate column name 'tax_type'
[16-Apr-2024 17:11:58 America/New_York] error: 1060
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate column name 'sales_tax_code'
[16-Apr-2024 17:11:58 America/New_York] error: 1062
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate entry 'cash_decimals' for key 'ospos_app_config.PRIMARY'
[16-Apr-2024 17:11:58 America/New_York] error: 1061
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate key name 'email'
[16-Apr-2024 17:11:58 America/New_York] error: 1062
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate entry 'financial_year' for key 'ospos_app_config.PRIMARY'
[16-Apr-2024 17:11:58 America/New_York] error: 1062
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate entry 'giftcard_number' for key 'ospos_app_config.PRIMARY'
[16-Apr-2024 17:11:58 America/New_York] error: 1062
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate entry 'receipt_show_company_name' for key 'ospos_app_config.PRIMARY'
[16-Apr-2024 17:11:58 America/New_York] error: 1062
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate entry 'receipt_font_size' for key 'ospos_app_config.PRIMARY'
[16-Apr-2024 17:11:58 America/New_York] error: 1061
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate key name 'person_id'
[16-Apr-2024 17:11:58 America/New_York] error: 1061
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate key name 'sale_id'
[16-Apr-2024 17:11:58 America/New_York] error: 1061
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate key name 'package_id'
[16-Apr-2024 17:11:58 America/New_York] error: 1062
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate entry 'gcaptcha_enable' for key 'ospos_app_config.PRIMARY'
[16-Apr-2024 17:11:58 America/New_York] error: 1062
[16-Apr-2024 17:11:58 America/New_York] error: Duplicate entry 'barcode_formats' for key 'ospos_app_config.PRIMARY'
[16-Apr-2024 17:11:58 America/New_York] error: 1146
[16-Apr-2024 17:11:58 America/New_York] error: Table 'ospos.ospos_sales_suspended' doesn't exist
[16-Apr-2024 17:11:58 America/New_York] error: 1146
[16-Apr-2024 17:11:58 America/New_York] error: Table 'ospos.ospos_sales_suspended_items' doesn't exist
[16-Apr-2024 17:11:58 America/New_York] error: 1146
[16-Apr-2024 17:11:58 America/New_York] error: Table 'ospos.ospos_sales_suspended_payments' doesn't exist
[16-Apr-2024 17:11:58 America/New_York] error: 1146
[16-Apr-2024 17:11:58 America/New_York] error: Table 'ospos.ospos_sales_suspended_items_taxes' doesn't exist
[16-Apr-2024 17:11:58 America/New_York] error: 1146
[16-Apr-2024 17:11:58 America/New_York] error: Table 'ospos.ospos_sales_suspended_payments' doesn't exist
[16-Apr-2024 17:11:58 America/New_York] error: 1146
[16-Apr-2024 17:11:58 America/New_York] error: Table 'ospos.ospos_sales_suspended_items_taxes' doesn't exist
[16-Apr-2024 17:11:58 America/New_York] error: 1146
[16-Apr-2024 17:11:58 America/New_York] error: Table 'ospos.ospos_sales_suspended_items_taxes' doesn't exist
[16-Apr-2024 17:11:58 America/New_York] error: 1146
[16-Apr-2024 17:11:58 America/New_York] error: Table 'ospos.ospos_sales_suspended_items' doesn't exist
[16-Apr-2024 17:11:58 America/New_York] error: 1146
[16-Apr-2024 17:11:58 America/New_York] error: Table 'ospos.ospos_sales_suspended_items' doesn't exist
[16-Apr-2024 17:11:58 America/New_York] error: 1146
[16-Apr-2024 17:11:58 America/New_York] error: Table 'ospos.ospos_sales_suspended_items' doesn't exist
[16-Apr-2024 17:11:58 America/New_York] error: 1146
[16-Apr-2024 17:11:58 America/New_York] error: Table 'ospos.ospos_sales_suspended' doesn't exist
[16-Apr-2024 17:11:58 America/New_York] error: 1146
[16-Apr-2024 17:11:58 America/New_York] error: Table 'ospos.ospos_sales_suspended' doesn't exist
[16-Apr-2024 17:11:58 America/New_York] error: 1146
[16-Apr-2024 17:11:58 America/New_York] error: Table 'ospos.ospos_sales_suspended' doesn't exist
[16-Apr-2024 17:11:58 America/New_York] error: 1051
[16-Apr-2024 17:11:58 America/New_York] error: Unknown table 'ospos.ospos_sales_suspended_payments,ospos.ospos_sales_suspended_items_taxes,ospos.ospos_sales_suspended_items,ospos.ospos_sales_'
[16-Apr-2024 17:11:59 America/New_York] Migrated to 3.1.1
[16-Apr-2024 17:11:59 America/New_York] Migrating sales tax history. The number of sales that will be migrated is 0
[16-Apr-2024 17:11:59 America/New_York] Migrating sales tax history. The number of sales that will be migrated is finished.
[16-Apr-2024 17:11:59 America/New_York] Migrating to 3.2.0 (file: C:\Users\Sid\Documents\Laragon\www\application\migrations/sqlscripts/3.1.1_to_3.2.0.sql)
[16-Apr-2024 17:11:59 America/New_York] error: 1060
[16-Apr-2024 17:11:59 America/New_York] error: Duplicate column name 'menu_group'
[16-Apr-2024 17:11:59 America/New_York] error: 1062
[16-Apr-2024 17:11:59 America/New_York] error: Duplicate entry 'office' for key 'ospos_modules.PRIMARY'
[16-Apr-2024 17:11:59 America/New_York] error: 1062
[16-Apr-2024 17:11:59 America/New_York] error: Duplicate entry 'office' for key 'ospos_permissions.PRIMARY'
[16-Apr-2024 17:11:59 America/New_York] error: 1062
[16-Apr-2024 17:11:59 America/New_York] error: Duplicate entry 'office-1' for key 'ospos_grants.PRIMARY'
[16-Apr-2024 17:11:59 America/New_York] error: 1062
[16-Apr-2024 17:11:59 America/New_York] error: Duplicate entry 'work_order_enable' for key 'ospos_app_config.PRIMARY'
[16-Apr-2024 17:11:59 America/New_York] error: 1060
[16-Apr-2024 17:11:59 America/New_York] error: Duplicate column name 'work_order_number'
[16-Apr-2024 17:11:59 America/New_York] error: 1060
[16-Apr-2024 17:11:59 America/New_York] error: Duplicate column name 'language'
[16-Apr-2024 17:11:59 America/New_York] error: 1062
[16-Apr-2024 17:11:59 America/New_York] error: Duplicate entry 'suggestions_first_column' for key 'ospos_app_config.PRIMARY'
[16-Apr-2024 17:11:59 America/New_York] error: 1062
[16-Apr-2024 17:11:59 America/New_York] error: Duplicate entry 'allow_duplicate_barcodes' for key 'ospos_app_config.PRIMARY'
[16-Apr-2024 17:11:59 America/New_York] error: 1062
[16-Apr-2024 17:11:59 America/New_York] error: Duplicate entry 'quote_default_comments' for key 'ospos_app_config.PRIMARY'
[16-Apr-2024 17:11:59 America/New_York] Migrated to 3.2.0
[16-Apr-2024 17:11:59 America/New_York] Migrating to 3.2.1 (file: C:\Users\Sid\Documents\Laragon\www\application\migrations/sqlscripts/3.2.0_to_3.2.1.sql)
[16-Apr-2024 17:11:59 America/New_York] Migrated to 3.2.1
[16-Apr-2024 17:11:59 America/New_York] Migrating to attributes (file: C:\Users\Sid\Documents\Laragon\www\application\migrations/sqlscripts/3.3.0_attributes.sql)
[16-Apr-2024 17:12:00 America/New_York] Migrated to attributes
[16-Apr-2024 17:12:00 America/New_York] Migrating to 3.3.0 (file: C:\Users\Sid\Documents\Laragon\www\application\migrations/sqlscripts/3.2.1_to_3.3.0.sql)
[16-Apr-2024 17:12:00 America/New_York] Migrated to 3.3.0
[16-Apr-2024 17:12:00 America/New_York] Migrating to indiagst (file: C:\Users\Sid\Documents\Laragon\www\application\migrations/sqlscripts/3.3.0_indiagst.sql)
[16-Apr-2024 17:12:00 America/New_York] Migrated to indiagst
[16-Apr-2024 17:12:00 America/New_York] Migrating tax configuration
[16-Apr-2024 17:12:00 America/New_York] Migrating tax configuration completed
[16-Apr-2024 17:12:00 America/New_York] Migrating to indiagst1 (file: C:\Users\Sid\Documents\Laragon\www\application\migrations/sqlscripts/3.3.0_indiagst1.sql)
[16-Apr-2024 17:12:00 America/New_York] Migrated to indiagst1
[16-Apr-2024 17:12:00 America/New_York] Fix definition of Supplier.Tax Id
[16-Apr-2024 17:12:00 America/New_York] Definition of Supplier.Tax Id corrected
[16-Apr-2024 17:12:00 America/New_York] Migrating to indiagst2 (file: C:\Users\Sid\Documents\Laragon\www\application\migrations/sqlscripts/3.3.0_indiagst2.sql)
[16-Apr-2024 17:12:00 America/New_York] Migrated to indiagst2
[16-Apr-2024 17:12:00 America/New_York] Migrating to type (file: C:\Users\Sid\Documents\Laragon\www\application\migrations/sqlscripts/3.3.0_decimal_attribute_type.sql)
[16-Apr-2024 17:12:00 America/New_York] Migrated to type
[16-Apr-2024 17:12:00 America/New_York] Migrating to 4217 (file: C:\Users\Sid\Documents\Laragon\www\application\migrations/sqlscripts/3.3.0_add_iso_4217.sql)
[16-Apr-2024 17:12:00 America/New_York] Migrated to 4217
[16-Apr-2024 17:12:00 America/New_York] Migrating to paymenttracking (file: C:\Users\Sid\Documents\Laragon\www\application\migrations/sqlscripts/3.3.0_paymenttracking.sql)
[16-Apr-2024 17:12:01 America/New_York] Migrated to paymenttracking
[16-Apr-2024 17:12:01 America/New_York] Migrating to refundtracking (file: C:\Users\Sid\Documents\Laragon\www\application\migrations/sqlscripts/3.3.0_refundtracking.sql)
[16-Apr-2024 17:12:01 America/New_York] Migrated to refundtracking
[16-Apr-2024 17:12:01 America/New_York] Migrating to dbfix (file: C:\Users\Sid\Documents\Laragon\www\application\migrations/sqlscripts/3.3.0_dbfix.sql)
[16-Apr-2024 17:12:01 America/New_York] Migrated to dbfix
[16-Apr-2024 17:12:01 America/New_York] Migrating to datetime (file: C:\Users\Sid\Documents\Laragon\www\application\migrations/sqlscripts/3.3.0_fix_attribute_datetime.sql)
[16-Apr-2024 17:12:01 America/New_York] Migrated to datetime
[16-Apr-2024 17:12:01 America/New_York] Migrating to paymentdatefix (file: C:\Users\Sid\Documents\Laragon\www\application\migrations/sqlscripts/3.3.2_paymentdatefix.sql)
[16-Apr-2024 17:12:01 America/New_York] Migrated to paymentdatefix
[16-Apr-2024 17:12:01 America/New_York] Migrating to saleschangeprice (file: C:\Users\Sid\Documents\Laragon\www\application\migrations/sqlscripts/3.3.2_saleschangeprice.sql)
[16-Apr-2024 17:12:01 America/New_York] Migrated to saleschangeprice
[16-Apr-2024 17:12:01 America/New_York] Migrating modify_attr_links_constraint
[16-Apr-2024 17:12:01 America/New_York] Migrating to constraint (file: C:\Users\Sid\Documents\Laragon\www\application\migrations/sqlscripts/3.3.2_modify_attr_links_constraint.sql)
[16-Apr-2024 17:12:01 America/New_York] Migrated to constraint
[16-Apr-2024 17:12:01 America/New_York] Migrating modify_attr_links_constraint
[16-Apr-2024 17:12:01 America/New_York] Migrating add_item_kit_number
[16-Apr-2024 17:12:01 America/New_York] Migrating to number (file: C:\Users\Sid\Documents\Laragon\www\application\migrations/sqlscripts/3.3.3_add_kits_item_number.sql)
[16-Apr-2024 17:12:02 America/New_York] Migrated to number
[16-Apr-2024 17:12:02 America/New_York] Migrating add_item_kit_number
[16-Apr-2024 17:12:02 America/New_York] Migrating modify_session_datatype
[16-Apr-2024 17:12:02 America/New_York] Migrating to datatype (file: C:\Users\Sid\Documents\Laragon\www\application\migrations/sqlscripts/3.3.4_modify_session_datatype.sql)
[16-Apr-2024 17:12:02 America/New_York] Migrated to datatype
[16-Apr-2024 17:12:02 America/New_York] Migrating modify_session_datatype
[16-Apr-2024 17:12:02 America/New_York] Migrating database_optimizations

I do not see any other errors.

I did try with PHPV8.1 but I get Error 500 immediately. Same with PHPV8.0. But those being unsupported am not surprised.

The files are all located in the www root folder.

I set Error Logging Threshold to 1and I get the following log:

ERROR - 2024-04-16 17:51:16 --> Query error: Unknown column 'fa.sales_tax_code' in 'where clause' - Invalid query: UPDATE ospos_customers AS fa SET fa.sales_tax_code_id = (
SELECT tax_code_id FROM ospos_tax_codes AS fb where fa.sales_tax_code = fb.tax_code)
ERROR - 2024-04-16 17:51:16 --> Query error: Can't DROP 'sales_tax_code'; check that column/key exists - Invalid query: ALTER TABLE ospos_customers DROP COLUMN sales_tax_code
ERROR - 2024-04-16 17:51:16 --> Query error: Table 'ospos.ospos_migrate_refund' doesn't exist - Invalid query: UPDATE ospos_sales_payments AS a
SET a.cash_refund =
(SELECT b.refund_amount
FROM ospos_migrate_refund AS b
WHERE a.sale_id = b.sale_id AND a.payment_type = 'Cash')
WHERE EXISTS
(SELECT b.refund_amount
FROM ospos_migrate_refund AS b
WHERE a.sale_id = b.sale_id AND a.payment_type = 'Cash ')
ERROR - 2024-04-16 17:51:16 --> Query error: Table 'ospos.ospos_migrate_refund' doesn't exist - Invalid query: INSERT INTO ospos_sales_payments (sale_id, payment_type, employee_id, payment_time, payment_amount, cash_refund)
SELECT r.sale_id, 'Cash', s.employee_id, sale_time, 0, r.refund_amount
FROM ospos_migrate_refund AS r
JOIN ospos_sales_payments AS p ON r.sale_id = p.sale_id
JOIN ospos_migrate_sales AS s ON r.sale_id = s.sale_id
WHERE p.payment_type != 'Cash'
ERROR - 2024-04-16 17:51:17 --> Query error: Duplicate entry 'receipt_show_tax_ind' for key 'ospos_app_config.PRIMARY' - Invalid query: INSERT INTO ospos_app_config (key, value)
VALUES ('receipt_show_tax_ind', '0')
ERROR - 2024-04-16 17:51:17 --> Query error: Duplicate key name 'tax_jurisdictions_uq1' - Invalid query: ALTER TABLE ospos_tax_jurisdictions ADD CONSTRAINT tax_jurisdictions_uq1 UNIQUE (tax_group)
ERROR - 2024-04-16 17:51:17 --> Query error: Duplicate entry 'image_allowed_types' for key 'ospos_app_config.PRIMARY' - Invalid query: INSERT INTO ospos_app_config (key, value) VALUES ('image_allowed_types','gif|jpg|png'), ('image_max_height','480'), ('image_max_size','128'), ('image_max_width','640')
ERROR - 2024-04-16 17:51:17 --> Query error: Duplicate column name 'cash_adjustment' - Invalid query: ALTER TABLE ospos_sales_payments ADD COLUMN cash_adjustment tinyint NOT NULL DEFAULT 0 AFTER cash_refund
ERROR - 2024-04-16 17:51:18 --> Query error: Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'ospos.ospos_attribute_values.attribute_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by - Invalid query: SELECT attribute_decimal, attribute_id
FROM ospos_attribute_values
GROUP BY attribute_decimal
HAVING COUNT(attribute_decimal) > 1
ERROR - 2024-04-16 17:51:18 --> Severity: error --> Exception: Call to a member function result_array() on bool C:\Users\Sid\Documents\Laragon\www\application\migrations\20210422000000_database_optimizations.php 85
ERROR - 2024-04-16 17:51:18 --> Query error: Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'ospos.ospos_attribute_values.attribute_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by - Invalid query: SELECT attribute_decimal, attribute_id
FROM ospos_attribute_values
GROUP BY attribute_decimal
HAVING COUNT(attribute_decimal) > 1
ERROR - 2024-04-16 17:51:18 --> Severity: error --> Exception: Call to a member function result_array() on bool C:\Users\Sid\Documents\Laragon\www\application\migrations\20210422000000_database_optimizations.php 85

I change to MySQL V5.7.44 and re-did everything and now I get the following:

ERROR - 2024-04-16 18:08:26 --> Query error: Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'ospos.ospos_attribute_values.attribute_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by - Invalid query: SELECT attribute_decimal, attribute_id
FROM ospos_attribute_values
GROUP BY attribute_decimal
HAVING COUNT(attribute_decimal) > 1
ERROR - 2024-04-16 18:08:26 --> Severity: error --> Exception: Call to a member function result_array() on bool C:\Users\Sid\Documents\Laragon\www\application\migrations\20210422000000_database_optimizations.php 85

Steps to Reproduce?

Install in Laragon and OSPOS.

Expected Behavior?

Expected to login as admin.

OpensourcePOS Version

opensourcepos 3.3.9

Php version

Php 7.4

What browsers are you seeing the problem on?

Chrome

Server Operating System and version

Win10

Database Management System and version

MySQL 8.0.30 X64

Web Server and version

Apache 2.4.54

System Information Report (optional)

System Information Report

Unmodified copy of OpensourcePOS

  • I agree this copy has not been modified
commented

I was able to get it to startup with MySQL V5.7.44 but I had to make the following entry under [mysqld] in the my.ini file:

sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

This is apparently undesirable practice but it worked.

Ah the good old only_full_group_by
Maybe we can try to set this config from the application directly, in case it detect MySQL.

related to #2819, it's probably best to get rid of the only_full_group_by and review the logic to work properly.

commented

I verified it worked to disable only_full_group_by under MySQL V8.0 but I had to use a slightly different modification in my.ini:

sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"

but if the query could be fixed it would be better.