APPLICATION ERROR #401, database error#1064

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
krell66
Posts: 2
Joined: Jun 13, 2019 9:30 am

APPLICATION ERROR #401, database error#1064

Post by krell66 » Jun 13, 2019 9:53 am

Hi,
after an automatic upgrade (current Mantisbt revision is now 2.9.0) when I try to:
- "Manage Projects", "Global Categories" and "Edit" one of Global Categories
the following screen appears:

APPLICATION ERROR #401
Database query failed. Error received from database was #1064: 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 '' at line 4 for the query: SELECT id, username, realname, access_level
FROM mantis_user_table
WHERE enabled = ?
AND access_level >= .
Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.


The same happens when I try to view an issue, selecting related ID.

Is anybody who can help me?

Thanks

More information about Mantisbt I am using are the following:
Synology Diskstation
MantisBT Version 2.9.0
Schema Version 183
PHP Version 5.6.40
Database Driver mysqli
Database Version, Description 10.3.11, 10.3.11-MariaDB
Site Path /volume1/web/mantisbt/
Core Path /volume1/web/mantisbt/core/
Plugin Path /volume1/web/mantisbt/plugins/


mmorag
Posts: 1
Joined: Jun 14, 2019 10:59 am

Re: APPLICATION ERROR #401, database error#1064

Post by mmorag » Jun 14, 2019 11:54 am

Same error when I try to view an issue or selecting related ID, as well as trying to accesing to Admin-config / transition or email-not.

I migrated old mysql (with lots of issues) and mantis version:

Old mysql ver.: 5.1.73 -> Migrated to: 5.7.26 MySQL Community Server (restoring db to the new one - bck-using mysqldump)
Old Mantis ver.: 1.2.19 -> Migrated to: 2.21

Addly, when I try to filter with "Assigned to", it shows "error: Internal Server Error".

Restoring database was successfully, and using install.php, I updated db manually using sql sentences given by installer.

Somebody has any idea how to solve it?. thks.

atrol
Site Admin
Posts: 7659
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: APPLICATION ERROR #401, database error#1064

Post by atrol » Jun 14, 2019 2:10 pm

Go back to your 1.2.19 dump and try the following steps
- clear browser cookies
- run install script to upgrade the database (don't do it manually)
- try if it works
- in any case run admin/check/index.php after the upgrade and check for errors and warnings
Please use Search before posting and read the Manual

krell66
Posts: 2
Joined: Jun 13, 2019 9:30 am

Re: APPLICATION ERROR #401, database error#1064

Post by krell66 » Jun 17, 2019 7:20 am

Hi,
any directions to solve the problem on 2.9.0 revision?

Thanks,

cas
Posts: 602
Joined: Mar 11, 2006 11:08 am
Contact:

Re: APPLICATION ERROR #401, database error#1064

Post by cas » Jun 17, 2019 7:54 am

@krell66, does your issue come from the same activity mmorag is reporting? Then follow advice from atrol.

Alip
Posts: 2
Joined: Jun 18, 2019 3:50 am

Re: APPLICATION ERROR #401, database error#1064

Post by Alip » Jun 18, 2019 4:52 am

Hello everyone,
I met the same error of krell66, after an automatic update from a Synology NAS.
MantisBT - 2.9.0.0074
MariaDB - 10.3.11-0054
I am not an expert of DBs nor of Mantis. Could you please explain in detail what am I supposed to do to try to fix the error? Am I supposed to fix MariaDB or MantisBT? Have I to reinstall through command line rather than through Synology Workstation GUI? (Most important) - will the reinstallation process delete all data in my current db?
Thank you and excuse me for the many questions, but I am really a newbie about Mantis and MariaDB.

atrol
Site Admin
Posts: 7659
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: APPLICATION ERROR #401, database error#1064

Post by atrol » Jun 18, 2019 4:17 pm

Alip wrote:
Jun 18, 2019 4:52 am
after an automatic update from a Synology NAS.
I don't know that much about Synology in general and how they install / upgrade Mantis
Alip wrote:
Jun 18, 2019 4:52 am
MantisBT - 2.9.0.0074
Quite outdated with known major security issues. It seems that Synology is not that much interested in keeping the application up to date.
Version 2.9.0 can't be recommended for production purposes.
Alip wrote:
Jun 18, 2019 4:52 am
please explain in detail what am I supposed to do to try to fix the error?
Hard to say, as I don't known how to install. Maybe just replacing the current Mantis installation folder by latest official Mantis download (2.21.1 at the moment) + copying current config_inc.php to config folder is enough for it.
But again: I don't know how Synology installs Mantis, if they change any files, folders, ...
Alip wrote:
Jun 18, 2019 4:52 am
will the reinstallation process delete all data in my current db?
The Mantis installer/upgrader does not destroy anything. But I don't know what the Synology installer does.

I would
- do a database backup
- install lasted Mantis the way it's described in Mantis Admin Guide
- provide the credentials of currently used database in Mantis installer UI
Please use Search before posting and read the Manual

Alip
Posts: 2
Joined: Jun 18, 2019 3:50 am

Re: APPLICATION ERROR #401, database error#1064

Post by Alip » Jun 19, 2019 8:23 am

Hello Atrol,
I followed your advices and did the following:
1. Backed up current Mantis DB
2. Uninstalled Synology's packaged Mantis app (2.9)
3. Downloaded latest stable release from Mantis website (2.21)
4. Deployed Mantis package in the same folder where Mantis 2.9 was located on NAS webserver
Doing so, though, I wasn't able to browse Mantis install.php page; probably some configuration for it to properly being seen by the webserver was missing.
So, I reverted step 4 and installed Synology's Mantis 2.9 again. At that point (after successful installation and launch from NAS control panel) I manually deleted Mantis folder content and replaced it with Mantis 2.21. This time, I was able to browse Mantis install.php page, and run the "regular" installation, making it to point to our DB. One error was reported at the end of installation (one null field in tokens table record), I manually fixed it by accessing DB. After that, installation was completed successfully.
I logged in and, wow!, problem looks fixed. The error message is gone, and all functions and settings seem to be on their place.
I have a weird status on NAS now, as system thinks "its" Mantis package is installed (it's still visible in the package center, I can start and stop service from there, and 2.9 is reported to be current version); I disabled automatic update to avoid further interference, and hope this mismatch won't cause troubles in future. What's important for me now is that Mantis is back to operative, and no data was lost in the process.
Thank you for support, I wouldn't have been able to get out of that without your help.

atrol
Site Admin
Posts: 7659
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: APPLICATION ERROR #401, database error#1064

Post by atrol » Jun 20, 2019 7:07 am

Thanks for coming back and telling the solution.

Did you contatc also Synology support to get this fixed?
Please use Search before posting and read the Manual

Post Reply