astroid-framework icon indicating copy to clipboard operation
astroid-framework copied to clipboard

HTTP 500 error when using astroid 3.0.x with kunena 6.2.0

Open BlackBrix opened this issue 2 years ago • 32 comments

Hi, i can't get astroid 3.0.x to work with kunena 6.2.0 -> apparently something "interferes" with each other (?):

  • kunena 6.2.0 works well without astroid 3.0.x & "JP-Business".
  • astroid 3.0.x & "JP-Business" works well without kunena 6.2.0 (must be completely uninstalled)
  • astroid 3.0.x & "JP-Business" together with kunena 6.2.0 does not work -> frontend shows HTTP 500 error (backend works fine):

$number: null is not a number.: libraries/astroid/framework/library/astroid/./../../../../../media/templates/site/tp_business/scss/../../../../astroid/assets/vendor/bootstrap/scss/_functions.scss on line 13, at column 5 Call Stack: #0 mixin _assert-ascending libraries/astroid/framework/library/astroid/./../../../../../media/templates/site/tp_business/scss/../../../../astroid/assets/vendor/bootstrap/scss/_variables.scss on line 494 #1 import libraries/astroid/framework/library/astroid/./../../../../../media/templates/site/tp_business/scss/../../../../astroid/assets/vendor/bootstrap/scss/_variables.scss libraries/astroid/framework/library/astroid/./../../../../../media/templates/site/tp_business/scss/../../../../astroid/assets/vendor/bootstrap/scss/bootstrap.scss on line 8 #2 import libraries/astroid/framework/library/astroid/./../../../../../media/templates/site/tp_business/scss/../../../../astroid/assets/vendor/bootstrap/scss/bootstrap.scss (unknown file) on line 1

tested under PHP 8.1.21 with Joomla 4.3.4 and 4.4.0 and with astroid 3.0.0, 3.0.1, 3.0.2

but: if you select the style "Cassiopeia - Default" instead each and every combination runs without any errors in frontend.

if you ask the kunena support they say something is wrong with astroid 3.0.x (because kunena 6.2.0 works well with the Joomla default template) ... ;-)

you can see the debug output of the frontend here -> https://joomlatest.hilgermissen.eu/joomla4_clone/ you can get admin access if needed (it's just a test site)

BlackBrix avatar Oct 19 '23 13:10 BlackBrix

It look likes a problem from scss file of tp_business template. @Joomlaplates may you help me check it?

sonvnn avatar Oct 20 '23 02:10 sonvnn

Astroid 3 is using Bootstrap 5.3.2. May be some function was changed. Let's check your template scss function. Make sure it is compatible with Bootstrap 5.3.2.

sonvnn avatar Oct 20 '23 04:10 sonvnn

but (as I wrote) astroid 3.0.x with "JP-Business" works well without kunena 6.2.0, only whith kunena 6.2.0 installed the problem occurs... does that make any sense ? does kunena use scss functions of the active template somehow ?

let me know if you need admin access you can do / try out everything there - it's just a test site

BlackBrix avatar Oct 20 '23 05:10 BlackBrix

May you send me admin account via [email protected]? I will check it.

sonvnn avatar Oct 20 '23 05:10 sonvnn

@BlackBrix It look like Kunena scssphp library override Astroid scssphp library. I tried to debug (using ff explore) in found their autoload class. Please help me use ftp unblock code on line 5 in libraries/kunena/External/autoload.php. I can't go to your site again. Because their system plugin.

sonvnn avatar Oct 20 '23 08:10 sonvnn

great, I will give you full FTP access later this day (not at home at the moment)

Do you need Database access too ?

BlackBrix avatar Oct 20 '23 08:10 BlackBrix

...Please help me use ftp unblock code on line 5 in libraries/kunena/External/autoload.php. I can't go to your site again. Because their system plugin...

I 'unblocked' the line 5 in "../libraries/kunena/External/autoload.php" for you (removed the comment syntax '//' ) I think you should have access again ...

BlackBrix avatar Oct 20 '23 13:10 BlackBrix

Thank you! I will check it in this week and response to you.

sonvnn avatar Oct 23 '23 04:10 sonvnn

at first after I "unblocked' the line 5 in "../libraries/kunena/External/autoload.php" the frontend works without errors, but only until I entered the kunena dashboard in the backend, then the frontend was immediately on HTTP error 500 again... ...very strange

BlackBrix avatar Oct 23 '23 05:10 BlackBrix

