Duplicated prefix in the url used by the CLI
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
Critical
|
Jeroen T. Vermeulen | ||
1.2 |
Fix Released
|
Critical
|
Jeroen T. Vermeulen |
Bug Description
I logged in using maas-cli but when I use any command (e.g. maas-cli maas nodes list) I get a 302 error
ubuntu@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
<html xmlns="http://
<head>
<meta http-equiv=
<meta http-equiv=
<link rel="shortcut icon" href="/
<link rel="stylesheet" href="/
<title>Login | autopkgtest MAAS
</title>
<script type="text/
<!--
var YUI_config = {
debug: false,
combine: true,
filter: 'min',
root: '',
base: '/MAAS/
comboBase: '/MAAS/
};
var MAAS_config = {
uris: {
login: '/MAAS/
statics: '/MAAS/static/',
},
debug: false
};
// -->
</script>
<script type="text/
src=
</script>
<script type="text/
src=
</script>
<script type="text/
<!--
YUI(
Y.on('load', function() {
});
});
// -->
</script>
</head>
<body class="
<div class="
<div class="
<div id="body">
<ul id="flash-
</ul>
<h1 id="page-
<div id="content">
<div id="sidebar"></div>
<h2>Login to autopkgtest MAAS
</h2>
<form method="post" action=
<input type="hidden" name="next" value="
<ul>
<li class="username">
<label for="id_username">
Username
<span class="
</label>
<input id="id_username" type="text" name="username" maxlength="30" />
<span class="
</li>
<li class="password">
<label for="id_password">
Password
<span class="
</label>
<input type="password" name="password" id="id_password" />
<span class="
</li>
<li class="
</ul>
</form>
<div class="
</div>
</div>
<div id="footer">
<img src="/MAAS/
<div class="
</div>
</div>
</div>
</body>
</html>
ubuntu@
Apache log shows this for the request:
10.98.0.90 - - [06/Nov/
Note the /MAAS/MAAS in the request. Somewhere that's been added to the request.
ubuntu@
maas http://
Shows I'm logged in successfully.
Related branches
- Julian Edwards (community): Approve
-
Diff: 177 lines (+70/-38)4 files modifiedsrc/maasserver/api.py (+5/-1)
src/maasserver/tests/test_api.py (+48/-10)
src/maasserver/utils/__init__.py (+10/-13)
src/maasserver/utils/tests/test_utils.py (+7/-14)
- Jeroen T. Vermeulen (community): Approve
-
Diff: 177 lines (+70/-38)4 files modifiedsrc/maasserver/api.py (+5/-1)
src/maasserver/tests/test_api.py (+48/-10)
src/maasserver/utils/__init__.py (+10/-13)
src/maasserver/utils/tests/test_utils.py (+7/-14)
- Andres Rodriguez (community): Approve
-
Diff: 31 lines (+23/-1)1 file modifieddebian/changelog (+23/-1)
Changed in maas: | |
importance: | Undecided → Critical |
status: | New → Triaged |
tags: | added: api maas-cli |
Changed in maas: | |
status: | Triaged → In Progress |
assignee: | nobody → Jeroen T. Vermeulen (jtv) |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
status: | Fix Committed → Fix Released |
I managed to recreate the problem (using the package in the daily ppa):
maas-cli login maas http:// 127.0.0. 1/MAAS/ api/1.0/ creds:creds:creds
maas-cli maas node-groups list => returns the HTLM content of the login page
From apache's access log: 2012:15: 33:31 +0000] "GET /MAAS/api/ 1.0/describe/ HTTP/1.1" 200 6050 "-" "Python- httplib2/ 0.7.4 (gzip)" 2012:15: 33:42 +0000] "GET /MAAS/MAAS/ api/1.0/ nodegroups/ ?op=list HTTP/1.1" 302 322 "-" "Python- httplib2/ 0.7.4 (gzip)"
127.0.0.1 - - [06/Nov/
127.0.0.1 - - [06/Nov/
The problem is the URL used to fetch the list of the nodegroups; it contains a duplicated prefix: '/MAAS/MAAS/'. 1.0/describe/ : http:// paste.ubuntu. com/1337566/
Here is the content of /MAAS/api/
The 'path' field of the handlers seems fine but the 'uri' field contains '/MAAS/MAAS'.
This seems to be a very recent problem and the last change I can think of in this area is https:/ /code.launchpad .net/~allenap/ maas/api- uri-bug- 1059645/ +merge/ 132527. Probably worth a look.