Lot of alias usage : Bad Gateway

community-help

#1

I’m using a lot of aliases in my query (more than 50). The following sometimes gives “Bad Gateway” error :

{
  rateLimit {
    cost
  }
  repository(owner: "torvalds", name: "linux") {
    ref(qualifiedName: "master") {
      target {
        ... on Commit {
          path0: history(first: 1, path: ".cocciconfig") {
            ...MessageFragment
          }
          path1: history(first: 1, path: ".get_maintainer.ignore") {
            ...MessageFragment
          }
          path2: history(first: 1, path: ".gitattributes") {
            ...MessageFragment
          }
          path3: history(first: 1, path: ".gitignore") {
            ...MessageFragment
          }
          path4: history(first: 1, path: ".mailmap") {
            ...MessageFragment
          }
          path5: history(first: 1, path: "COPYING") {
            ...MessageFragment
          }
          path6: history(first: 1, path: "CREDITS") {
            ...MessageFragment
          }
          path7: history(first: 1, path: "Documentation") {
            ...MessageFragment
          }
          path8: history(first: 1, path: "Documentation/.gitignore") {
            ...MessageFragment
          }
          path9: history(first: 1, path: "Documentation/00-INDEX") {
            ...MessageFragment
          }
          path10: history(first: 1, path: "Documentation/ABI") {
            ...MessageFragment
          }
          path11: history(first: 1, path: "Documentation/ABI/README") {
            ...MessageFragment
          }
          path12: history(first: 1, path: "Documentation/ABI/obsolete") {
            ...MessageFragment
          }
          path13: history(first: 1, path: "Documentation/ABI/obsolete/sysfs-bus-usb") {
            ...MessageFragment
          }
          path14: history(first: 1, path: "Documentation/ABI/obsolete/sysfs-driver-hid-roccat-arvo") {
            ...MessageFragment
          }
          path15: history(first: 1, path: "Documentation/ABI/obsolete/sysfs-driver-hid-roccat-isku") {
            ...MessageFragment
          }
          path16: history(first: 1, path: "Documentation/ABI/obsolete/sysfs-driver-hid-roccat-koneplus") {
            ...MessageFragment
          }
          path17: history(first: 1, path: "Documentation/ABI/obsolete/sysfs-driver-hid-roccat-konepure") {
            ...MessageFragment
          }
          path18: history(first: 1, path: "Documentation/ABI/obsolete/sysfs-driver-hid-roccat-kovaplus") {
            ...MessageFragment
          }
          path19: history(first: 1, path: "Documentation/ABI/obsolete/sysfs-driver-hid-roccat-kovaplus") {
            ...MessageFragment
          }
          path20: history(first: 1, path: "Documentation/ABI/obsolete/sysfs-driver-hid-roccat-kovaplus") {
            ...MessageFragment
          }
          path21: history(first: 1, path: "Documentation/ABI/obsolete/sysfs-driver-hid-roccat-kovaplus") {
            ...MessageFragment
          }
          path22: history(first: 1, path: "Documentation/ABI/obsolete/sysfs-driver-hid-roccat-kovaplus") {
            ...MessageFragment
          }
          path23: history(first: 1, path: "Documentation/ABI/obsolete/sysfs-driver-hid-roccat-kovaplus") {
            ...MessageFragment
          }
          path24: history(first: 1, path: "Documentation/ABI/obsolete/sysfs-driver-hid-roccat-kovaplus") {
            ...MessageFragment
          }
          path25: history(first: 1, path: "Documentation/ABI/obsolete/sysfs-driver-hid-roccat-kovaplus") {
            ...MessageFragment
          }
          path26: history(first: 1, path: "Documentation/ABI/obsolete/sysfs-driver-hid-roccat-kovaplus") {
            ...MessageFragment
          }
          path27: history(first: 1, path: "Documentation/ABI/obsolete/sysfs-driver-hid-roccat-kovaplus") {
            ...MessageFragment
          }
          path28: history(first: 1, path: "Documentation/ABI/obsolete/sysfs-driver-hid-roccat-kovaplus") {
            ...MessageFragment
          }
          path29: history(first: 1, path: "Documentation/ABI/obsolete/sysfs-driver-hid-roccat-kovaplus") {
            ...MessageFragment
          }
        }
      }
    }
  }
}

fragment MessageFragment on CommitHistoryConnection {
  nodes {
    message
    commitUrl
    commitResourcePath
  }
}

The Bad Gateway error occurs randomly when I use between 19 & 24 aliases.
It doesn’t occur when I use 19 or less aliases. So I’m wondering if it comes from the processing time on server side which is too long & timeout triggering the error. Or is this some rate limit error ? (the cost show 1 for rateLimit value)

What could be the cause of this Bad gateway error ? What could I do to avoid it (send less alias per request ?)

Thanks a lot for your help


#2

:thinking: that’s interesting, @bertrandmartel. I suspect that it’s not necessarily about the alias usage, but instead the number of history fields in your query. I’ve added an issue to our internal tracker to investigate this.