Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OWA fails to run in 8.x #893

Open
3 tasks done
imachequa opened this issue Aug 4, 2023 · 27 comments
Open
3 tasks done

OWA fails to run in 8.x #893

imachequa opened this issue Aug 4, 2023 · 27 comments
Labels
bug Bug in code confirmed and identified.

Comments

@imachequa
Copy link

Before you open an issue:

**OWA Version **: 1.7.8

PHP Version: 8.0.29 / 8.3.0

Webserver: Apache

Browser: Safari 16.5.2 / Firefox 116.0

Description

PHP 8.0.29
login process is working ok.. when trying to use any page I get>:
Fatal error: Declaration of owa_optionsGeneralView::render($data) must be compatible with owa_adminPageView::render() in /installed-path/modules/base/optionsGeneral.php on line 73

PHP 8.3
I get below error when accessing the portal link, it doesn't even show me the login prompts
I'd deleted duplicate lines and changes the order how they appear:

Deprecated: Creation of dynamic property owa_actions::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_actions::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_actionsValue::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_actionsValue::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_auth::$eq is deprecated in installed-path/owa_auth.php on line 107
Deprecated: Creation of dynamic property owa_baseModule::$config_required is deprecated in installed-path/modules/base/module.php on line 47
Deprecated: Creation of dynamic property owa_bounces::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_bounces::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_configurableMetric::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_configurableMetric::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_configurableMetric::$type is deprecated in installed-path/owa_metric.php on line 355
Deprecated: Creation of dynamic property owa_domClicks::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_domClicks::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_domstreamModule::$config_required is deprecated in installed-path/modules/domstream/module.php on line 43
Deprecated: Creation of dynamic property owa_error::$logger is deprecated in installed-path/modules/base/classes/error.php on line 68
Deprecated: Creation of dynamic property owa_feedReaders::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_feedReaders::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_feedRequests::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_feedRequests::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_feedSubscriptions::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_feedSubscriptions::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_fileCacheModule::$config_required is deprecated in installed-path/modules/fileCache/module.php on line 29
Deprecated: Creation of dynamic property owa_goalCompletionsAll::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_goalCompletionsAll::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_goalNCompletions::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_goalNStarts::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_goalNStarts::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_goalNValue::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_goalNValue::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_goalStartsAll::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_goalStartsAll::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_goalValueAll::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_goalValueAll::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_lineItemQuantity::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_lineItemQuantity::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_lineItemQuantityFromSessionFact::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_lineItemQuantityFromSessionFact::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_lineItemRevenue::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_lineItemRevenue::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_lineItemRevenueFromSessionFact::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_lineItemRevenueFromSessionFact::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_maxmind_geoipModule::$config_required is deprecated in installed-path/modules/maxmind_geoip/module.php on line 45
Deprecated: Creation of dynamic property owa_memcachedCacheModule::$config_required is deprecated in installed-path/modules/memcachedCache/module.php on line 29
Deprecated: Creation of dynamic property owa_newVisitors::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_newVisitors::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_repeatVisitors::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_shippingRevenue::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_shippingRevenue::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_shippingRevenueFromSessionFact::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_shippingRevenueFromSessionFact::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_taxRevenue::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_taxRevenue::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_taxRevenueFromSessionFact::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_taxRevenueFromSessionFact::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_transactionRevenue::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_transactionRevenue::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_transactionRevenueFromSessionFact::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_transactionRevenueFromSessionFact::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_transactions::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_transactions::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_transactionsFromSessionFact::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_transactionsFromSessionFact::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_uniqueActions::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_uniqueActions::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_uniqueLineItems::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_uniqueLineItems::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_uniqueLineItemsFromSessionFact::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_uniqueLineItemsFromSessionFact::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_uniquePageViews::$all_columns is deprecated in installed-path/owa_metric.php on line 312
Deprecated: Creation of dynamic property owa_uniquePageViews::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: Creation of dynamic property owa_visitDuration::$entity is deprecated in installed-path/owa_metric.php on line 225
Deprecated: str_replace(): Passing null to parameter
3 ($subject) of type array|string is deprecated in installed-path/modules/base/classes/sanitize.php on line 330

