We have a locally hosted Gitlab instance where i am facing problems with one of the API calls:
2021/11/18 16:43:11 [DEBUG] POST https://internal.testorg.com/api/v4/projects/16/terraform/state/resources?ID=784f9dd4-3536-19d2-9f78-36a2b39888e3 (status: 500): retrying in 10s (1 left)
I want to know what is the actual reason behind 500
status code.
I am not the admin of Gitlab so I might or might now have access to Gitlab host server. How can I find out a trace of what actually happened? Is there a way I can access these logs and traces?
No, even GitLab users with administrator role can't pull logs remotely via API calls or through the Admin Area. Some limited error logs may appear in the admin UI (like sidekiq errors), but there's not much of anything ordinary users can see in the UI or API or otherwise. You are more or less limited to the information returned in the HTTP response.
In general, you need system (shell) level access to the GitLab server see the logs -- or access to wherever your GitLab logs are stored (syslog server, server filesystem, etc.).
See log system for more information.
If your instance has remote monitoring setup (many companies use services like splunk and sentry to capture logs and error, for example) and you have access to those systems, you might be able to find logs that way.
Unfortunately, you may not have any good options here other than to contact your GitLab administrator for help or try to continue debugging on the client side of your issue.