CLI does not tell users to issue a "refresh" when the API gets out of date

Bug #1329267 reported by Alexander List on 2014-06-12
28
This bug affects 3 people
Affects Status Importance Assigned to Milestone
MAAS
Critical
Gavin Panella
1.7
Critical
Gavin Panella
maas (Ubuntu)
Undecided
Unassigned

Bug Description

I try to list boot images using the CLI.

In case there are none, I expect the CLI to tell me so, and not dump a 404 from the web server.

$ maas maas boot-images -h
usage: /usr/lib/python2.7/dist-packages/maascli/__main__.py maas boot-images
       [-h] COMMAND ...

optional arguments:
  -h, --help show this help message and exit

drill down:
  COMMAND
    report-boot-images
                      Report images available to net-boot nodes from.
    read

$ maas maas boot-images report-boot-images
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Language" content="en-us" />
    <link rel="shortcut icon" href="/MAAS/static/img/favicon.ico"/>

    <link rel="stylesheet" href="/MAAS/combo/maas/?css/base.css&css/typography.css&css/forms.css&css/layout.css&css/modifiers.css&css/components/flash_messages.css&css/components/pagination.css&css/components/table_list.css&css/components/title_form.css&css/components/blocks.css&css/components/yui_panel.css&css/components/yui_overlay.css&css/components/yui_node_add.css&css/components/data_list.css&css/components/search_box.css&css/components/slider.css&css/ubuntu-webfonts.css&css/multiselect_widget.css" />
    <title>Error: Page not found | server MAAS
</title>
    <script type="text/javascript">
<!--
var YUI_config = {
    debug: false,
    combine: true,
    filter: 'min',
    root: '',
    base: '/MAAS/combo/yui/?',
    comboBase: '/MAAS/combo/yui/?',
};
var MAAS_config = {
    uris: {
        login: '/MAAS/accounts/login/',
        statics: '/MAAS/static/',
        maas_handler: '/MAAS/api/1.0/maas/',
        nodes_handler: '/MAAS/api/1.0/nodes/',
        account_handler: '/MAAS/api/1.0/account/'
        },
    debug: false
};
// -->
</script>
<script type="text/javascript"
    src="/MAAS/combo/yui/?yui-base/yui-base-min.js">
</script>
<script type="text/javascript"
    src="/MAAS/combo/maas/?js/morph.js&js/user_panel.js&js/node_add.js&js/node.js&js/prefs.js&js/utils.js&js/node_views.js&js/longpoll.js&js/enums.js&js/power_parameters.js&js/nodes_chart.js&js/reveal.js">
</script>

</head>
<body class="">

  <div class="center-page-wrapper">
    <div class="center-page-content">

      <div id="body">
        <ul id="flash-messages">

        </ul>

          <h1 id="page-title">Error: Page not found</h1>

        <div id="content">
            <div id="sidebar"></div>

  <h2>
    The requested URL /MAAS/api/1.0/boot-images/ was not found on this server.
  </h2>

            <div class="clear"></div>
        </div>
      </div>
      <div id="footer">
        <img src="/MAAS/static/img/ubuntu_logo_footer.png" alt="Ubuntu" />

          <p>&copy; 2012 Canonical Ltd. Ubuntu and Canonical are registered
          trademarks of Canonical Ltd.
          <a class="space-left-small" href="https://maas.ubuntu.com/" target="_blank">View Documentation</a></p>

        <div class="clear"></div>
      </div>
    </div>
  </div>
</body>
</html>

$ maas maas boot-images read
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Language" content="en-us" />
    <link rel="shortcut icon" href="/MAAS/static/img/favicon.ico"/>

    <link rel="stylesheet" href="/MAAS/combo/maas/?css/base.css&css/typography.css&css/forms.css&css/layout.css&css/modifiers.css&css/components/flash_messages.css&css/components/pagination.css&css/components/table_list.css&css/components/title_form.css&css/components/blocks.css&css/components/yui_panel.css&css/components/yui_overlay.css&css/components/yui_node_add.css&css/components/data_list.css&css/components/search_box.css&css/components/slider.css&css/ubuntu-webfonts.css&css/multiselect_widget.css" />
    <title>Error: Page not found | server MAAS
