Closed Bug 244324 Opened 20 years ago Closed 20 years ago

bugzilla-submit crashes when incorrect base url provided.


(Bugzilla :: Bug Import/Export & Moving, defect)

Not set



Bugzilla 2.20


(Reporter: afw, Assigned: kiko)



(2 files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.2) Gecko/20040301
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.2) Gecko/20040301

[alan@jambutty bugzilla-submit]$ bugzilla-submit < bug.txt
<!-- -->
<!-- -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <title>Bugzilla Main Page</title>
  <body bgcolor="#FFFFFF" onload="">
<!-- -->
    <table bgcolor="#000000" width="100%" border="0" cellpadding="0"
          <font color="#FFFFFF" size="8"><center>
            Bugzilla Version 2.16.5
    <table border="0" cellspacing="0">
        <td valign="top" align="left">
          <table border="0" cellpadding="0" cellspacing="2">
              <td valign="top" align="left" nowrap="nowrap">
                <font size="+1"><b>Bugzilla Main Page</b></font>
        <td valign="middle">&nbsp;</td>
        <td valign="middle" align="left"></td>
<script type="text/javascript" language="JavaScript">
function addSidebar() {
      if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel
== "function"))
         window.sidebar.addPanel ("Bugzilla",
"", "");
         var rv = window.confirm ("This page is enhanced for use with Netscape
6.  " + "Would you like to upgrade now?");
         if (rv)
            document.location.href = "";
<table width="100%"><tr>
  <p>This is where we put in lots of nifty words explaining all about Bugzilla.</p>
  But it all boils down to a choice of:
  <a href="query.cgi">Query existing bug reports</a><br>
  <a href="enter_bug.cgi">Enter a new bug report</a><br>
  <a href="reports.cgi">Get summary reports</a><br>
  <a href="query.cgi?GoAheadAndLogIn=1">Log in to an existing account</a><br>
  <a href="createaccount.cgi">Open a new Bugzilla account</a><br>
  <a href="javascript:addSidebar()">Add to Sidebar</a> (Requires Mozilla or
Netscape 6)<br>
  <form name="f" action="show_bug.cgi" method="get"
      onsubmit="QuickSearch(; return false;">
  Enter a bug # or some search terms:<br>
  <input type="text" name="id">
  <input type="submit" value="Show">
  <a href="quicksearch.html">[Help]</a>
 <td align="right"><img src="ant.jpg" width="329" height="220" border="2"
alt="ant.jpg [8.5k]"></td>
<script type="text/javascript" language="JavaScript" src="localconfig.js"></script>
<script type="text/javascript" language="JavaScript" src="quicksearch.js"></script>
<script type="text/javascript">
<!-- -->
<table border="0">
    <td bgcolor="#000000" valign="top">
      <table border="0" cellpadding="10" cellspacing="0" width="100%"
           This is <b>Bugzilla</b>: the Mozilla bug system.  For more
            information about what Bugzilla is and what it can do, see
            <a href=""></a>.
<!-- -->
<form method="get" action="show_bug.cgi">
  <table width="100%">
      <td valign="middle" nowrap>
        <a href="enter_bug.cgi">New</a> |
        <a href="query.cgi">Query</a> |
        <input type="submit" value="Find"> bug #
        <input name="id" size="6"> |
        <a href="reports.cgi">Reports</a>
      <td valign="middle" align="right">
        <a href="createaccount.cgi">New&nbsp;Account</a> |
        <a href="query.cgi?GoAheadAndLogIn=1">Log&nbsp;In</a>
bugzilla-submit: Internal error: bug id not found; please report a bug

Here is the input stream:
Product: TestProduct
Component: TestComponent
Priority: P3
Version: other
Severity: critical
Summary: Zounds!! Engines overheating!
Comment: Coolant depleted.

Here is the .netrc

machine         ""
password        xxxxxxxxx

Reproducible: Always
Steps to Reproduce:
1.Just run bugzilla-submit from the command line.
2.It blows up.

Expected Results:  
bugzilla-submit seems to be very unstable.  I have tried it about 100 times.
It actually worked four times.  Usually it fails with the message:

bugzilla-submit: no credentials for Bugzilla instance at

The credentials are fine because:

1.  It works 4/100 times.  I didn't change the .netrc

2.  Using the same email-addr/passwd, I can log in to the bugzilla instance via
  the browser.

This facility would be very useful, if only it worked reliably.
What version of Python do you have on your system?  (output of 'python -V')
Assignee: justdave → kiko
Summary: b ugzilla-submit crashed → bugzilla-submit crashed
Oh, I think I see what's going on from your command line.  "index.cgi" is not
part of your Bugzilla system's base url.  Leave that off.  Both on the command
line and in .netrc

bugzilla-submit may be smart enough to chop it off itself, but the fact that you
have it in .netrc that was is probably what's causing the auth failures. 
bugzilla-submit submits to post_bug.cgi, and your .netrc only suggests a
password to use for index.cgi (instead of for the entire bugzilla)
1.  I am using python version 2.3.3

2.  When I take the /index.cgi suffix off of the URL in .netrc and off
    of the URL on the command line, bugzilla-submit still blows up in
    the same way.  I also tried appending /post_bug.cgi to both URLs,
    and it still fails the same way.
I think it needs the slash on the end...

My .netrc looks like this:

    machine ""
    password *****

from my test that worked.

Otherwise, except as an occasional user of it, I don't know a whole lot about
it, so we'll probably have to wait for kiko to get more ideas to try.
Thank you.  The slash did it. 
Here is the winning URL:

Just an opinion...
There may be two bugs here.
1. Bugzilla-submit shouldn't blow up for lack of a trailing slash.
2. More importantly, the documentation should explain exactly what
   is meant for the "machine" field of the .netrc and for the
   "bugzilla-url" on the command line.

From my point of view, however, this problem is solved.
I've recently added a fix to CVS that should at least solve the slash issue:

date: 2004/04/13 18:52:50;  author:;  state: Exp;  lines: +10 -0
Add a slightly hackish approach to test against values in .netrc that
diverge from the specified url by a trailing slash -- we *know* they're
not the same thing, but it seems people want us to think they are!

I'll have a look into the documentation next.
Ever confirmed: true
Attached patch manpage updateSplinter Review
Here's the update I'm checking in, quickly reviewed by justdave. It states
clearly that urlbase is what you should use and even adds a .netrc example.
Comment on attachment 153363 [details] [diff] [review]
manpage update

xml doesn't validate with this.

l:191: element listitem: validity error : Element listitem content does not
follow the DTD, expecting (calloutlist | glosslist | itemizedlist | orderedlist
| segmentedlist | simplelist | variablelist | caution | important | note | tip
| warning | literallayout | programlisting | programlistingco | screen |
screenco | screenshot | synopsis | cmdsynopsis | funcsynopsis | classsynopsis |
fieldsynopsis | constructorsynopsis | destructorsynopsis | methodsynopsis |
formalpara | para | simpara | address | blockquote | graphic | graphicco |
mediaobject | mediaobjectco | informalequation | informalexample |
informalfigure | informaltable | equation | example | figure | table | msgset |
procedure | sidebar | qandaset | anchor | bridgehead | remark | highlights |
abstract | authorblurb | epigraph | indexterm | beginpage)+, got (para para
screen CDATA application CDATA)

I think the following chunk:

>+Note that the machine entry should match exactly the instance URL
>+specified to <application>bugzilla-submit</application>.

needs to have <para></para> wrapped around it.
Attachment #153363 - Flags: review-
Checked in with added para tags.
Summary: bugzilla-submit crashed → bugzilla-submit crashes when incorrect base url provided.
This code checks if the user specified a 404ing URL, or one that doesn't point
to the toplevel directory (via a hack, okay, but it works).
Checked in code, hopefully making bz-submit more robust under pressure.
Closed: 20 years ago
Resolution: --- → FIXED
Target Milestone: --- → Bugzilla 2.20
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.