View Issue Details

IDProjectCategoryView StatusLast Update
0013099mantisbtdb db2public2012-12-08 15:45
ReporterRichard_James Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionunable to reproduce 
PlatformIBM System i5OSIBM iOS Version7.1
Product Version1.1.0rc2 
Summary0013099: Upload file causes application error 0000401 during insert into mantis_bug_file_table
Description

This is a new install of Mantis (Mantis/400 provided by Curbstone). I would very much like to get the "Upload file" feature to work. The source file is being copied as the target file but the corresponding insert into the db2 database is failing. Please see additional information below. I have tried to do an upgrade to MantisBT 1.2.5 but without success which is likely to be a seperate issue.

Extract from config_inc.php
$g_hostname = 'GBSECO00';
$g_db_type = 'db2';
$g_database_name = 'GBSECO00';
$g_db_username = 'ZMANTIS';
$g_db_password = '**';
$g_db_schema = 'ZMANTIS';
$g_file_upload_method = DISK;
$g_absolute_path_default_upload_folder = '/mantis/uploads/';
$g_show_detailed_errors = ON;

Additional Information

APPLICATION ERROR 0000401
Database query failed. Error received from database was 0007006: Input variable CONTENT or argument 10 not valid. SQLCODE=-301 for the query: INSERT INTO mantis_bug_file_table
(bug_id, title, description, diskfile, filename, folder, filesize, file_type, date_added, content)
VALUES
(1, '', '', '/mantis/uploads/34f8192b55a7e167a2aae405071c92c4', 'DIS to FIN account translation (150-159) 2011-06-21.PDF', '/mantis/uploads/', 7694, 'application/pdf', '2011-06-23-16.43.41', '')

Full path: /www/zendsvr/htdocs/mantis400/core/database_api.php
Line: 187

Variable
Value
Type
p_query
INSERT INTO mantis_bug_file_table (bug_id, title, description, diskfile, filename, folder, filesize, file_type, date_added, content) VALUES (1, '', '', '/mantis/uploads/34f8192b55a7e167a2aae405071c92c4', 'DIS to FIN account translation (150-159) 2011-06-21.PDF', '/mantis/uploads/', 7694, 'application/pdf', '2011-06-23-16.43.41', '')
string
p_limit
-1
string
p_offset
-1
string
t_start
1308847421.3834
string
t_result

string
t_elapsed
0.0064
string
t_caller
file_api.php:682 file_add()
string

g_queries_array

Variable
Value
Type

1

Variable
Value
Type
0
SELECT id FROM mantis_user_table WHERE cookie_string='f8070fa616ea441d6603c62b8e8c14b80c78aa10ed0578d265a1391dda9eddc9'
string
1
0.0037
string
2
authentication_api.php:579 auth_is_cookie_valid()
string

2

Variable
Value
Type
0
SELECT id FROM mantis_user_table WHERE cookie_string='f8070fa616ea441d6603c62b8e8c14b80c78aa10ed0578d265a1391dda9eddc9'
string
1
0.0026
string
2
authentication_api.php:610 auth_get_current_user_id()
string

3

Variable
Value
Type
0
SELECT * FROM mantis_user_pref_table WHERE user_id='36' AND project_id='0'
string
1
0.0098
string
2
user_pref_api.php:133 user_pref_cache_row()
string

4

Variable
Value
Type
0
SELECT * FROM mantis_project_table WHERE id='0'
string
1
0.0047
string
2
project_api.php:66 project_cache_row()
string

5

Variable
Value
Type
0
SELECT config_id, user_id, project_id, type, value, access_reqd FROM mantis_config_table
string
1
0.0076
string
2
config_api.php:96 config_get()
string

6

Variable
Value
Type
0
SELECT * FROM mantis_bug_table WHERE id='1'
string
1
0.0067
string
2
bug_api.php:132 bug_cache_row()
string

7

Variable
Value
Type
0
SELECT * FROM mantis_user_table WHERE id='36'
string
1
0.0039
string
2
user_api.php:60 user_cache_row()
string

8

Variable
Value
Type
0
SELECT bt.* FROM mantis_bug_text_table bt, mantis_bug_table b WHERE b.id='1' AND b.bug_text_id = bt.id
string
1
0.0094
string
2
bug_api.php:202 bug_text_cache_row()
string

9

Variable
Value
Type
0
SELECT COUNT(*) FROM mantis_bug_file_table WHERE filename='DIS to FIN account translation (150-159) 2011-06-21.PDF' and bug_id=1
string
1
0.0034
string
2
file_api.php:559 file_is_name_unique()
string

10

Variable
Value
Type
0
SELECT * FROM mantis_project_table WHERE id='6'
string
1
0.0059
string
2
project_api.php:66 project_cache_row()
string

11

Variable
Value
Type
0
SELECT COUNT(*) FROM mantis_bug_file_table WHERE diskfile='/mantis/uploads/34f8192b55a7e167a2aae405071c92c4'
string
1
0.0030
string
2
file_api.php:538 diskfile_is_name_unique()
string

12

Variable
Value
Type
0
INSERT INTO mantis_bug_file_table (bug_id, title, description, diskfile, filename, folder, filesize, file_type, date_added, content) VALUES (1, '', '', '/mantis/uploads/34f8192b55a7e167a2aae405071c92c4', 'DIS to FIN account translation (150-159) 2011-06-21.PDF', '/mantis/uploads/', 7694, 'application/pdf', '2011-06-23-16.43.41', '')
string
1
0.0064
string
2
file_api.php:682 file_add()
string

t_backtrace

Variable
Value
Type

1

Variable
Value
Type
file
/www/zendsvr/htdocs/mantis400/bug_file_add.php
string
line
57
string
function
file_add
string

args

Variable
Value
Type
0
1
string
1
/tmp/phpcUaQAi
string
2
DIS to FIN account translation (150-159) 2011-06-21.PDF
string
3
application/pdf
string
4
bug
string
5
0
string

Filename
Line
Function
Args
/www/zendsvr/htdocs/mantis400/core/database_api.php
187
trigger_error
( '401', 256 )
/www/zendsvr/htdocs/mantis400/core/file_api.php
682
db_query
( 'INSERT INTO mantis_bug_file_table (bug_id, title, description, diskfile, filename, folder, filesize, file_type, date_added, content) VALUES (1, '', '', '/mantis/uploads/34f8192b55a7e167a2aae405071c92c4', 'DIS to FIN account translation (150-159) 2011-06-21.PDF', '/mantis/uploads/', 7694, 'application/pdf', '2011-06-23-16.43.41', '')' )
/www/zendsvr/htdocs/mantis400/bug_file_add.php
57
file_add
( 1, '/tmp/phpcUaQAi', 'DIS to FIN account translation (150-159) 2011-06-21.PDF', 'application/pdf', 'bug', 0 )

TagsNo tags attached.

Relationships

related to 0014563 closeddregad Use of literal SQL statement causes ORA-01704 error when uploading attachments 

Activities

dregad

dregad

2012-11-27 05:55

developer   ~0034402

Richard,

We are resolving this issue as "no change required", because it was reported against an old version of MantisBT which is no longer supported.

We recommend that you upgrade to the latest stable version [1]; if after doing so the problem still exists, do not hesitate to reopen the issue.

[1] https://sourceforge.net/projects/mantisbt/files/mantis-stable/

Note: it appears that the last field in the INSERT query (content) is empty, which I don't think is normal; the file's contents should be encoded as appropriate for db2 platform (you may want to refer to 0014563 which is an error in the same area for Oracle db, in case the 1.2.12 code does not fix your issue, maybe the work-in-progress patch mentioned there may be a solution)