No Code Attached Yet
avatar aminweb2
aminweb2
30 Oct 2021

after upadated joomla 4.0.3 to 4.0.4 , display a error in Maintenance Database:

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' AND null = 'NO'' at line 1

System information (as much as possible)

Joomla 4.0.4
Database Version 10.3.31-MariaDB-0ubuntu0.20.04.1
Database Type mysql
PHP Version 7.4.22
Web Server LiteSpeed

avatar aminweb2 aminweb2 - open - 30 Oct 2021
avatar joomla-cms-bot joomla-cms-bot - change - 30 Oct 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 30 Oct 2021
avatar richard67
richard67 - comment - 30 Oct 2021

@aminweb2 Do you have any 3rd party extensions installed?

avatar aminweb2
aminweb2 - comment - 30 Oct 2021

@richard67 of course, but it is not matter. how can find where happen this error?

avatar richard67
richard67 - comment - 30 Oct 2021

@richard67 of course, but it is not matter.

@aminweb2 I would not ask if it does not matter. In Joomla 4 the database checker checks also for 3rd party extensions.

how can find where happen this error?

There is no easy way for you. If you switch on debug in global configuration you will only find out that it fails in the database checker. But you can give it a try. Switching on debug should cause a stack trace being shown. If so, make a screenshot and post here.

And please let me know which 3rd party extensions you have installed and if possible, if they have update SQL scripts.

And if the database page shows not only the error message, make a screenshot and post it here, too.

Thanks in advance.

avatar richard67
richard67 - comment - 31 Oct 2021

@aminweb2 I think know where the error happens, but I need some information from you to find what causes it.

What I knowe it that the error is caused by either an ALTER TABLE <tableName> MODIFY <columnName>... or an ALTER TABLE <tableName> CHANGE <columnName>... SQL statement in an update SQL script, with <tableName> being the name of the table and v` being the name of the column to be modified.

It is very likely not an update SQL script of the core but one of a 3rd party extension.

There is either a syntax error in that statement or there is wrong names quoting used for the table or the column name, or a table or column name is a reserved word in SQL and has no names quoting ("`" on MySQL and MariaDB).

You could help me with finding the exact mistake in that SQL script so that I can try to make a fix for the database checker.

Do you have access to the file system of your Joomla installation? If so, could you do following?

  • Search for all files having a file name extension ".sql" in all sub-folders of your Joomla installation and copy them to an empty temporary folder, keeping the folder structure. E.g. if a file administrator/components/com_foobar/sql/updates/somefilename.sql is found, copy it to <tempFolder>/administrator/components/com_foobar/sql/updates/somefilename.sql, with <tempFolder> being the previously mentioned temporary folder, and so on.
  • When all files have been copied, zip (or rar or whatever you have) the temporary folder and send me the zip (or rar) file by email.

Use following email address, replacing the <at>by @: admin<at>richard-fath.de.

Thanks in advance.

avatar richard67 richard67 - change - 31 Oct 2021
Labels Added: Information Required
avatar richard67 richard67 - labeled - 31 Oct 2021
avatar richard67
richard67 - comment - 31 Oct 2021

@aminweb2 Or maybe a faster check first: Can you change the code line here https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/Schema/ChangeItem.php#L205 in your installation by editing the file?

If so, change catch (\RuntimeException $e) to catch (\Exception $e) and save the change file (and if necessary upload it if you had to download it for editing).

Then go back to the database checker and make a screenshot and post it here.

Thanks in advance.

avatar richard67
richard67 - comment - 31 Oct 2021

@aminweb2 Forget it, no need for you to help me. I have found the error and will provide a fix soon.

avatar richard67 richard67 - change - 31 Oct 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-10-31 13:20:35
Closed_By richard67
avatar richard67 richard67 - close - 31 Oct 2021
avatar richard67
richard67 - comment - 31 Oct 2021

Closing as having a pull request. Please test #35951 . Thanks in advance.

avatar richard67 richard67 - change - 7 Nov 2021
Labels Removed: Information Required
avatar richard67 richard67 - unlabeled - 7 Nov 2021

Add a Comment

Login with GitHub to post a comment