Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • C cmssam
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Jira
    • Jira
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • etf
  • cmssam
  • Merge requests
  • !18

Merged
Created Jan 29, 2020 by John Thiltges@jthiltgeContributor

Catch GitLab outages in org.cms.WN-basic

  • Overview 0
  • Commits 1
  • Changes 1

In fetch-from-web-GitLab, add --fail flag to curl, giving a a non-zero return code for failed downloads.

When GitLab is down, the SAM test returns CRITICAL, rather than WARNING

Ex. http://wlcg-sam-cms.cern.ch/dashboard/request.py/metricOutput?host=red-gw2.unl.edu&time=2020-01-28T06:07:28Z&metricfqan=org.cms.WN-basic%20(_cms_Role_lcgadmin)

Adding the --fail flag to curl will result in a non-zero return code for failed GitLab requests, and should hopefully sort this out.

Curl examples:

A successful curl returns 0, as expected

$ curl http://t2.unl.edu/hello.txt
hello
$ echo $?
0

With an unsuccessful 404, curl also returns 0

$ curl http://t2.unl.edu/goodbye.txt
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /goodbye.txt was not found on this server.</p>
</body></html>
$ echo $?
0

Adding the --fail flag causes a non-zero return code for the failed attempt

$ curl --fail http://t2.unl.edu/goodbye.txt
curl: (22) The requested URL returned error: 404 Not Found
$ echo $?
22
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: web-gitlab-rc