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

Issues with Editing users - Field User is not a valid user error


#1

Every time I click on the user to edit the user’s profile, I get an error message in the Pink ribbon at the top of the page “Field User is not a valid user.”

If I look at the logs, I get the followig:

[E] 2019-01-08 04:10:33 [31ms]: [DeniedException] The CSRF token is missing or invalid for this POST request.
This usually means that your session has expired. Please refresh this page.

Details:
File: /var/www/html/sys/helpers/ex.php
Line: 25
Status Code: 500
Host: testrail.dematic.com
Uri: /index.php?/runs/ajax_render_tests (POST)

Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
PHP: 7.0.32-0ubuntu0.16.04.1
Server: Linux 4.11.0-1013-azure #13-Ubuntu SMP Mon Oct 2 17:59:06 UTC 2017 x86_64

columns: {“tests:id”:100,“cases:title”:0,“tests:assignedto_id”:125}
group_by: cases:section_id
group_order: asc
user_ids:
run_id: 1246
display: tree
group_id: 33390
include_sidebar: 1
save_columns:
_token: 5r1gNv/GqzWqkqKL8QYF
_version: 5.4.0.3659

Trace:
at ex::raise (ex.php:77)
at ex::raiset (application.php:183)
at ApplicationController->_check_for_csrf (protected.php:20)
at ProtectedController->_init (runs.php:15)
at Runs_controller->_init (gizmo.php:106)
at unknown (index.php:106)

[E] 2019-01-08 07:48:02 [0ms]: [UriException] Invalid characters in GET: [amp;group_by] [cases:section_id]

Details:
File: /var/www/html/sys/core/uri.php
Line: 103
Status Code: 500
Host: testrail.dematic.com
Uri: /index.php?/suites/view/439&group_by=cases:section_id&group_order=asc&group_id=51166 (GET)

Browser: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
PHP: 7.0.32-0ubuntu0.16.04.1
Server: Linux 4.11.0-1013-azure #13-Ubuntu SMP Mon Oct 2 17:59:06 UTC 2017 x86_64

Trace:
at Uri_core->_parse (uri.php:22)
at Uri_core->init (:)
at call_user_func_array (services.php:90)
at ServicesImpl->_create (services.php:59)
at ServicesImpl->get (services.php:77)
at ServicesImpl->_create (services.php:59)
at ServicesImpl->get (services.php:27)
at Services::get (gizmo.php:72)
at unknown (index.php:106)

[E] 2019-01-08 15:17:48 [29ms]: [DeniedException] The CSRF token is missing or invalid for this POST request.
This usually means that your session has expired. Please refresh this page.


#2

That is an odd situation. Do you have another computer to try it on?


#3

Hi Nenad,

Thank you for posting! The error message ‘Field User is not a valid user’ indicates that you are trying to open the Edit User page for a user ID that does not exist in the TestRail database. This could be caused by a user trying to navigate directly to the Edit User page via a URL that does not contain a valid user ID. This error could also be caused by someone deleting a user directly from the TestRail database while another user is already on the Users & Roles page. Please note that users should never directly write to, delete, or change anything in TestRail’s database. This could break the consistency of the database, even small changes you might find unproblematic, and your TestRail instance would be immediately unsupported. You wouldn’t be able to upgrade anymore and we wouldn’t be able to support the instance anymore.

The other error messages you have provided from your logs are unrelated to the issue with the invalid user ID. The ‘The CSRF token is missing or invalid for this POST request.’ error could indicate that the submitted form did not include all of the required form fields. This could mean either a browser, connection, or proxy issue if the user uses a proxy. This could also indicate a user was logged out of the system due to inactivity and the next page request produced this error. This is generally a non-critical error message and usually just means the user needs to sign in to TestRail again. The ‘Invalid characters in GET’ error message indicates an invalid character was included in the URL you attempted to reach. If you are copying and pasting a link, please make sure that no unsupported characters are added.

I hope this helps!

Regards,
John


#4

Hi John,

The reason for this error was a “no space left on the disk” on the VM that’s hosting testrail server, if you can believe It…

Once we did the disk cleanup, I was able to edit users – you can close off that request

Thank you

Nenad Jovanovic

Sr. DevOps Engineer

Mobile: 226.772.7321

DEMATIC


#5

Hi Nenad,

Thanks for the update - I’m glad to hear that you got it working!

Regards,
John