Re: 400 Bad request when creating new bug

"John P. Rouillard" <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.user
Message-ID <[email protected]>
Hi Dave:

In message <CAETHaKoN5Z8Ruxm8oOCSj_UwMKDMidp69S41ruK-hvE3P5D5gw@mail.gmail.com>
,
Dave Bender writes:
>  Although I am able to successfully create a bug, I get a 400 bad
>request error.
>
>  When I use the responsive template (roundup version 2.1.0) and I try
>to create a bug, I get the following message in the browser:
>
>400 Bad Request
>
>The URL in the browser is:
>https://example.com/example/bug2?@ok_message=msg%202%20created%0Abug%202%20created&@template=item

That's wierd. You are missing the /trackers/ component in the
redirected link. So lighttpd returns a 404.

Does:

   https://example.com/trackers/example/bug2?@ok_message=msg%202%20created%0Abug%202%20created&@template=item

work properly?

>The log shows:
>
>127.0.0.1 - - [17/Apr/2023 20:48:57] "GET /example/bug HTTP/1.1" 200 -
>127.0.0.1 - - [17/Apr/2023 20:49:10] "GET /example/bug?@template=item
>HTTP/1.1" 200 -
>127.0.0.1 - - [17/Apr/2023 20:50:06] "POST /example/bug HTTP/1.1" 302 -

This log agrees with lighttpd returning the 404. It is missing the
GET for '/example/bug2?@ok_message...'.

The code that returns the redirect to the url you report is:

         # otherwise redirect to the new item's page
        raise exceptions.Redirect('%s%s%s?@ok_message=%s&@template=%s' % (
            self.base, self.classname, self.nodeid, urllib_.quote(messages),
            urllib_.quote(self.template)))

and self.base is defined by the [tracker] web setting.

Your web setting should be

   https://example.com/trackers/example/

Can you verify that. It look like self.base is defined as:
  
  https://example.com/example/

which result in the broken redirected URL you report.

However I don't understand how the GET's and POST could be logged if
the web setting was wrong. (self.base is used to generate the link on
/example/bug for creating the new bug, and for the form that actually
create the bug.)

If your web setting is correct, let's simplify the config.  Change the
tracker to be served from:

  https://example.com/example/

by removing the lighttpd rewrite of the url and change the [tracker]
web setting then restart the Roundup server and lighttpd.

Try creating a new bug again.

Have a great day.

--
				-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.