travis.rb icon indicating copy to clipboard operation
travis.rb copied to clipboard

"travis repos" leads to "414 Request-URI Too Large" (no matter the filtering options)

Open tianon opened this issue 7 years ago • 4 comments

This is a neat project! :heart:

I was hoping that I'd be able to manage my huge list of repos (and their associated settings, especially for that new "auto-cancel" feature) via this tool, but just attempting to run travis repos fails with a 414 ("Request-URI Too Large"), even if I use filtering options like --owner tianon or --active.

While using --debug, it appears to be failing on the GET request for repos, so I'm guessing the filtering doesn't happen until after that point (didn't look into the code yet, sorry :no_mouth:).

Here's the output I get from travis repos --owner tianon --active --debug with the super-long repo ID list ellipsized (not sure whether that is sensitive data or not; I've got access to a number of private repos of which I can't publicize my access :innocent:):

$ travis repos --owner tianon --active --debug
** Loading "/host/home/tianon/.travis/config.yml"
** GET "hooks"
**   took 0.51 seconds
** GET "users/"
**   took 0.44 seconds
** GET "users/permissions"
**   took 0.46 seconds
** GET "repos/" {:ids=>[...]}
**   took 0.44 seconds
414: "<html>\r\n<head><title>414 Request-URI Too Large</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>414 Request-URI Too Large</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n"

The {:ids=>[...]} portion there has 469 numeric values in it, all ~8 digits long.

Happy to do more debugging if I can be helpful! :smile: :+1: :heart:

(Travis is :heart: :heart:)

tianon avatar Mar 29 '17 03:03 tianon

I seem to be able to get some useful data along the same lines by using travis raw instead, but it's not great (and only gives me 25 results):

$ travis raw 'repos/?member=tianon&active=true' --json | jq '.repos | length'
25
$ travis raw 'repos/?owner_name=docker-library&active=true' --json | jq '.repos | length'
25

tianon avatar Mar 29 '17 04:03 tianon

I'm seeing this as well, could you please have a look at it @BanzaiMan @rkh ?

thanks for this neat tool.

imohammedzen avatar Feb 12 '18 05:02 imohammedzen

We are also running into this issue and it is effectively stopping us from recycling tokens in an automated way. Is there any hope of getting this fixed?

mriska avatar Jul 12 '18 21:07 mriska

Workaround: In order to have something work, to print all my repos, I fiddled with the parameters in session.rb

        def fetch_many(entity, params = {})
          warn "Here we GO", params.inspect
          smaller_params = {
            ids: params[:ids].take(100)
          }
          get("/#{entity.base_path}/", smaller_params)[entity.many]
        end

That allowed me to receive the payload. Then it was possible to print out the names of the 400+ projects I had.

(I learned about the fetch_many method by using -E for "please explode on errors".)

olleolleolle avatar Jul 12 '18 21:07 olleolleolle