Possible Solution

Additional context

@imachequa imachequa added the bug Bug in code confirmed and identified. label Aug 4, 2023
@tcreek
Copy link

tcreek commented Aug 6, 2023

This has been report a billion times already

@criterion9
Copy link
Contributor

Easy "fix" on the 8.0|1.x error:

Line 920 in owa_view.php changed to:

function render($data) {

@imachequa
Copy link
Author

I would need to install it again, but having so many issues with OWA that data is visible to people that is not logged in that I was quite discourage in using it. I'll give it a try once more and provide feedback here.

@imachequa
Copy link
Author

This has been report a billion times already

I couldn't find details.. but most probably I wasn't looking in the right way. Just curious, why it hasn't been changed in the main code?

@boydle
Copy link

boydle commented Nov 2, 2023

I would need to install it again, but having so many issues with OWA that data is visible to people that is not logged in that I was quite discourage in using it. I'll give it a try once more and provide feedback here.

Are you able to give details about what data is visible to unauthorised users? and steps to reproduce?

@BloodyIron
Copy link

This has been report a billion times already

So then link to the tickets that this is a duplicate of? You know, like is common for this situation?

@tcreek
Copy link

tcreek commented Dec 14, 2023

Easy "fix" on the 8.0|1.x error:

Line 920 in owa_view.php changed to:

function render($data) {

Unfortunately that is not the answer:
PHP Fatal error: Uncaught Error: Undefined constant "OWA_DTD_BIGINT" in /var/www/html/owa/modules/base/entities/configuration.php:37\nStack trace:\n#0 /var/www/html/owa/owa_lib.php(489): owa_configuration->__construct()\n#1 /var/www/html/owa/owa_coreAPI.php(561): owa_lib::factory()\n#2 /var/www/html/owa/owa_coreAPI.php(521): owa_coreAPI::moduleSpecificFactory()\n#3 /var/www/html/owa/modules/base/classes/settings.php(72): owa_coreAPI::entityFactory()\n#4 /var/www/html/owa/owa_lib.php(489): owa_settings->__construct()\n#5 /var/www/html/owa/owa_coreAPI.php(487): owa_lib::factory()\n#6 /var/www/html/owa/owa_coreAPI.php(142): owa_coreAPI::supportClassFactory()\n#7 /var/www/html/owa/owa_base.php(78): owa_coreAPI::configSingleton()\n#8 /var/www/html/owa/owa_caller.php(76): owa_base->__construct()\n#9 /var/www/html/owa/owa.php(24): owa_caller->__construct()\n#10 /var/www/html/owa/install.php(38): owa->__construct()\n#11 {main}\n thrown in /var/www/html/owa/modules/base/entities/configuration.php on line 37

@tcreek
Copy link

tcreek commented Dec 17, 2023

This has been report a billion times already

So then link to the tickets that this is a duplicate of? You know, like is common for this situation?

Only took seconds to find just four of them

#889
#888
#886
#884

And here is one way back from January 2023:

#871

@tcreek
Copy link

tcreek commented Dec 17, 2023

This has been report a billion times already

I couldn't find details.. but most probably I wasn't looking in the right way. Just curious, why it hasn't been changed in the main code?

I understand there are not enough developers working on this project

@criterion9
Copy link
Contributor

Easy "fix" on the 8.0|1.x error:
Line 920 in owa_view.php changed to:

function render($data) {

Unfortunately that is not the answer: PHP Fatal error: Uncaught Error: Undefined constant "OWA_DTD_BIGINT" in /var/www/html/owa/modules/base/entities/configuration.php:37\nStack trace:\n#0 /var/www/html/owa/owa_lib.php(489): owa_configuration->__construct()\n#1 /var/www/html/owa/owa_coreAPI.php(561): owa_lib::factory()\n#2 /var/www/html/owa/owa_coreAPI.php(521): owa_coreAPI::moduleSpecificFactory()\n#3 /var/www/html/owa/modules/base/classes/settings.php(72): owa_coreAPI::entityFactory()\n#4 /var/www/html/owa/owa_lib.php(489): owa_settings->__construct()\n#5 /var/www/html/owa/owa_coreAPI.php(487): owa_lib::factory()\n#6 /var/www/html/owa/owa_coreAPI.php(142): owa_coreAPI::supportClassFactory()\n#7 /var/www/html/owa/owa_base.php(78): owa_coreAPI::configSingleton()\n#8 /var/www/html/owa/owa_caller.php(76): owa_base->__construct()\n#9 /var/www/html/owa/owa.php(24): owa_caller->__construct()\n#10 /var/www/html/owa/install.php(38): owa->__construct()\n#11 {main}\n thrown in /var/www/html/owa/modules/base/entities/configuration.php on line 37

I have been running OWA in a PHP8.1 environment for a few months now following the adjustment I posted as a comment. I am running a customized version however so at some point when I get a chance I will run a diff to see if something else I changed fixed the cause of that error message and submit back upstream.

@padams
Copy link
Collaborator

padams commented Dec 23, 2023

Awesome. Thanks. Happy to review a PR.

@criterion9
Copy link
Contributor

Awesome. Thanks. Happy to review a PR.

Just submitted a PR with a round of strictness errors/warnings/deprecations found in php8.0|1.x. Will try to keep any related PRs to a similar focus style for ease of review/approval.

@criterion9
Copy link
Contributor

Easy "fix" on the 8.0|1.x error:
Line 920 in owa_view.php changed to:

function render($data) {

Unfortunately that is not the answer: PHP Fatal error: Uncaught Error: Undefined constant "OWA_DTD_BIGINT" in /var/www/html/owa/modules/base/entities/configuration.php:37\nStack trace:\n#0 /var/www/html/owa/owa_lib.php(489): owa_configuration->__construct()\n#1 /var/www/html/owa/owa_coreAPI.php(561): owa_lib::factory()\n#2 /var/www/html/owa/owa_coreAPI.php(521): owa_coreAPI::moduleSpecificFactory()\n#3 /var/www/html/owa/modules/base/classes/settings.php(72): owa_coreAPI::entityFactory()\n#4 /var/www/html/owa/owa_lib.php(489): owa_settings->__construct()\n#5 /var/www/html/owa/owa_coreAPI.php(487): owa_lib::factory()\n#6 /var/www/html/owa/owa_coreAPI.php(142): owa_coreAPI::supportClassFactory()\n#7 /var/www/html/owa/owa_base.php(78): owa_coreAPI::configSingleton()\n#8 /var/www/html/owa/owa_caller.php(76): owa_base->__construct()\n#9 /var/www/html/owa/owa.php(24): owa_caller->__construct()\n#10 /var/www/html/owa/install.php(38): owa->__construct()\n#11 {main}\n thrown in /var/www/html/owa/modules/base/entities/configuration.php on line 37

Are you sure you are not seeing the exact same error in other version of PHP? I do not see any changes in the version I am now running on PHP8.2 and the primary branch here that could cause that error.

@tcreek
Copy link

tcreek commented Dec 24, 2023

PHP 8.1.2-1ubuntu2.14 (cli) (built: Aug 18 2023 11:41:11) (NTS)

@criterion9
Copy link
Contributor

PHP 8.1.2-1ubuntu2.14 (cli) (built: Aug 18 2023 11:41:11) (NTS)

What other version of PHP did you use where that error was not present?

@tcreek
Copy link

tcreek commented Dec 24, 2023

Not using any other version at the.moment

@criterion9
Copy link
Contributor

Not using any other version at the.moment

Then I would suggest trying php7 and see if you have the same error. If that is the case, it is unrelated to this issue.

@criterion9
Copy link
Contributor

Added a PR for the db handling changes in php 8.x: #904

This appears to be the last block of changes that are different from our customized fork that could be related to PHP8. We have been running our OWA based environments with PHP8.2 for over a week and have not seen any new issues/errors or other unexpected behavior.

@tcreek
Copy link

tcreek commented Dec 25, 2023

Not using any other version at the.moment

Then I would suggest trying php7 and see if you have the same error. If that is the case, it is unrelated to this issue.

I do have a server running 7.4. It is not a server I need or want any Anaylitics on, but I could test it on there

@BloodyIron
Copy link

Excited for PHP8.x in the next release! I see it's been a while since a release... any rough target for next release date? :)

@criterion9
Copy link
Contributor

We have seen one bizarre thing now that we have switched over our tracking environments. We are seeing all visitors identified as returns and no visits being marked as "new". We haven't started troubleshooting to determine root cause but it could be related to PHP 8 differences.

@criterion9
Copy link
Contributor

criterion9 commented Jan 21, 2024

We also ran across what might be an edge case where a variable(s) being filtered/validated through mysqli_real_escape_string was actually an array which throws an exception and stops executing. This has caused the file based tracking queue to build until services began getting unstable. As a hotfix we adjusted the filtering/validating method to traverse arrays recursively but aren't sure if this is the correct approach or just eliminating the error to clear queued items. Wanted to get some opinions before submitting the "fix" as a PR, any thoughts?

Our "fix" for the prepare method in plugins/db/owa_db_mysql.php near line 257:

function prepare( $string ) {
        if(is_null($string)){
            return $string;
        }
        if(is_array($string)){
            foreach($string as $key => $val){
                $string[$key] = $this->prepare($val);
            }
            return $string;
        }

        if ($this->connection_status == false) {
              $this->connect();
          }

        return mysqli_real_escape_string( $this->connection, $string );

    }

@trondhuso
Copy link

trondhuso commented Apr 25, 2024

@criterion9: Your last "fix" (your quotes) might break things in the future. To me it seems as you are returning an array if it is an array. And with php 8 you could say that prepare shall only accept a string, not an array.

@criterion9
Copy link
Contributor

@criterion9: Your last "fix" (your quotes) might break things in the future. To me it seems as you are returning an array if it is an array. And with php 8 you could say that prepare shall only accept a string, not an array.

That code loops through the array and runs prepare on it allowing for recursion. I'm not sure how that would break things. Do you have an example what might break?

@trondhuso
Copy link

@criterion9: Your last "fix" (your quotes) might break things in the future. To me it seems as you are returning an array if it is an array. And with php 8 you could say that prepare shall only accept a string, not an array.

That code loops through the array and runs prepare on it allowing for recursion. I'm not sure how that would break things. Do you have an example what might break?

I have not looked at what happens after the data from this function is processed elsewhere in the code, but to me it looks as the default return from this function is a string, whereas the loop will return an array (named as string).
It may/may not break things where this function is called.

@criterion9
Copy link
Contributor

criterion9 commented Apr 26, 2024

@criterion9: Your last "fix" (your quotes) might break things in the future. To me it seems as you are returning an array if it is an array. And with php 8 you could say that prepare shall only accept a string, not an array.

That code loops through the array and runs prepare on it allowing for recursion. I'm not sure how that would break things. Do you have an example what might break?

I have not looked at what happens after the data from this function is processed elsewhere in the code, but to me it looks as the default return from this function is a string, whereas the loop will return an array (named as string). It may/may not break things where this function is called.

@trondhuso, the function returns an array if that was what it got, it isn't like it turns a string into an array. I don't see how this could break anything. (We have been running it in production for quite a while now)

@criterion9
Copy link
Contributor

We have seen one bizarre thing now that we have switched over our tracking environments. We are seeing all visitors identified as returns and no visits being marked as "new". We haven't started troubleshooting to determine root cause but it could be related to PHP 8 differences.

Turns out it was related to our shift from using the javascript tracking to the php client library. All is well for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug in code confirmed and identified.
Projects
None yet
Development

No branches or pull requests

7 participants