View Issue Details

IDProjectCategoryView StatusLast Update
0036303mantisbtattachmentspublic2025-11-04 02:22
ReporterDebdutta Assigned Todregad  
PrioritynormalSeverityminorReproducibilitysometimes
Status closedResolutionfixed 
PlatformwebOSmacOS VersionmacOS 10.15
Product Version2.27.1 
Target Version2.27.2Fixed in Version2.27.2 
Summary0036303: Uploading a file when $g_antispam_max_event_count has been reached causes Dropzone to display HTML code
Description

Sometimes attachment section shows error(actually and html content) when upload a file

Steps To Reproduce

happens sometimes so could not reproduce intensionally

Additional Information

video
https://drive.google.com/file/d/1ZfTChvBAjHda6oyoks__mMIPgXYDh5gP/view?usp=sharing

TagsNo tags attached.

Relationships

related to 0036353 closeddregad When dropzone file upload finishes, progress bar keeps spinning 

Activities

dregad

dregad

2025-09-17 09:23

developer   ~0070502

Is the problem always occurring with the same specific file or file type ?
Do you see errors in the browser's console or in the server's log ?
What is happening with the dropzone.js AJAX request when the problem occurs (status code, response)?
Can you provide the complete HTML code that appears on screen in your video.

dregad

dregad

2025-09-17 09:41

developer   ~0070503

Last edited: 2025-09-17 09:48

Actually I just noticed that you scrolled down 6-7 seconds into your video, and captured a screenshot which allowed me to identify the error message I was looking for:

APPLICATION ERROR 27: You have reached the allowed activity limit of 10 events within the last 3600 seconds; your action has been blocked to avoid spam, please try again later

So the problem is caused by MantisBT's antispam settings, which are possibly too low to accommodate your user's activity. As a workaround I suggest you adjust those as appropriate ($g_antispam_max_event_count, $g_antispam_time_window_in_seconds) or wait until the antispam delay expires and try again.

That being said, I would expect the AJAX to fail gracefully in such case, and not display HTML code on the screen.

image.png (628,387 bytes)
dregad

dregad

2025-09-21 06:41

developer   ~0070512

PR https://github.com/mantisbt/mantisbt/pull/2150

dregad

dregad

2025-11-03 19:40

developer   ~0070626

@atrol why did you change the target version, it was correct

~/dev/mantisbt/mantis$ git describe --contains 0faf5a5c
release-2.27.2~11^2~1
atrol

atrol

2025-11-04 00:34

developer   ~0070628

@dregad "Fixed in Version" was set to 2.28.0, but "Target Version" was set to 2.27.2.
That was confusing to me, especially as "Status" was set to "Closed" and the issue was visible in "Changelog" of non-released version 2.28.0.
I checked that the PR was merged to master, so thought that the issue can't be targetted to 2.27.2.

dregad

dregad

2025-11-04 02:22

developer   ~0070629

Ah yes that makes sense now. It's because I had the wrong target branch on the PR when I merged it, then I made a second merge to master-2.27 but did not realize that source integration did not pick that up and changed the fixed in version. My mistake, thanks for noticing.

Related Changesets

MantisBT: master 0faf5a5c

2025-09-17 13:01

dregad


Details Diff
Prevent HTML output in Dropzone when errors occur

A somewhat hackish solution, leveraging the existing behavior in the
error handler, driven by the DISABLE_INLINE_ERROR_REPORTING constant.

When bug_report.php or bugnote_add.php are called via AJAX (as is the
case when Dropzone handles file uploads), the constant is set with a new
value of `text`. This is picked up by error_handler(), which sends the
error message in the response body as plain text.

Note: AJAX detection relies on presence of non-standard X-Requested-With
header with value 'XMLHttpRequest' (which is set by Dropzone [1]).

Fixes 0036303

[1]: https://github.com/mantisbt/mantisbt/blob/38a569855832c9d5cc63ee8bdf5a96c9b0c60e84/js/dropzone-5.5.0.js#L2446
Affected Issues
0036303
mod - bug_report.php Diff File
mod - bugnote_add.php Diff File
mod - core/error_api.php Diff File