@BlackBrix It's because Astroid Cache stored the css. And you can see the front-end is working. But when you access to Kunena Dashboard, It remove all Astroid cache and it happens again. It's very strange when Kunena use a System plugin to trigger to another extension like that. But I will check it, if I have time in this week.

sonvnn avatar Oct 23 '23 07:10 sonvnn

I will also check as I use Kunena.

Chacapamac avatar Oct 24 '23 22:10 Chacapamac

Thanks a lot,

maybe you can communicate to the kunena people as well (?) -> https://github.com/Kunena

It would be nice if the astroid and kunena extensions (both widely used) could work together flawlessly in a Joomla 4.4. or 5.x installation ...

BlackBrix avatar Oct 25 '23 05:10 BlackBrix

Thank you! I am working to migrate all function to Joomla 5 and Joomla 6.

sonvnn avatar Oct 26 '23 03:10 sonvnn

Thank you! I am working to migrate all function to Joomla 5 and Joomla 6.

nice, but that is not the root cause of this Problem (#412) , or is it ?

@sonvnn : is it better to switch the affected site to PHP 8.2 then -> https://joomlatest.hilgermissen.eu/joomla4_clone/ (still on PHP 8.1 now)

I will also check as I use Kunena.

@Chacapamac : how did it go ? -> did you run into the same problem ?

BlackBrix avatar Oct 26 '23 07:10 BlackBrix

@BlackBrix Everything work fine with JOOMLA 4.3.4 - ASTROID 2.6.6 - KUNENA 6.1.1

• I update to KUNENA 6.2 — NO PROBLEMS! • I update to JOOMLA 4.4.0 and get a frontend 500 error!

The server error is —> [fastcgi:error] [pid 4144] [client 127.0.0.1:52222] FastCGI: incomplete headers (0 bytes) received from server "/Applications/MAMP/fcgi-bin/php8.1.0.fcgi", referer: MyMampLocalhost/administrator/index.php?option=com_installer&view=install

• So far, I didn’t update Astroid

Searching for the problem now!

Chacapamac avatar Oct 27 '23 18:10 Chacapamac

Update to Astroid 3.02 —> Same Frontend 500 Error I look in my Aphache error log and the FastCGI error (that I reset) that I note above is not created?????

Searching for the problem now!

Chacapamac avatar Oct 27 '23 18:10 Chacapamac

Don't look into the server log files, but enable the joomla debug mode in the backend (to the highest reporting level) and see what errors the joomla debug engine puts out on the frontend.

BlackBrix avatar Oct 27 '23 18:10 BlackBrix

Changing for Casiopea template bring the frontend correctly — No server error

My first Trace items is:

ScssPhp\ScssPhp\Exception\CompilerException:
$number: null is not a number.: /MyLocalhostPath/libraries/astroid/framework/library/astroid/./../../../../../media/templates/site/astroid_template_one/scss/../../../../astroid/assets/vendor/bootstrap/scss/_functions.scss on line 13, at column 5
Call Stack:
#0 mixin _assert-ascending /MyLocalhostPath/libraries/astroid/framework/library/astroid/./../../../../../media/templates/site/astroid_template_one/scss/../../../../astroid/assets/vendor/bootstrap/scss/_variables.scss on line 494
#1 import /MyLocalhostPath/libraries/astroid/framework/library/astroid/./../../../../../media/templates/site/astroid_template_one/scss/../../../../astroid/assets/vendor/bootstrap/scss/_variables.scss /MyLocalhostPath/libraries/astroid/framework/library/astroid/./../../../../../media/templates/site/astroid_template_one/scss/../../../../astroid/assets/vendor/bootstrap/scss/bootstrap.scss on line 8
#2 import /MyLocalhostPath/libraries/astroid/framework/library/astroid/./../../../../../media/templates/site/astroid_template_one/scss/../../../../astroid/assets/vendor/bootstrap/scss/bootstrap.scss (unknown file) on line 1

  at /MyLocalhostPath/libraries/kunena/External/scssphp/scssphp/src/Compiler.php:565
  at ScssPhp\ScssPhp\Compiler->compileString('@import "../../../../astroid/assets/vendor/bootstrap/scss/functions";@import "custom/variable_overrides";@import "variable_overrides";@import "../../../../astroid/assets/vendor/bootstrap/scss/bootstrap";@import "../../../../astroid/assets/vendor/astroid/scss/astroid";@import "style";@import "custom/custom";')
     (/MyLocalhostPath/libraries/astroid/framework/library/astroid/Document.php:1005)
  at Astroid\Document->renderScss('/MyLocalhostPath/media/templates/site/astroid_template_one/css/compiled-6e9abea4700a1c5dd07a2ea3e4d14dae.css')
     (/MyLocalhostPath/libraries/astroid/framework/library/astroid/Document.php:1180)
  at Astroid\Document->astroidCSS()
     (/MyLocalhostPath/libraries/astroid/framework/library/astroid/Helper/Head.php:104)
  at Astroid\Helper\Head::styles()
     (/MyLocalhostPath/templates/astroid_template_one/error.php:51)
  at require('/MyLocalhostPath/templates/astroid_template_one/error.php')
     (/MyLocalhostPath/libraries/src/Document/HtmlDocument.php:721)
  at Joomla\CMS\Document\HtmlDocument->_loadTemplate('/MyLocalhostPath/templates/astroid_template_one', 'error.php')
     (/MyLocalhostPath/libraries/src/Document/HtmlDocument.php:776)
  at Joomla\CMS\Document\HtmlDocument->_fetchTemplate(array('template' => 'astroid_template_one', 'directory' => '/MyLocalhostPath/templates', 'debug' => true, 'csp_nonce' => null, 'templateInherits' => '', 'params' => object(Registry), 'file' => 'error.php'))
     (/MyLocalhostPath/libraries/src/Document/HtmlDocument.php:612)
  at Joomla\CMS\Document\HtmlDocument->parse(array('template' => 'astroid_template_one', 'directory' => '/MyLocalhostPath/templates', 'debug' => true, 'csp_nonce' => null, 'templateInherits' => '', 'params' => object(Registry), 'file' => 'error.php'))
     (/MyLocalhostPath/libraries/src/Document/HtmlDocument.php:630)
  at Joomla\CMS\Document\HtmlDocument->render(false, array('template' => 'astroid_template_one', 'directory' => '/MyLocalhostPath/templates', 'debug' => true, 'csp_nonce' => null, 'templateInherits' => '', 'params' => object(Registry), 'file' => 'error.php'))
     (/MyLocalhostPath/libraries/src/Document/ErrorDocument.php:139)
  at Joomla\CMS\Document\ErrorDocument->render(false, array('template' => 'astroid_template_one', 'directory' => '/MyLocalhostPath/templates', 'debug' => true, 'csp_nonce' => null, 'templateInherits' => '', 'params' => object(Registry), 'file' => 'error.php'))
     (/MyLocalhostPath/libraries/src/Error/Renderer/HtmlRenderer.php:78)
  at Joomla\CMS\Error\Renderer\HtmlRenderer->render(object(CompilerException))
     (/MyLocalhostPath/libraries/src/Exception/ExceptionHandler.php:126)
  at Joomla\CMS\Exception\ExceptionHandler::render(object(CompilerException))
     (/MyLocalhostPath/libraries/src/Exception/ExceptionHandler.php:72)
  at Joomla\CMS\Exception\ExceptionHandler::handleException(object(CompilerException))
     (/MyLocalhostPath/libraries/src/Application/CMSApplication.php:322)
  at Joomla\CMS\Application\CMSApplication->execute()
     (/MyLocalhostPath/includes/app.php:61)
  at require_once('/MyLocalhostPath/includes/app.php')
     (/MyLocalhostPath/index.php:32)  

So Far, I’m not smart enough to find the problem (Kunena or Astroid) — This is important as Kunena is the ultimate forum component for Joomla...

Chacapamac avatar Oct 27 '23 18:10 Chacapamac

same like on my site, I think -> https://joomlatest.hilgermissen.eu/joomla4_clone/

BlackBrix avatar Oct 28 '23 09:10 BlackBrix

Personally, I dont have the knowledge to fix this, so far. I will still try.

This is a big problem for me as I’m using Kunena on all my clients website that need a forum.

Chacapamac avatar Oct 28 '23 14:10 Chacapamac

Personally, I dont have the knowledge to fix this, so far. I will still try.

don't get me wrong, but I think that's not your (our) job ...

In my case: I paid for my template subscription, if it doesn't work, or won't be fixed in reasonable time, I will quit the subscription very soon, and choose another template/framework... it's as simple as that.

But I am still confident that @sonvnn will find a solution very soon !

BlackBrix avatar Oct 28 '23 14:10 BlackBrix

@BlackBrix hello, all of people here are working for Astroid as volunteers, me too. It is free project.

Sure! I will find a solution for this issue. Althrough it happen from Kunena project. But I think it will come after I complete some major tasks first.

sonvnn avatar Oct 28 '23 15:10 sonvnn

@BlackBrix hello, all of people here are working for Astroid as volunteers, me too. It is free project.

yes sure, I know ... but another truth is: for other people/companies (e.g. TemPlaza, JoomlaPlate) it is the base of their business, and they earn money with it. and I am a (paying) customer of these companies. I pay them for their template support on a subscription base, but if there is a problem with the framework, they usually can't help anymore ...

BlackBrix avatar Oct 28 '23 15:10 BlackBrix

Hello together, 1.) this error happens with Zero Template too. I just clone the site with PHP 8.2, Joomla 4.4 and Kunena 6.2 2.) There something strange in Kunena 6.2, sorry I dont know why theyre using the scsss.php compiler too!! 3.) But I need to find a solution becasue we are running our Joomlaplates.com site with Kunena too .. Anyway, we can refund you the Template price. Therefore write me on Joomlaplates, or send an email! Reagards Peter

Joomlaplates avatar Oct 28 '23 15:10 Joomlaplates

The Kunena guys now made a huge change to no longer use the same namespace that astroid uses (ScssPhp\ScssPhp\...) -> https://github.com/Kunena/Kunena-Forum/commit/ae0e19f28b95e17e02276b0dd40ba7430205b0c7

I think it should work now, could not test it yet ...

BlackBrix avatar Oct 31 '23 05:10 BlackBrix

@BlackBrix

I think it should work now,

Great News. • Do we have to update Kunena to test?

Chacapamac avatar Oct 31 '23 14:10 Chacapamac

@sonvnn From @BlackBrix above:

The Kunena guys now made a huge change to no longer use the same namespace that astroid uses (ScssPhp\ScssPhp...)

https://github.com/Kunena/Kunena-Forum/commit/ae0e19f28b95e17e02276b0dd40ba7430205b0c7

It is weird that both Astroid and Kunena use the exact same code?, Is this a convention? If it is, maybe Astroid should also use a personalize code like they did —> 'KunenaScssPhp\ScssPhp\??

Chacapamac avatar Oct 31 '23 14:10 Chacapamac

It is weird that both Astroid and Kunena use the exact same code?, Is this a convention?

a common rule is: one should avoid "generic" namespaces wherever possible -> https://neos.readthedocs.io/en/8.3/References/CodingGuideLines/PHP.html#naming and use kindof (unique) "vendor" namespaces instead ...

