TeamCity: long GET url leads to 404
The TeamCity home page get a 404 when doing a GET to the URL https://my-server.com/app/rest/builds?locator=count%3A250%2Citem%3A%28state%3Aqueued%2CbuildType%3A%28id%3APortal_Portal%29%2Cbranch%3A%28policy%3AACTIVE_HISTORY_AND_ACTIVE_VCS_BRANCHES%29%29%2Citem%3A%28state%3Arunning%2CbuildType%3A%28id%3APortal_Portal%29%2Cbranch%3A%28policy%3AACTIVE_HISTORY_AND_ACTIVE_VCS_BRANCHES%29%29%2Citem%3A%28count%3A50%2Cstrob%3A%28buildType%3A%28id%3APortal_Portal%29%2Cbranch%3A%28policy%3AACTIVE_HISTORY_AND_ACTIVE_VCS_BRANCHES%29%29%29&fields=count%2Cbuild%28id%2Cnumber%2CbranchName%2CdefaultBranch%2CqueuedDate%2CstartDate%2CfinishDate%2Chistory%2Ccomposite%2Cparallelized%2Clinks%28link%28type%2CrelativeUrl%29%29%2Ccomment%28text%2Ctimestamp%2Cuser%28id%2Cname%2Cusername%29%29%2CstatusChangeComment%28text%2Ctimestamp%2Cuser%28id%2Cname%2Cusername%29%29%2CstatusText%2Cstatus%2Cstate%2CfailedToStart%2Cpersonal%2CdetachedFromAgent%2CfinishOnAgentDate%2Cpinned%2CpinInfo%28text%2Ctimestamp%2Cuser%28id%2Cname%2Cusername%29%29%2Cuser%28id%2Cname%2Cusername%29%2Ccustomization%2CcanceledInfo%28text%2Cuser%28id%2Cname%2Cusername%29%29%2CapprovalInfo%28status%29%2Cagent%28name%2Cid%2Clinks%28link%28type%2CrelativeUrl%29%29%2Cenvironment%28osType%29%2CtypeId%2Cconnected%2Cpool%28id%2Cname%29%29%2Ctags%28tag%28name%2Cprivate%29%2C%24locator%28private%3Aany%2Cowner%3Acurrent%29%29%2Cartifacts%28%24locator%28count%3A1%29%2Ccount%3A%28%24optional%29%29%2ClimitedChangesCount%28%24optional%29%2CbuildType%28id%2Cpaused%2CinternalId%2CprojectId%2Cname%2Ctype%2Clinks%28link%28type%2CrelativeUrl%29%29%29%2Csnapshot-dependencies%28count%3A%281%29%29%2Crunning-info%28percentageComplete%2CelapsedSeconds%2CestimatedTotalSeconds%2CleftSeconds%2CprobablyHanging%2ClastActivityTime%2Coutdated%2CoutdatedReasonBuild%28number%2Clinks%28link%28type%2CrelativeUrl%29%29%29%29%2CwaitReason%2CqueuePosition%2CstartEstimate%2CfinishEstimate%2CplannedAgent%28name%2Cid%2Cenvironment%28osType%29%2CtypeId%2Cpool%28id%2Cname%29%29%2CdelayedByBuild%28id%2Cnumber%2Cstatus%2Cstate%2CfailedToStart%2Cpersonal%2CcanceledInfo%2CbuildType%28id%29%29%2Ctriggered%28date%2CdisplayText%2CbuildType%28id%2Cpaused%2CinternalId%2CprojectId%2Cname%2Ctype%2Clinks%28link%28type%2CrelativeUrl%29%29%29%29%29 This 2216 character URL works just fine on localhost (without the reverse proxy), but some reverse proxy in front of it (CloudFlare or AWS or IIS) is returning a quick 404 because it's too long. If I shorten the URL to
Please sign in to leave a comment.
In the meantime, you can check the maxQueryString value on IIS and the URL length limit on CloudFlare and adjust them if necessary.
Yes, setting the IIS query max lengths solved the issue. https://stackoverflow.com/questions/8159321/request-exceeds-the-configured-maxquerystringlength-when-using-authorize highlighted the necessary config changes.