integration_gitlab icon indicating copy to clipboard operation
integration_gitlab copied to clipboard

404 error in logs if user have no access to project

Open andreydruz opened this issue 9 months ago • 3 comments

Steps to reproduce

  1. Install plugin
  2. Open nextcloud talk and send link to issue to user, user dos not have access to this project in Gitlab
  3. See nextcloud log for errors

Expected behaviour

Not supose to be errors in log

Actual behaviour

Error in logs:

{"reqId":"2HPePL6Rp0QUrITRvgoH","level":2,"time":"2025-03-19T12:50:34+00:00","remoteAddr":"193.194.100.4","user":"gitlab_oidc-3","app":"integration_gitlab","method":"GET","url":"/ocs/v2.php/references/resolve?reference=%0Ahttps%3A%2F%2Fgitlab.uco.co.il%2Ffixdigital%2Flms.fixdigital.co.il%2F-%2Fissues%2F2203%0A","message":"GitLab API error : Client error: GET https://gitlab.uco.co.il/api/v4/projects/fixdigital%2Flms.fixdigital.co.ilresulted in a404 Not Found response:\n{\"message\":\"404 Project Not Found\"}\n","userAgent":"Mozilla/5.0 (Windows) Nextcloud-Talk v1.1.5","version":"31.0.1.2","data":{"app":"integration_gitlab"},"id":"67dabe541aac0"}

andreydruz avatar Mar 19 '25 13:03 andreydruz

Hello! This is normal response from the HTTP Client and generic log message on GitLab API reply if user have no access to it, on server side it is just API request to GitLab API, we don't have information on what user have access to. What is your suggestion on that? We could reduce loglevel to warning/info for 404 errors.

andrey18106 avatar May 21 '25 11:05 andrey18106

Yes, reduce loglevel will be good solution. We deactivate the plugin because we get 1000+ error log messages per day, and it was hard to find real errors.

Can you please point to a line of code so we will manually change it?

andreydruz avatar May 21 '25 11:05 andreydruz

Yes, reduce loglevel will be good solution. We deactivate the plugin because we get 1000+ error log messages per day, and it was hard to find real errors.

Can you please point to a line of code so we will manually change it?

This is logged here: https://github.com/nextcloud/integration_gitlab/blob/main/lib/Service/GitlabAPIService.php#L314-L321

$this->logger->warning you can change to $this->logger->info.

andrey18106 avatar May 21 '25 11:05 andrey18106