so "ScssPhp\ScssPhp" is IMHO a very bad idea for a namespace, because "everyone" will use it at first because of the original libraries examples -> https://scssphp.github.io/scssphp/ ;-)

If it is, maybe Astroid should also use a personalize code like they did —> 'KunenaScssPhp\ScssPhp??

yes (@sonvnn), that would definitely be better (in my opinion). see here as well: https://www.dionysopoulos.me/book/concepts.html#idm140634930431856 ( https://www.dionysopoulos.me/media/com_docimport/books/assets/JoomlaExtensionNamespace.png )


Do we have to update Kunena to test?

you can wait until Kunena v6.2.1 is released and then make an update (https://github.com/Kunena/Kunena-Forum/issues/9574#issuecomment-1786954954)

or you generate your own kunena package out of their K6.2 branch https://github.com/Kunena/Kunena-Forum/tree/K6.2 (I don't know how to do)

BlackBrix avatar Oct 31 '23 15:10 BlackBrix

@Chacapamac you may take this "nightly" for testing purposes only: https://github.com/Kunena/Kunena-Forum/issues/9574#issuecomment-1788708506


[Edit]: I tested yesterday and it works in my installation without errors: tested the Kunena 6.2.1-DEV with:

  • Joomla 4.3.4 / 4.4.0 / 5.0.0 (b/c plugin)
  • Astroid 2.6.6 / 3.0.2
  • Joomlaplates Template 1.3.14 / 1.3.15
  • PHP 8.1.21 / 8.2.12

BlackBrix avatar Nov 01 '23 10:11 BlackBrix

@BlackBrix I just install and it work.

Did you have a Jason error when installing, I did? JSON.parse: unexpected character at line 1 column 1 of the JSON data Screen Shot 2023-11-04 at 10 20 11 AM

Joomla 4.4.0 Astroid 3.0.2 Astroid Template One PHP 8.1.0

Chacapamac avatar Nov 04 '23 14:11 Chacapamac