View Issue Details

IDProjectCategoryView StatusLast Update
0037363mantisbtapi restpublic2026-08-30 11:20
Reporterdregad Assigned Tovboctor  
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
Product Version2.29.0 
Target Version2.29.0 
Summary0037363: Error moving issue via REST API when $g_file_upload_method = DISK and attachment is missing
Description

The API fails, even when no attachments are provided in the payload, e.g. with the following request

POST {{resturl}}/issues/42601/move
Authorization: {{token}}
Content-Type: application/json

{
  "project": {
    "id": 1
  }
}

PHP Warning is thrown:
chmod(): No such file or directory in .../mantisbt/mantis/core/file_api.php on line 1433

The API returns status 200 with an HTML error page (containing an Xdebug call stack on my dev box)

The error should be caught and reported to the user with a proper HTTP status.

Steps To Reproduce
  1. Set $g_file_upload_method = DISK
  2. Create issue in project A with an attachment
  3. Delete the attachment from disk
  4. Move issue to project B via REST API
TagsNo tags attached.

Relationships

related to 0037352 resolvedvboctor REST API to Move an Issue + EVENT_MOVE_BUG event 

Activities

dregad

dregad

2026-08-30 11:20

developer   ~0071393

I also tried run the unit test testMoveIssueAddsNoteAttachment locally with the same configuration as above.
It fails too, but it's not the same error as when calling the REST API directly - move_uploaded_file() returns false for some reason.

1) Mantis\tests\Mantis\IssueMoveCommandTest::testMoveIssueAddsNoteAttachment
Mantis\Exceptions\ServiceException: Unable to move uploaded file

.../mantis/core/file_api.php:993
.../mantis/core/file_api.php:80
.../mantis/core/commands/IssueNoteAddCommand.php:275
.../mantis/core/commands/Command.php:140
.../mantis/core/commands/IssueMoveCommand.php:135
.../mantis/core/commands/Command.php:140
.../mantis/tests/Mantis/IssueMoveCommandTest.php:294
.../mantis/tests/Mantis/IssueMoveCommandTest.php:255

ERRORS!
Tests: 1, Assertions: 1, Errors: 1.