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 

 
Because of this URL too long issue, the TeamCity dashboard shows "No Builds" on the projects page and most other pages.  Consider making this URL significantly shorter, compress the URL before sending it, or only send the parameters that are unique to this page and not a full diary of every table in the database.
0
2 comments
Hi! Could you specify the TeamCity version and state which UI action causes the error? Can you create a HAR file (https://www.google.com/search?q=how+to+create+har+file) while reproducing this error and upload it to https://uploads.jetbrains.com/?(don't forget to specify the upload ID)

In the meantime, you can check the maxQueryString value on IIS and the URL length limit on CloudFlare and adjust them if necessary.
0

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.

0

Please sign in to leave a comment.