Update mantis 2.21 can not download/upload attachments

Get help from other users here.

Moderators: Developer, Contributor

uv_jfuchs
Posts: 13
Joined: 17 May 2019, 11:20

Update mantis 2.21 can not download/upload attachments

Post by uv_jfuchs »

Hello,
I migrate from Ubuntu 12.04 Server with mantis 1.2.19, mysql 5.5.54 and PHP 5.3.10 to an new centos 7.6 server with mantis 2.21, MariaDB 5.5.60 and PHP 7.3.5.
I do a mysqldump from the old one and put it into the new DB. After that I run the Updte script /admin/install.php.
Everythings works fine.
The only Problem I have is that nobody can upload ord download files.
My config:
$g_file_upload_method = 'DISK';
$g_absolute_path_default_upload_folder = '/var/www/html/mantis-files';

I see in the database that there is an old path to th file (/srv/p1mantis/mantis/mantis-files/) . I also copy the file to this path but I also get ann HTTP-Error 400 whne I try to download the file.

Can anybody help me, please
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Update mantis 2.21 can not download/upload attachments

Post by cas »

Did you run admin/check script to have your installation checked?
Obvious question is if you reviewed the access rights on the various directories?

So how did you update? Just used the dump and loaded that in a fresh install of the 2.19 version ( why not the latest 2.21?)?
It would have been better to first upgrade and then move or first move and then upgrade. In both cases you could have used the standard upgrade facilities of mantis itself. There is also documentataion about how to move an installation from one server to another.
uv_jfuchs
Posts: 13
Joined: 17 May 2019, 11:20

Re: Update mantis 2.21 can not download/upload attachments

Post by uv_jfuchs »

Hi,
yes i run admin/check script. The only error i see is that the version of mysql is out of support.
MySQL version is within the Extended Support period (GA + 8 years)
Support for the release of MySQL you are using (5.5.60) ended on 03.12.2018 00:00:00. It should not be used, as security flaws discovered in this version will not be fixed.

Version of MySQL being used is within the Premier Support period (GA + 5 years)
Premier Support for the release of MySQL you are using (5.5.60) ended on 03.12.2015 00:00:00. The release is in its Extended support period, which ends on 03.12.2018 00:00:00. You should upgrade to a newer version of MySQL which is still within its Premier support period to benefit from bug fixes and security patches. WARN

Yes I used the dump and loaded that in a fresh install of the latest 2.21.
On the old server i can not install mantis 2.21 and mantis 1.2.19 is very old and I dont know if it will be run on the new server.
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Update mantis 2.21 can not download/upload attachments

Post by cas »

I would still opt to use the standard upgrade mode.
Possible you do it on a local workstation and then move it back to the new server.
uv_jfuchs
Posts: 13
Joined: 17 May 2019, 11:20

Re: Update mantis 2.21 can not download/upload attachments

Post by uv_jfuchs »

Hi,
I did a fresh install on a sandbox system without database import.
I also get the error:

APPLICATION ERROR #0

An error occurred during this action. You may wish to report this error to your local administrator.
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.

In the mantis Log I see
17.05.2019 15:27:03 DB file_api.php:644 diskfile_is_name_unique() array (
0 => 'SELECT count(*)
FROM (
SELECT diskfile FROM mantis_bug_file_table WHERE diskfile=\'/var/www/html/mantis-files/632662a5fa774cc98605da72ec11ad75\'
UNION
SELECT diskfile FROM mantis_project_file_table WHERE diskfile=\'/var/www/html/mantis-files/632662a5fa774cc98605da72ec11ad75\'
) f',
1 => '0.0006',
)
17.05.2019 15:27:03 DB project_hierarchy_api.php:167 project_hierarchy_cache() array (
0 => 'SELECT DISTINCT p.id, ph.parent_id, p.name, p.inherit_global, ph.inherit_parent
FROM mantis_project_table p
LEFT JOIN mantis_project_hierarchy_table ph
ON ph.child_id = p.id
WHERE p.enabled = \'1\'
ORDER BY p.name',
1 => '0.0007',
)
17.05.2019 15:27:03 DB user_api.php:1174 user_get_accessible_subprojects() array (
0 => 'SELECT DISTINCT p.id, p.name, ph.parent_id
FROM mantis_project_table p
LEFT JOIN mantis_project_hierarchy_table ph
ON ph.child_id = p.id
WHERE p.enabled = \'1\' AND
ph.parent_id IS NOT NULL
ORDER BY p.name',
1 => '0.0002',
)
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Update mantis 2.21 can not download/upload attachments

