pkgdev icon indicating copy to clipboard operation
pkgdev copied to clipboard

pkgdev bugs: filing a stablereq with a large package list fails (urllib.error.HTTPError: HTTP Error 400: Bad Request)

Open thesamesam opened this issue 4 months ago • 2 comments

$ pkgdev --version
pkgdev 0.2.12
$ pkgdev bugs --api-key $(<~/.bugz_token) @selinux/policy
[...]
Check for open bugs matching current graph? [Yes/No] (default: No): no
Continue and create 1 stablereq bugs? [Yes/No] (default: No): yes
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.14/pkgdev", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/usr/lib/python3.14/site-packages/pkgdev/scripts/__init__.py", line 48, in main
    run(os.path.basename(sys.argv[0]))
    ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.14/site-packages/pkgdev/scripts/__init__.py", line 40, in run
    sys.exit(tool())
             ~~~~^^
  File "/usr/lib/python3.14/site-packages/snakeoil/cli/tool.py", line 81, in __call__
    ret = self.main()
  File "/usr/lib/python3.14/site-packages/pkgdev/cli.py", line 23, in main
    return super().main()
           ~~~~~~~~~~~~^^
  File "/usr/lib/python3.14/site-packages/snakeoil/cli/tool.py", line 191, in main
    self.handle_exec_exception(e)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
  File "/usr/lib/python3.14/site-packages/snakeoil/cli/tool.py", line 176, in main
    exitstatus = func(self.options, self.out, self.err)
  File "/usr/lib/python3.14/site-packages/pkgdev/scripts/pkgdev_bugs.py", line 816, in main
    d.file_bugs(options.api_key, frozenset(enabled).difference(disabled), blocks)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.14/site-packages/pkgdev/scripts/pkgdev_bugs.py", line 735, in file_bugs
    node.file_bug(api_key, auto_cc_arches, block_bugs, self.modified_repo, observe)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.14/site-packages/pkgdev/scripts/pkgdev_bugs.py", line 335, in file_bug
    with urllib.urlopen(request, timeout=30) as response:
         ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.14/urllib/request.py", line 187, in urlopen
    return opener.open(url, data, timeout)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.14/urllib/request.py", line 493, in open
    response = meth(req, response)
  File "/usr/lib/python3.14/urllib/request.py", line 602, in http_response
    response = self.parent.error(
        'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.14/urllib/request.py", line 531, in error
    return self._call_chain(*args)
           ~~~~~~~~~~~~~~~~^^^^^^^
  File "/usr/lib/python3.14/urllib/request.py", line 464, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.14/urllib/request.py", line 611, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request

This is at ::gentoo commit 759e2225ae9d69cded09fb38d125cf1d85b5c5df.

See also:

  • https://github.com/pkgcore/pkgdev/issues/141 (especially)
  • https://github.com/pkgcore/pkgdev/issues/209

thesamesam avatar Aug 31 '25 23:08 thesamesam

@thesamesam I'm afraid I'm hitting the limit of HTTP body request. It can manifest in 2 places:

  1. nginx level (I think it has some low level of 4KB)
  2. bugzilla level (no idea how to check)

I'm not sure I can solve it somehow?

arthurzam avatar Sep 01 '25 06:09 arthurzam

Yeah, I agree, broadly.

Some options:

  • Add a limit on something that is probably too large?
  • If we get a specific error code, still error but give a hint to the user what the cause is
  • Have nattka support "split package lists" (chunks) and we add multiple fields into BZ? (ew)

thesamesam avatar Sep 05 '25 12:09 thesamesam