Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Cannot write to reports dir


#1

I should have my reports dir permissioned correctly. Attachments works fine the difference I see is reports is trying to create a Directory while attachments does not. This is on CentOS

When I try to generate a TestRail report I get

ould not create output directory for report: no report directory configured or insufficient permissions (/opt/testrail/reports/2015/01/report-33-9bff32a3-da15-4348-a631-a91b6128205b).


Details:
File: /usr/local/nginx/html/testrail/sys/helpers/ex.php
Line: 25
Status Code: 500
Host:
Uri: ()

Browser:
PHP: 5.3.3
Server: Linux 2.6.32-504.3.3.el6.x86_64 #1 SMP Wed Dec 17 01:55:02 UTC 2014 x86_64

Trace:
at ex::raise (ex.php:25)
at ex::raise (ex.php:43)
at ex::raisev (ex.php:73)
at ex::raiset (reports.php:672)
at reports::run (reports.php:98)
at Reports_job->_run_report (reports.php:44)
at Reports_job->run (tasks.php:166)
at Tasks_controller->_run_job (tasks.php:135)
at Tasks_controller->_process_job (tasks.php:66)
at Tasks_controller->_run (tasks.php:55)
at Tasks_controller->index (controller.php:80)
at Controller->_invoke_cli (controller.php:70)
at Controller->_invoke (gizmo.php:101)
at require_once (index.php:106)
at require_once (task.php:46)


#2

Hello,

Thanks for your posting. Please check that the configured report directory (and all sub-directories) is fully writable by the web server user. You can check this for the report directory itself under Administration > Site Settings > Application. Please also apply the same permissions to all sub-directories and files (under /opt/testrail/reports).

It’s also important that the background task is run with the same user account as the web server (e.g. www-data or apache):

http://docs.gurock.com/testrail-admin/howto-background-task#background_task_on_unixlinux

(the difference between attachments and reports is that reports are created/saved by the background task and attachments by the web server)

I hope this helps and please let me know in case you have any further questions.

Regards,
Tobias