</title>
    <script type="text/javascript">
<!--
var YUI_config = {
    debug: false,
    combine: true,
    filter: 'min',
    root: '',
    base: '/MAAS/combo/yui/?',
    comboBase: '/MAAS/combo/yui/?',
};
var MAAS_config = {
    uris: {
        login: '/MAAS/accounts/login/',
        statics: '/MAAS/static/',
        maas_handler: '/MAAS/api/1.0/maas/',
        nodes_handler: '/MAAS/api/1.0/nodes/',
        account_handler: '/MAAS/api/1.0/account/'
        },
    debug: false
};
// -->
</script>
<script type="text/javascript"
    src="/MAAS/combo/yui/?yui-base/yui-base-min.js">
</script>
<script type="text/javascript"
    src="/MAAS/combo/maas/?js/morph.js&js/user_panel.js&js/node_add.js&js/node.js&js/prefs.js&js/utils.js&js/node_views.js&js/longpoll.js&js/enums.js&js/power_parameters.js&js/nodes_chart.js&js/reveal.js">
</script>

</head>
<body class="">

  <div class="center-page-wrapper">
    <div class="center-page-content">

      <div id="body">
        <ul id="flash-messages">

        </ul>

          <h1 id="page-title">Error: Page not found</h1>

        <div id="content">
            <div id="sidebar"></div>

  <h2>
    The requested URL /MAAS/api/1.0/boot-images/ was not found on this server.
  </h2>

            <div class="clear"></div>
        </div>
      </div>
      <div id="footer">
        <img src="/MAAS/static/img/ubuntu_logo_footer.png" alt="Ubuntu" />

          <p>&copy; 2012 Canonical Ltd. Ubuntu and Canonical are registered
          trademarks of Canonical Ltd.
          <a class="space-left-small" href="https://maas.ubuntu.com/" target="_blank">View Documentation</a></p>

        <div class="clear"></div>
      </div>
    </div>
  </div>
</body>
</html>

# dpkg -l maas* |cat
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-===========================================================-=============================================-==============================================================================
ii maas 1.5+bzr2252-0ubuntu1~ctools0 MAAS server all-in-one metapackage
ii maas-cli 1.5+bzr2252-0ubuntu1~ctools0 MAAS command line API tool
ii maas-cluster-controller 1.5+bzr2252-0ubuntu1~ctools0 MAAS server cluster controller
ii maas-common 1.5+bzr2252-0ubuntu1~ctools0 MAAS server common files
ii maas-dhcp 1.5+bzr2252-0ubuntu1~ctools0 MAAS DHCP server
ii maas-dns 1.5+bzr2252-0ubuntu1~ctools0 MAAS DNS server
ii maas-region-controller 1.5+bzr2252-0ubuntu1~ctools0 MAAS server complete region controller
ii maas-region-controller-min 1.5+bzr2252-0ubuntu1~ctools0 MAAS Server minimum region controller

I can provide the contents of /var/log/maas via scp to a shared server, its' 21MB tarred/gzipped.

Related branches

information type: Private → Public
Alexander List (alexlist) wrote :

I don't know if this problem existed before upgrading to 1.5, but here's the upgrade information anyway:

# grep maas dpkg.log dpkg.log.1
dpkg.log.1:2014-05-21 13:22:38 upgrade maas 1.4+bzr1693+dfsg-0ubuntu2.3~ctools0 1.5+bzr2252-0ubuntu1~ctools0

Diogo Matsubara (matsubara) wrote :

Hi Alexander,

thanks for the bug report. I was able to reproduce this bug after the upgrade. After I issued:

$ maas refresh

I got them to stop returning the 404.