Post by cas »

you got this message during the install?
If not, which action triggered the message?
uv_jfuchs
Posts: 13
Joined: 17 May 2019, 11:20

Re: Update mantis 2.21 can not download/upload attachments

Post by uv_jfuchs »

No I got this message when I push the "add Note"-Button for a not wit attachments.
config_inc.txt
config_inc.php
(1.84 KiB) Downloaded 362 times
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Update mantis 2.21 can not download/upload attachments

Post by cas »

Does this also happens when adding a note without attachment?
If not, did you verify rights on the directories?
uv_jfuchs
Posts: 13
Joined: 17 May 2019, 11:20

Re: Update mantis 2.21 can not download/upload attachments

Post by uv_jfuchs »

Hi,
when I add a note withoput attachment it works without any problem.
Thet rights of the directory are ciorecct in my opinion.
ll /var/www/html/
drwxr-xr-x. 2 apache apache 6 20. Mai 08:53 mantis-files
ll /var/www/html/mantis-files
drwxr-xr-x. 2 apache apache 6 20. Mai 08:53 .
drwxr-xr-x. 17 root root 12288 20. Mai 08:53 ..
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Update mantis 2.21 can not download/upload attachments

Post by cas »

I would try so give full access to the files directory (777), if it then works, try to restrict as far as needed.
uv_jfuchs
Posts: 13
Joined: 17 May 2019, 11:20

Re: Update mantis 2.21 can not download/upload attachments

Post by uv_jfuchs »

Hi,
I have change the permissions to 777, but it still not work.
21.05.2019 10:59:14 DB database_api.php:161 db_connect() array (
0 => 'SET NAMES UTF8',
1 => '0.0001',
)
21.05.2019 10:59:14 DB plugin_api.php:906 plugin_register_installed() array (
0 => 'SELECT basename, priority, protected FROM mantis_plugin_table WHERE enabled=\'1\' ORDER BY priority DESC',
1 => '0.0001',
)
21.05.2019 10:59:14 DB authentication_api.php:1062 auth_is_cookie_valid() array (
0 => 'SELECT * FROM mantis_user_table WHERE cookie_string=\'WOPD6Hl7h3Tvqn_Fo47vsOZOSwdWBm0mnKpWTev3al7XAGT6FeSZgMd69bOatW6c\'',
1 => '0.0005',
)
21.05.2019 10:59:14 DB user_pref_api.php:334 user_pref_cache_array_rows() array (
0 => 'SELECT * FROM mantis_user_pref_table WHERE user_id IN (2) AND project_id = 0',
1 => '0.0002',
)
21.05.2019 10:59:14 DB project_api.php:109 project_cache_row() array (
0 => 'SELECT * FROM mantis_project_table WHERE id=\'1\'',
1 => '0.0001',
)
21.05.2019 10:59:14 DB config_api.php:728 config_cache_all() array (
0 => 'SELECT config_id, user_id, project_id, type, value, access_reqd FROM mantis_config_table',
1 => '0.0001',
)
21.05.2019 10:59:14 DB tokens_api.php:254 token_purge_expired() array (
0 => 'DELETE FROM mantis_tokens_table WHERE 1558429154 > expiry',
1 => '0.0003',
)
21.05.2019 10:59:14 DB tokens_api.php:85 token_get() array (
0 => 'SELECT * FROM mantis_tokens_table WHERE type=5 AND owner=2',
1 => '0.0004',
)
21.05.2019 10:59:14 DB bug_api.php:868 bug_cache_row() array (
0 => 'SELECT * FROM mantis_bug_table WHERE id=1',
1 => '0.0004',
)
21.05.2019 10:59:14 DB bug_api.php:975 bug_text_cache_row() array (
0 => 'SELECT bt.* FROM mantis_bug_text_table bt, mantis_bug_table b
WHERE b.id=1 AND b.bug_text_id = bt.id',
1 => '0.0002',
)
21.05.2019 10:59:14 DB file_api.php:669 file_is_name_unique() array (
0 => 'SELECT COUNT(*) FROM mantis_bug_file_table WHERE filename=\'mantis.txt\' AND bug_id=1',
1 => '0.0009',
)
21.05.2019 10:59:14 DB file_api.php:644 diskfile_is_name_unique() array (
0 => 'SELECT count(*)
FROM (
SELECT diskfile FROM mantis_bug_file_table WHERE diskfile=\'/var/www/html/mantis-files/13220a28749276617a30f8adcac3f9b0\'
UNION
SELECT diskfile FROM mantis_project_file_table WHERE diskfile=\'/var/www/html/mantis-files/13220a28749276617a30f8adcac3f9b0\'
) f',
1 => '0.0008',
)
21.05.2019 10:59:14 DB project_hierarchy_api.php:167 project_hierarchy_cache() array (
0 => 'SELECT DISTINCT p.id, ph.parent_id, p.name, p.inherit_global, ph.inherit_parent
FROM mantis_project_table p
LEFT JOIN mantis_project_hierarchy_table ph
ON ph.child_id = p.id
WHERE p.enabled = \'1\'
ORDER BY p.name',
1 => '0.0006',
)
21.05.2019 10:59:14 DB user_api.php:1174 user_get_accessible_subprojects() array (
0 => 'SELECT DISTINCT p.id, p.name, ph.parent_id
FROM mantis_project_table p
LEFT JOIN mantis_project_hierarchy_table ph
ON ph.child_id = p.id
WHERE p.enabled = \'1\' AND
ph.parent_id IS NOT NULL
ORDER BY p.name',
1 => '0.0002',
)
21.05.2019 10:59:14 DB tokens_api.php:85 token_get() array (
0 => 'SELECT * FROM mantis_tokens_table WHERE type=3 AND owner=2',
1 => '0.0005',
)
21.05.2019 10:59:14 DB user_api.php:1489 user_update_last_visit() array (
0 => 'UPDATE mantis_user_table SET last_visit=1558429154 WHERE id=2',
1 =>
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Update mantis 2.21 can not download/upload attachments

Post by cas »

I run a similar setup without any issues, so Mantis does work on the platform.
there are files in that directory, correct?
So you copied them yourself or how did they get there?
Richts on the existing files have also been adjusted?
uv_jfuchs
Posts: 13
Joined: 17 May 2019, 11:20

Re: Update mantis 2.21 can not download/upload attachments

Post by uv_jfuchs »

Hi,
on my sandbox-system there are no files in the directory.
On my productionsystem are the files in the directory. I have done a rsync with the files copy them to the new directory. So I think the rights must be correct.
uv_jfuchs
Posts: 13
Joined: 17 May 2019, 11:20

Re: Update mantis 2.21 can not download/upload attachments

Post by uv_jfuchs »

Hi,
i fixed the problem.
On the old server with PHP5 the file_upload_method was in quotes.
$g_file_upload_method = 'DISK';
On the new server with PHP7.3.5 it only works without quotes.
$g_file_upload_method = DISK;

Why did the admin/check script dont check this settings?
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Update mantis 2.21 can not download/upload attachments

Post by cas »

No clue but luckily issue has been resolved :D
Post Reply