ubuntu@maas-precise:~$ maas maas boot-images report-boot-images
usage: /usr/lib/python2.7/dist-packages/maascli/__main__.py maas boot-images report-boot-images
       [--help] [-d] [-k] uuid [data [data ...]]
/usr/lib/python2.7/dist-packages/maascli/__main__.py maas boot-images report-boot-images: error: too few arguments

ubuntu@maas-precise:~$ maas maas boot-images read
usage: /usr/lib/python2.7/dist-packages/maascli/__main__.py maas boot-images read
       [--help] [-d] [-k] uuid [data [data ...]]
/usr/lib/python2.7/dist-packages/maascli/__main__.py maas boot-images read: error: too few arguments

Perhaps maas somehow could notify maas cli users that they need to issue a refresh on their side rather than returning a unhelpful 404.

Changed in maas:
status: New → Triaged
importance: Undecided → Medium
tags: added: cli
Raphaël Badin (rvb) on 2014-06-12
tags: added: upgrade
summary: - On upgraded MAAS 1.5, listing boot images fails
+ CLI does not tell users to issue a "refresh" when the API gets out of
+ date
Raphaël Badin (rvb) on 2014-07-23
Changed in maas:
importance: Medium → High
Julian Edwards (julian-edwards) wrote :

Let's get this done for the next release, it's biting a lot of people.

Changed in maas:
milestone: none → 1.7.0
Christian Reis (kiko) on 2014-10-02
Changed in maas:
milestone: 1.7.0 → next
Christian Reis (kiko) on 2014-10-30
Changed in maas:
milestone: next → 1.7.1
Graham Binns (gmb) on 2014-11-27
Changed in maas:
status: Triaged → In Progress
assignee: nobody → Graham Binns (gmb)
Graham Binns (gmb) on 2014-11-27
Changed in maas:
status: In Progress → Invalid
status: Invalid → In Progress
Changed in maas:
milestone: 1.7.1 → 1.7.2
Graham Binns (gmb) on 2014-12-12
Changed in maas:
status: In Progress → Triaged
assignee: Graham Binns (gmb) → nobody
Christian Reis (kiko) wrote :

Bumped to critical for 1.7.2 as anyone upgrading from 1.5 will have a broken client (until they refresh).

Changed in maas:
importance: High → Critical
Changed in maas:
milestone: 1.7.2 → 1.7.3
Gavin Panella (allenap) on 2015-04-21
Changed in maas:
assignee: nobody → Gavin Panella (allenap)
status: Triaged → In Progress
Changed in maas:
milestone: 1.7.3 → 1.8.0
Gavin Panella (allenap) on 2015-04-30
Changed in maas:
status: In Progress → Fix Committed

Hello Alexander, or anyone else affected,

Accepted maas into utopic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/maas/1.7.5+bzr3369-0ubuntu1~14.10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed
Changed in maas:
status: Fix Committed → Fix Released
Andres Rodriguez (andreserl) wrote :

This issue has been verified to work both on upgrade and fresh install, and has been QA'd. Marking verification-done.

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package maas - 1.7.6+bzr3376-0ubuntu2~14.04.1

---------------
maas (1.7.6+bzr3376-0ubuntu2~14.04.1) trusty; urgency=medium

  * debian/control: Make maas-dns a Dependy of maas-region-controller.
  * debian/maas-region-controller.postinst: Ensure DNS config migration is
    always run. (LP: #1413388)

 -- Andres Rodriguez <email address hidden> Fri, 10 Jul 2015 13:47:40 -0400

Changed in maas (Ubuntu):
status: New → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package maas - 1.7.6+bzr3376-0ubuntu2~15.04.1

---------------
maas (1.7.6+bzr3376-0ubuntu2~15.04.1) vivid; urgency=medium

  * debian/control: Make maas-dns a Dependy of maas-region-controller.
  * debian/maas-region-controller.postinst: Ensure DNS config migration is
    always run. (LP: #1413388)

 -- Andres Rodriguez <email address hidden> Fri, 10 Jul 2015 13:47:40 -0400

Changed in maas (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers