"You are not logged in (HTTP 401, API Error 103)"

760 views
Skip to first unread message

Julian Mehnle

unread,
Jan 6, 2015, 5:59:26 PM1/6/15
to revie...@googlegroups.com
Hi all,

I'm having trouble using rbt on the command line. No matter what I do, anything that requires interaction with the Review Board server gives me a "You are not logged in (HTTP 401, API Error 103)":

> joule:~/tmp/rbtools.orig> rbt --version
> RBTools 0.6.3
> joule:~/tmp/rbtools.orig> git log --stat master ^origin/master | more
> commit 86dc0ab71c20a599c33efa7ea694c12281fe8ef6
> Author: Julian Mehnle <jme...@agari.com>
> Date: Tue Jan 6 22:45:19 2015 +0000
>
> When raising CommandError, include lower-level exception.
>
> rbtools/commands/__init__.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> joule:~/tmp/rbtools.orig> rbt post --debug -g
> >>> RBTools 0.6.3
> >>> Python 2.7.9 (default, Dec 13 2014, 15:13:49)
> [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)]
> >>> Running on Darwin-14.0.0-x86_64-i386-64bit
> >>> Home = /Users/julian
> >>> Current directory = /Users/julian/tmp/rbtools.orig
> >>> Checking for a Subversion repository...
> >>> Running: svn info --non-interactive
> >>> Command exited with rc 1: ['svn', 'info', '--non-interactive']
> svn: E155007: '/Users/julian/tmp/rbtools.orig' is not a working copy
> ---
> >>> Checking for a Git repository...
> >>> Running: git rev-parse --git-dir
> >>> Running: git config core.bare
> >>> Running: git rev-parse --show-toplevel
> >>> Running: git symbolic-ref -q HEAD
> >>> Running: git config --get branch.master.merge
> >>> Running: git config --get branch.master.remote
> >>> Running: git config --get remote.origin.url
> >>> repository info: Path: git://github.com/reviewboard/rbtools.git, Base path: , Supports changesets: False
> >>> Making HTTP GET request to https://reviews.reviewboard.org/api/
> >>> Running: git rev-parse refs/heads/master
> >>> Running: git merge-base 86dc0ab71c20a599c33efa7ea694c12281fe8ef6 origin/master
> >>> Running: git rev-parse bcb7629c0be773b6f347a5006224825b8726c479
> >>> Running: git status --porcelain --untracked-files=no
> >>> Running: git diff --no-color --full-index --ignore-submodules bcb7629c0be773b6f347a5006224825b8726c479..86dc0ab71c20a599c33efa7ea694c12281fe8ef6 -M --no-ext-diff
> >>> Running: git log --reverse --pretty=format:%s%n%n%b ^bcb7629c0be773b6f347a5006224825b8726c479 86dc0ab71c20a599c33efa7ea694c12281fe8ef6
> >>> Making HTTP GET request to https://reviews.reviewboard.org/api/review-requests/
> >>> Making HTTP POST request to https://reviews.reviewboard.org/api/review-requests/
> >>> Got API Error 103 (HTTP code 401): You are not logged in
> >>> Error data: {u'stat': u'fail', u'err': {u'msg': u'You are not logged in', u'code': 103}}
> Traceback (most recent call last):
> File "/usr/local/bin/rbt", line 9, in <module>
> load_entry_point('RBTools==0.6.3', 'console_scripts', 'rbt')()
> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/RBTools-0.6.3-py2.7.egg/rbtools/commands/main.py", line 134, in main
> command.run_from_argv([RB_MAIN, command_name] + args)
> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/RBTools-0.6.3-py2.7.egg/rbtools/commands/__init__.py", line 416, in run_from_argv
> exit_code = self.main(*args) or 0
> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/RBTools-0.6.3-py2.7.egg/rbtools/commands/post.py", line 791, in main
> submit_as=self.options.submit_as)
> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/RBTools-0.6.3-py2.7.egg/rbtools/commands/post.py", line 507, in post_request
> raise CommandError("Error creating review request: %s" % e)
> rbtools.commands.CommandError: Error creating review request: You are not logged in (HTTP 401, API Error 103)


I've tried removing ~/.rbtools-cookies, as well as specifying --username and --password on the command line, to no avail. I've tried both posting to https://reviews.reviewboard.org and my company's internal Review Board server (running RB 1.7.19. I'm running Python 2.7.9 on Mac OS X 10.10.1.

I'm not sure what triggered this. How should I go about debugging this?

-Julian

Christian Hammond

unread,
Jan 6, 2015, 6:05:55 PM1/6/15
to revie...@googlegroups.com, Julian Mehnle
Hey Julian,

You're not able to post to either our server or your internal one?

Are you posting using the official upstream build of RBTools, or one from your source tree? I just want to rule out any issues there.

Are you behind any kind of proxy server that could potentially be interfering?

If you delete the .rbtools-cookies file and run rbt post, does it prompt you for credentials, or does it just try without them?

Christian

--
Christian Hammond - chri...@beanbaginc.com
Review Board - https://www.reviewboard.org
Beanbag, Inc. - https://www.beanbaginc.com

-----Original Message-----
From: Julian Mehnle <jul...@mehnle.net>
Reply: revie...@googlegroups.com <revie...@googlegroups.com>>
Date: January 6, 2015 at 2:59:25 PM
To: revie...@googlegroups.com <revie...@googlegroups.com>>
Subject:  "You are not logged in (HTTP 401, API Error 103)"

> Hi all,
>
> I'm having trouble using rbt on the command line. No matter what I do, anything that requires
> interaction with the Review Board server gives me a "You are not logged in (HTTP 401, API
> Error 103)":
>
> > joule:~/tmp/rbtools.orig> rbt --version
> > RBTools 0.6.3
> > joule:~/tmp/rbtools.orig> git log --stat master ^origin/master | more
> > commit 86dc0ab71c20a599c33efa7ea694c12281fe8ef6
> > Author: Julian Mehnle
> > load_entry_point('RBTools==0.6.3', 'console_scripts', 'rbt')()
> > File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/RBTools-0.6.3-py2.7.egg/rbtools/commands/main.py",
> line 134, in main
> > command.run_from_argv([RB_MAIN, command_name] + args)
> > File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/RBTools-0.6.3-py2.7.egg/rbtools/commands/__init__.py",
> line 416, in run_from_argv
> > exit_code = self.main(*args) or 0
> > File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/RBTools-0.6.3-py2.7.egg/rbtools/commands/post.py",
> line 791, in main
> > submit_as=self.options.submit_as)
> > File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/RBTools-0.6.3-py2.7.egg/rbtools/commands/post.py",
> line 507, in post_request
> > raise CommandError("Error creating review request: %s" % e)
> > rbtools.commands.CommandError: Error creating review request: You are not logged
> in (HTTP 401, API Error 103)
>
>
> I've tried removing ~/.rbtools-cookies, as well as specifying --username and --password
> on the command line, to no avail. I've tried both posting to https://reviews.reviewboard.org
> and my company's internal Review Board server (running RB 1.7.19. I'm running Python
> 2.7.9 on Mac OS X 10.10.1.
>
> I'm not sure what triggered this. How should I go about debugging this?
>
> -Julian
>
> --
> Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
> ---
> Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
> ---
> Happy user? Let us know at http://www.reviewboard.org/users/
> ---
> You received this message because you are subscribed to the Google Groups "reviewboard"
> group.
> To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

Julian Mehnle

unread,
Jan 6, 2015, 6:22:54 PM1/6/15
to revie...@googlegroups.com
Christian Hammond <chri...@beanbaginc.com> wrote:

> You're not able to post to either our server or your internal one?

Unable to post to either. Exact same error message.

> Are you posting using the official upstream build of RBTools, or one from your source tree? I just want to rule out any issues there.

Using the official one, version 0.6.3.

> Are you behind any kind of proxy server that could potentially be interfering?
>
> If you delete the .rbtools-cookies file and run rbt post, does it prompt you for credentials, or does it just try without them?

No proxy. If I delete .rbtools-cookies and run `rbt post`, it does *not* prompt for credentials (I understand it *should*), but it just fails. Afterwards there's a new .rbtools-cookies file that looks like this:

> -----8<-----
> # Netscape HTTP Cookie File
> # http://curl.haxx.se/rfc/cookie_spec.html
> # This is a generated file! Do not edit.
>
> ----->8-----

-Julian

Christian Hammond

unread,
Jan 6, 2015, 6:25:38 PM1/6/15
to revie...@googlegroups.com, Julian Mehnle
Did you used to use the old post-review tool? If so, can you see if there's a .post-review-cookies.txt hanging around?

I'm not sure that's actually the problem in this case, but I just want to rule it out.

It's a peculiar problem, I'll grant you that. Haven't seen this before... It really should be prompting for a username/password if it doesn't have a cookie.

Christian

--
Christian Hammond - chri...@beanbaginc.com
Review Board - https://www.reviewboard.org
Beanbag, Inc. - https://www.beanbaginc.com

-----Original Message-----
From: Julian Mehnle <jul...@mehnle.net>
Reply: revie...@googlegroups.com <revie...@googlegroups.com>>
Date: January 6, 2015 at 3:22:53 PM
To: revie...@googlegroups.com <revie...@googlegroups.com>>
Subject:  Re: "You are not logged in (HTTP 401, API Error 103)"

Julian Mehnle

unread,
Jan 6, 2015, 6:57:12 PM1/6/15
to revie...@googlegroups.com
Christian Hammond wrote:

> Did you used to use the old post-review tool? If so, can you see if there's a .post-review-cookies.txt hanging around?

That file doesn't exist in my home directory (~/.post-review-cookies.txt).

> It's a peculiar problem, I'll grant you that. Haven't seen this before... It really should be prompting for a username/password if it doesn't have a cookie.

I googled for the error and it seems someone else ran into this back in 2013, with no apparent resolution:

https://groups.google.com/forum/#!msg/reviewboard/LbgYbA-tQn4/tXxI7_v09rMJ

I'm familiar with Python, so I can help debugging this if you give me some guidance on where to start.

Thanks,

-Julian

Julian Mehnle

unread,
Jan 9, 2015, 1:14:35 AM1/9/15
to revie...@googlegroups.com
Christian,
Anything I can do to debug this?

-Julian

Christian Hammond

unread,
Jan 9, 2015, 1:30:40 AM1/9/15
to revie...@googlegroups.com, Julian Mehnle
Hi Julian,

Best bet would be to sprinkle some print statements throughout rbtools/api/request.py. Particularly in ReviewBoardHTTPBasicAuthHandler, ReviewBoardHTTPPasswordMgr, and PresetHTTPAuthHandler. See what's getting triggered, what headers are being used, etc. Would take some investigation, though... Wish I had a repro case :/

Christian

--
Christian Hammond - chri...@beanbaginc.com
Review Board - https://www.reviewboard.org
Beanbag, Inc. - https://www.beanbaginc.com

-----Original Message-----
From: Julian Mehnle <jul...@mehnle.net>
Reply: revie...@googlegroups.com <revie...@googlegroups.com>>
Date: January 8, 2015 at 10:14:32 PM
To: revie...@googlegroups.com <revie...@googlegroups.com>>
Subject:  Re: "You are not logged in (HTTP 401, API Error 103)"

Gauthier Segay

unread,
Feb 10, 2015, 3:38:09 PM2/10/15
to revie...@googlegroups.com
Hello, I'm encountering same issue, just dumping all the configuration
info and current output of rbt post.

The issues started happening after a reviewboard machine reboot (and
ip change), I don't know how I used to get it working.

Reviews are posted from a windows machine hosting the svn server.

I can login on the site and create reviews with the login used in this
command line.

Please suggest what I can try.

===========================================
E:\repositories\dev\hooks>rbt post
--server=http://reviewboard.lcgentoo.local
--repository-url=svn://192.168.1.7/dev --debug --publish
--username svn --password thepassword --submit-as svn
--target-groups uplanreviewers --summary
automatic_summary_for_revision_15039 --description-file
E:\repositories\dev\hooks\logs\15039svncommitlog.txt
15038:15039 1>>E:\repositories\dev\hooks\logs\15039post-commit-review.log
>>> RBTools 0.7.1
>>> Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)]
>>> Running on Windows-2003Server-5.2.3790-SP2
>>> Home = C:\Documents and Settings\Administrator.LCG\Application Data
>>> Current directory = E:\repositories\dev\hooks
>>> Checking for a Subversion repository...
>>> Running: svn info svn://192.168.1.7/dev --non-interactive
>>> Running: diff --version
>>> repository info: Path: svn://192.168.1.7/dev, Base path: /, Supports changesets: False
>>> Making HTTP GET request to http://reviewboard.lcgentoo.local/api/
>>> Making HTTP GET request to http://reviewboard.lcgentoo.local/api/repositories/
>>> Running: svn log -r 15038 -l 1 --xml svn://192.168.1.7/dev
>>> Running: svn log -r 15039 -l 1 --xml svn://192.168.1.7/dev
>>> Running: svn info svn://192.168.1.7/dev --non-interactive
>>> Running: diff --version
>>> repository info: Path: svn://192.168.1.7/dev, Base path: /, Supports changesets: False
>>> Running: svn status --ignore-externals
>>> Running: svn diff --diff-cmd=diff --notice-ancestry svn://192.168.1.7/dev/@15038 svn://192.168.1.7/dev/@15039
>>> Running: svn diff --diff-cmd=diff --notice-ancestry svn://192.168.1.7/dev/@15038 svn://192.168.1.7/dev/@15039 --no-d
iff-deleted
>>> Making HTTP GET request to http://reviewboard.lcgentoo.local/api/validation/diffs/
>>> Making HTTP POST request to http://reviewboard.lcgentoo.local/api/validation/diffs/
>>> Got API Error 103 (HTTP code 401): You are not logged in
>>> Error data: {'stat': 'fail', 'err': {'msg': 'You are not logged in', 'code': 103}}
Traceback (most recent call last):
File "C:\Python27\Scripts\rbt-script.py", line 9, in <module>
load_entry_point('RBTools==0.7.1', 'console_scripts', 'rbt')()
File "C:\Python27\lib\site-packages\rbtools-0.7.1-py2.7.egg\rbtools\commands\main.py",
line 133, in main
command.run_from_argv([RB_MAIN, command_name] + args)
File "C:\Python27\lib\site-packages\rbtools-0.7.1-py2.7.egg\rbtools\commands\__init__.py",
line 538, in run_from_argv
exit_code = self.main(*args) or 0
File "C:\Python27\lib\site-packages\rbtools-0.7.1-py2.7.egg\rbtools\commands\post.py",
line 670, in main
(msg_prefix, e))
rbtools.commands.CommandError: Error validating diff

You are not logged in (HTTP 401, API Error 103)
===========================================

On the machine, if I open http://reviewboard.lcgentoo.local/api/info
in a browser, the answer is

===========================================
Remote Address: 192.168.1.47:80
Request URL: http://reviewboard.lcgentoo.local/api/info
Request Method: GET
Status Code: 404 NOT FOUND

Request Headers

GET /api/info HTTP/1.1 Host: reviewboard.lcgentoo.local Connection:
keep-alive Cache-Control: max-age=0 Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 5.2) AppleWebKit/537.36 (KHTML,
like Gecko) Chrome/40.0.2214.91 Safari/537.36 Accept-Encoding: gzip,
deflate, sdch Accept-Language: en-US,en;q=0.8 Cookie:
csrftoken=R2Xe4tSc3pt0xVoAK8ROQ0FyG8DnUFd8;
rbsessionid=nuigvg158krygm0zul6i2xwwb344g15a

Response Headers

HTTP/1.1 404 NOT FOUND Date: Tue, 10 Feb 2015 13:12:19 GMT Server:
Apache Content-Length: 139 Content-Language: en
X-Content-Type-Options: nosniff Expires: Tue, 10 Feb 2015 13:12:19 GMT
Vary: Cookie,Accept-Language Last-Modified: Tue, 10 Feb 2015 13:12:19
GMT Cache-Control: max-age=0 X-Frame-Options: SAMEORIGIN Keep-Alive:
timeout=15, max=100 Connection: Keep-Alive Content-Type:
application/xml

<?xml version="1.0" encoding="utf-8"?>
<rsp>
<stat>fail</stat>
<err>
<msg>Object does not exist</msg>
<code>100</code>
</err>
</rsp>
===========================================


conf/apache-wsgi.conf
===========================================
<VirtualHost *:80>
ServerName reviewboard.lcgentoo.local
DocumentRoot "/var/www/reviewboard.lcgentoo.local/htdocs"

# Error handlers
ErrorDocument 500 /errordocs/500.html

WSGIPassAuthorization On
WSGIScriptAlias "/"
"/var/www/reviewboard.lcgentoo.local/htdocs/reviewboard.wsgi/"

<Directory "/var/www/reviewboard.lcgentoo.local/htdocs">
AllowOverride All
Options -Indexes +FollowSymLinks
Allow from all
</Directory>

# Prevent the server from processing or allowing the rendering of
# certain file types.
<Location "/media/uploaded">
SetHandler None
Options None

AddType text/plain .html .htm .shtml .php .php3 .php4 .php5 .phps .asp
AddType text/plain .pl .py .fcgi .cgi .phtml .phtm .pht .jsp .sh .rb

<IfModule mod_php5.c>
php_flag engine off
</IfModule>
</Location>

# Alias static media requests to filesystem
Alias /media "/var/www/reviewboard.lcgentoo.local/htdocs/media"
Alias /static "/var/www/reviewboard.lcgentoo.local/htdocs/static"
Alias /errordocs "/var/www/reviewboard.lcgentoo.local/htdocs/errordocs"
Alias /favicon.ico
"/var/www/reviewboard.lcgentoo.local/htdocs/static/rb/images/favicon.png"
</VirtualHost>
===========================================

htdocs/reviewboard.wsgi
===========================================
import __main__
__main__.__requires__ = ['ReviewBoard']
import pkg_resources

import os
import sys

os.environ['DJANGO_SETTINGS_MODULE'] = "reviewboard.settings"
os.environ['PYTHON_EGG_CACHE'] =
"/var/www/reviewboard.lcgentoo.local/tmp/egg_cache"
os.environ['HOME'] = "/var/www/reviewboard.lcgentoo.local/data"
os.environ['PYTHONPATH'] = '/var/www/reviewboard.lcgentoo.local/conf:'
+ os.environ.get('PYTHONPATH', '')

sys.path = ['/var/www/reviewboard.lcgentoo.local/conf'] + sys.path

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
===========================================

/etc/apache2/vhosts.d/local.lcgentoo.reviewboard.vhost.conf
===========================================
<IfDefine DEFAULT_VHOST>
<VirtualHost *:80>
ServerName reviewboard.lcgentoo.local
DocumentRoot "/var/www/reviewboard.lcgentoo.local/htdocs"

SetEnv HOME /var/www/reviewboard.lcgentoo.local/data

# Error handlers
ErrorDocument 500 /errordocs/500.html

# Serve django pages
WSGIScriptAlias /
/var/www/reviewboard.lcgentoo.local/htdocs/reviewboard.wsgi
<Location "/">
# SetHandler wsgi-script
# Options +ExecCGI
# PythonPath
"['/var/www/reviewboard.lcgentoo.local/conf'] + sys.path"
# SetEnv DJANGO_SETTINGS_MODULE reviewboard.settings
# SetEnv PYTHON_EGG_CACHE
"/var/www/reviewboard.lcgentoo.local/tmp/egg_cache"
# SetHandler mod_python
# PythonHandler django.core.handlers.modpython
# PythonAutoReload Off
# PythonDebug Off
# Used to run multiple mod_python sites in the same apache
# PythonInterpreter reviewboard_reviewboard_lcgentoo_local
</Location>

# Serve static media without running it through mod_python
# (overrides the above)
<Location "/media">
SetHandler None
</Location>

Alias /static "/var/www/reviewboard.lcgentoo.local/htdocs/static"
<Location "/static">
SetHandler None
</Location>
<Location "/errordocs">
SetHandler None
</Location>

<Directory "/var/www/reviewboard.lcgentoo.local/htdocs">
AllowOverride All
Allow from all
</Directory>

# Alias static media requests to filesystem
Alias /media "/var/www/reviewboard.lcgentoo.local/htdocs/media"
Alias /errordocs "/var/www/reviewboard.lcgentoo.local/htdocs/errordocs"
</VirtualHost>

</IfDefine>
===========================================

Gauthier Segay

unread,
Feb 19, 2015, 8:55:07 AM2/19/15
to revie...@googlegroups.com
It might help some encountering this issue, I worked around using the
.rbtools-cookies files

On windows 2003 this file is in:

C:\Documents and Settings\THEUSER\Application Data for THEUSER

and

c:\windows\system32 for SYSTEM account

To get a valid cookie, I logged in reviewboard using the account I
intend to use with "rbtools post" and got the value of rbsessionid to
put in above file.

I tried to debug rbtools locally but only have python 3 on my dev
machine so I couldn't get it to work properly to the stage I would get
this:

>>> Got API Error 103 (HTTP code 401): You are not logged in
>>> Error data: {'stat': 'fail', 'err': {'msg': 'You are not logged in', 'code': 103}}



Chris Westin

unread,
Sep 13, 2016, 8:06:23 PM9/13/16
to reviewboard
So, no resolution to this? I'm seeing the exact same thing on a fresh install on Ubuntu. Everything is stock.

Christian Hammond

unread,
Sep 13, 2016, 8:13:26 PM9/13/16
to revie...@googlegroups.com
Can you supply a debug log as well? Having more data would help here.

Also, what version of Review Board are you running?

Christian
--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/

---
You received this message because you are subscribed to the Google Groups "reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
-- 
Christian Hammond
President/CEO of Beanbag
Makers of Review Board

Chris Westin

unread,
Sep 14, 2016, 2:57:10 PM9/14/16
to reviewboard, chri...@beanbaginc.com
RBTools 0.7.6.

How do I produce a debug log?

Christian Hammond

unread,
Sep 14, 2016, 3:44:25 PM9/14/16
to revie...@googlegroups.com
You can pass --debug to the RBTools command line.

Christian

-- 
Christian Hammond
President/CEO of Beanbag
Makers of Review Board

Chris Westin

unread,
Sep 14, 2016, 5:10:56 PM9/14/16
to reviewboard, chri...@beanbaginc.com
I didn't notice any file being created, but here's what came out on stdout/stderr:

cwestin@qa-node66:~/hg/dev1$ rbt post --username cwestin --debug --diff-filename=diff.txt
>>> RBTools 0.7.6
>>> Python 2.7.3 (default, Jun 22 2015, 19:33:41)
[GCC 4.6.3]
>>> Running on Linux-3.2.0-109-generic-x86_64-with-Ubuntu-12.04-precise
>>> Home = /home/cwestin
>>> Current directory = /home/cwestin/hg/dev1
>>> Checking for a Subversion repository...
>>> Running: svn --non-interactive info
>>> Command exited with rc 1: ['svn', '--non-interactive', u'info']
svn: '.' is not a working copy
---
>>> Checking for a Git repository...
>>> Running: git rev-parse --git-dir
>>> Command exited with rc 128: ['git', 'rev-parse', '--git-dir']
fatal: Not a git repository (or any of the parent directories): .git
---
>>> Checking for a Mercurial repository...
>>> Running: hg root
>>> Running: hg showconfig
>>> Running: hg svn info
>>> Command exited with rc 255: [u'hg', u'svn', u'info']
hg: unknown command 'svn'
Mercurial Distributed SCM

basic commands:

 add        add the specified files on the next commit
 annotate   show changeset information by line for each file
 clone      make a copy of an existing repository
 commit     commit the specified files or all outstanding changes
 diff       diff repository (or selected files)
 export     dump the header and diffs for one or more changesets
 forget     forget the specified files on the next commit
    exit_code = self.main(*args) or 0
  File "/usr/local/lib/python2.7/dist-packages/rbtools/commands/post.py", line 805, in main
    base_dir=base_dir)
  File "/usr/local/lib/python2.7/dist-packages/rbtools/commands/post.py", line 426, in post_request
    raise CommandError('Error creating review request: %s' % e)
rbtools.commands.CommandError: Error creating review request: You are not logged in (HTTP 401, API Error 103)
cwestin@qa-node66:~/hg/dev1$ ls
build_fileclient/      gradlew*                      mapr-core-internal-dist/
build_fileserver/      gradlew.bat                   maprstat-build-wrapper/
    exit_code = self.main(*args) or 0
  File "/usr/local/lib/python2.7/dist-packages/rbtools/commands/post.py", line 805, in main
    base_dir=base_dir)
  File "/usr/local/lib/python2.7/dist-packages/rbtools/commands/post.py", line 426, in post_request
    raise CommandError('Error creating review request: %s' % e)
rbtools.commands.CommandError: Error creating review request: You are not logged in (HTTP 401, API Error 103)
cwestin@qa-node66:~/hg/dev1$


It's picking up the location of rb from a .reviewboardrc file in the root of the hg repo, which contains

REPOSITORY = "MapR Trunk Repo"

Christian Hammond

unread,
Sep 14, 2016, 5:20:45 PM9/14/16
to revie...@googlegroups.com
Can you try without --username, and instead let RBTools prompt for one?

Christian

-- 
Christian Hammond
President/CEO of Beanbag
Makers of Review Board

Chris Westin

unread,
Sep 14, 2016, 7:26:28 PM9/14/16
to reviewboard, chri...@beanbaginc.com
Fails in the same way:

cwestin@qa-node66:~/hg/dev1$ rbt post --debug --diff-filename=diff.txt
 init       create a new repository in the given directory
 log        show revision history of entire repository or files
 merge      merge working directory with another revision
 pull       pull changes from the specified source
 push       push changes to the specified destination
 remove     remove the specified files on the next commit
 serve      start stand-alone webserver
 status     show changed files in the working directory
 summary    summarize working directory state
 update     update working directory (or switch revisions)

use "hg help" for the full list of commands or "hg -v" for details
---
>>> Using candidate path u'default': u'ssh://ma...@10.250.1.5/releases/trunk'
>>> repository info: Path: ssh://ma...@10.250.1.5/releases/trunk, Base path: , Supports changesets: False
>>> Making HTTP GET request to http://reviewboard.corp.maprtech.com/api/
>>> Making HTTP GET request to http://reviewboard.corp.maprtech.com/api/info/

Please log in to the Review Board server at reviewboard.corp.maprtech.com.
Username: cwestin
Password:

>>> Got API Error 103 (HTTP code 401): You are not logged in
>>> Error data: {u'stat': u'fail', u'err': {u'msg': u'You are not logged in', u'code': 103}}
Traceback (most recent call last):
  File "/usr/local/bin/rbt", line 9, in <module>
    load_entry_point('RBTools==0.7.6', 'console_scripts', 'rbt')()
  File "/usr/local/lib/python2.7/dist-packages/rbtools/commands/main.py", line 133, in main
    command.run_from_argv([RB_MAIN, command_name] + args)
  File "/usr/local/lib/python2.7/dist-packages/rbtools/commands/__init__.py", line 629, in run_from_argv
    exit_code = self.main(*args) or 0
  File "/usr/local/lib/python2.7/dist-packages/rbtools/commands/post.py", line 805, in main
    base_dir=base_dir)
  File "/usr/local/lib/python2.7/dist-packages/rbtools/commands/post.py", line 426, in post_request
    raise CommandError('Error creating review request: %s' % e)
rbtools.commands.CommandError: Error creating review request: You are not logged in (HTTP 401, API Error 103)
cwestin@qa-node66:~/hg/dev1$

Christian Hammond

unread,
Sep 14, 2016, 8:05:43 PM9/14/16
to revie...@googlegroups.com
Arre you behind a HTTP(S) proxy? Sometimes these will interfere with headers. If not, can you tell me more about your Review Board server configuration? Is there anything sitting in front of Apache?

Christian

Vince Thyng

unread,
Jan 15, 2018, 5:04:33 PM1/15/18
to Review Board Community
We are having this same issue on a new server I bought up to migrate data to.  Here is a log of me removing the .rbtools-cookies file, showing the failure upon entering credentials, no .rbtools-cookies file is created, putting the file back, and it works.  I had this problem until today when I added 'import pdb; pdb.set_trace()' to the rbtools/api/request.py file in make_request().  It still failed at first and then stepping through one time worked.  This only fixed the problem for my account though.  My co-worker helping me test it is still failing.  I suspect rbt is failing to get a rbsessionid to set.  I tried reproducing my success by moving the .rbtools-cookies file away and now it just creates an empty file when I attempt another rbt post.  So I still need help here.


13:25 $ mv ~/.rbtools-cookies ~/shared/
(python27) ✔ ~/w/netboot [rb2 L|✔] 
13:32 $ rbt post -u --debug
>>> RBTools 0.7.10
>>> Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609]
>>> Running on Linux-4.10.0-37-generic-x86_64-with-Ubuntu-16.04-xenial
>>> Home = /home/vthyng
>>> Current directory = /home/vthyng/w/netboot
>>> Command line: rbt post -u --debug
>>> Running: tf vc help
>>> Checking for a Subversion repository...
>>> Unable to execute "svn help": skipping SVN
>>> Checking for a Git repository...
>>> Running: git rev-parse --git-dir
>>> Running: git config core.bare
>>> Running: git rev-parse --show-toplevel
>>> Running: git symbolic-ref -q HEAD
>>> Running: git config --get branch.rb2.merge
>>> Command exited with rc 1: ['git', 'config', '--get', u'branch.rb2.merge']
---
>>> Running: git config --get branch.rb2.remote
>>> Command exited with rc 1: ['git', 'config', '--get', u'branch.rb2.remote']
---
>>> Running: git config --get remote.origin.url
>>> repository info: Path: g...@github.localserver.com:vthyng/netboot.git, Base path: , Supports changesets: False
>>> Making HTTP GET request to http://reviewboard.localserver.com/api/

Please log in to the Review Board server at reviewboard.localserver.com.
Username: vthyng
Password: 
>>> Got API Error 103 (HTTP code 401): You are not logged in
>>> Error data: {u'stat': u'fail', u'err': {u'msg': u'You are not logged in', u'code': 103}}
Traceback (most recent call last):
  File "/home/vthyng/e/python27/bin/rbt", line 11, in <module>
    sys.exit(main())
  File "/home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/commands/main.py", line 133, in main
    command.run_from_argv([RB_MAIN, command_name] + args)
  File "/home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/commands/__init__.py", line 663, in run_from_argv
    exit_code = self.main(*args) or 0
  File "/home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/commands/post.py", line 701, in main
    api_client, api_root = self.get_api(server_url)
  File "/home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/commands/__init__.py", line 850, in get_api
    raise CommandError('Unexpected API Error: %s' % e)
rbtools.commands.CommandError: Unexpected API Error: You are not logged in (HTTP 401, API Error 103)
(python27) ✘-1 ~/w/netboot [rb2 L|✔] 
13:32 $ cat ~/.rbtools-cookies 
(python27) ✔ ~/w/netboot [rb2 L|✔] 
(python27) ✘-1 ~/w/netboot [rb2 L|✔] 
13:33 $ mv ~/shared/.rbtools-cookies ~/
(python27) ✔ ~/w/netboot [rb2 L|✔] 
13:33 $ rbt post -u --debug
>>> RBTools 0.7.10
>>> Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609]
>>> Running on Linux-4.10.0-37-generic-x86_64-with-Ubuntu-16.04-xenial
>>> Home = /home/vthyng
>>> Current directory = /home/vthyng/w/netboot
>>> Command line: rbt post -u --debug
>>> Running: tf vc help
>>> Checking for a Subversion repository...
>>> Unable to execute "svn help": skipping SVN
>>> Checking for a Git repository...
>>> Running: git rev-parse --git-dir
>>> Running: git config core.bare
>>> Running: git rev-parse --show-toplevel
>>> Running: git symbolic-ref -q HEAD
>>> Running: git config --get branch.rb2.merge
>>> Command exited with rc 1: ['git', 'config', '--get', u'branch.rb2.merge']
---
>>> Running: git config --get branch.rb2.remote
>>> Command exited with rc 1: ['git', 'config', '--get', u'branch.rb2.remote']
---
>>> Running: git config --get remote.origin.url
>>> repository info: Path: g...@github.localserver.com:vthyng/netboot.git, Base path: , Supports changesets: False
>>> Making HTTP GET request to http://reviewboard.localserver.com/api/
>>> Running: git rev-parse refs/heads/rb2
>>> Running: git merge-base 67f0abe6e9dd0c332543b9dd6714ceb807169d2b origin/master
>>> Running: git rev-parse 587b8912f63c47969c8b0ad9150c963427802925
>>> Running: git status --porcelain --untracked-files=no --ignore-submodules=dirty
>>> Running: git rev-parse --git-dir
>>> Running: git version
>>> Running: git -c core.quotepath=false -c diff.noprefix=false diff --no-color --full-index --ignore-submodules -M --no-ext-diff 587b8912f63c47969c8b0ad9150c963427802925..67f0abe6e9dd0c332543b9dd6714ceb807169d2b
>>> Cached response for HTTP GET https://reviewboard.localserver.com/api/validation/diffs/ expired and was modified
>>> Cached response for HTTP GET https://reviewboard.localserver.com/api/session/?expand=user expired and was modified
>>> Running: git log --reverse --pretty=format:%s%n%n%b ^587b8912f63c47969c8b0ad9150c963427802925 67f0abe6e9dd0c332543b9dd6714ceb807169d2b
>>> Cached response for HTTP GET https://reviewboard.localserver.com/api/review-requests/65235/diffs/?only-fields= expired and was modified
>>> Cached response for HTTP GET https://reviewboard.localserver.com/api/review-requests/65235/draft/?only-fields=commit_id expired and was not modified
Review request #65235 posted.


13:33 $ cat ~/.rbtools-cookies 
# Netscape HTTP Cookie File
# This is a generated file!  Do not edit.

reviewboard.otherserver.com FALSE / FALSE 1546727034  rbsessionid ku7hpre3o9nvdsyacgu0klwjbdjnqijk
reviewboard.localserver.com FALSE / FALSE 1547581003  rbsessionid jbyeov90beeacrbge0cfljadbhpblnxm

---------------------------------------------------------------------------------
pdb step through that fails the first time, but then moments later is successful:

12:01 $ rbt post --debug
>>> RBTools 0.7.10
>>> Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609]
>>> Running on Linux-4.10.0-37-generic-x86_64-with-Ubuntu-16.04-xenial
>>> Home = /home/vthyng
>>> Current directory = /home/vthyng/w/netboot
>>> Command line: rbt post --debug
>>> Running: tf vc help
>>> Checking for a Subversion repository...
>>> Unable to execute "svn help": skipping SVN
>>> Checking for a Git repository...
>>> Running: git rev-parse --git-dir
>>> Running: git config core.bare
>>> Running: git rev-parse --show-toplevel
>>> Running: git symbolic-ref -q HEAD
>>> Running: git config --get branch.asdf.merge
>>> Running: git config --get branch.asdf.remote
>>> Running: git config --get remote.origin.url
>>> repository info: Path: g...@github.localserver.com:vthyng/netboot.git, Base path: , Supports changesets: False
>>> Making HTTP GET request to http://reviewboard.localserver.com/api/
>>> make_request {}
> /home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py(574)make_request()
-> try:
(Pdb) s
> /home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py(575)make_request()
-> content_type, body = request.encode_multipart_formdata()
(Pdb) args
self = <rbtools.api.request.ReviewBoardServer object at 0x7fea43fe0850>
request = <rbtools.api.request.HttpRequest object at 0x7fea43fe0950>
(Pdb) dir(request)
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_fields', '_files', '_make_mime_boundary', 'add_field', 'add_file', 'del_field', 'del_file', 'encode_multipart_formdata', 'headers', 'method', 'url']
(Pdb) request.headers
{}
(Pdb) request.url
(Pdb) s
--Call--
> /home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py(87)encode_multipart_formdata()
-> def encode_multipart_formdata(self):
(Pdb) s
> /home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py(96)encode_multipart_formdata()
-> if not (self._fields or self._files):
(Pdb) s
> /home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py(97)encode_multipart_formdata()
-> return None, None
(Pdb) s
--Return--
> /home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py(97)encode_multipart_formdata()->(None, None)
-> return None, None
(Pdb) s
> /home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py(576)make_request()
-> headers = request.headers
(Pdb) 
> /home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py(578)make_request()
-> if body:
(Pdb) 
> /home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py(584)make_request()
-> headers[b'Content-Length'] = '0'
(Pdb) 
> /home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py(586)make_request()
-> r = Request(request.url.encode('utf-8'), body, headers,
(Pdb) 
> /home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py(587)make_request()
-> request.method.encode('utf-8'))
(Pdb) 
--Call--
> /home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py(159)__init__()
-> def __init__(self, url, body='', headers={}, method='PUT'):
(Pdb) 
> /home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py(160)__init__()
-> URLRequest.__init__(self, url, body, headers)
(Pdb) 
--Call--
> /usr/lib/python2.7/urllib2.py(226)__init__()
-> def __init__(self, url, data=None, headers={},
(Pdb) 
> /usr/lib/python2.7/urllib2.py(229)__init__()
-> self.__original = unwrap(url)
(Pdb) 
--Call--
> /usr/lib/python2.7/urllib.py(1069)unwrap()
-> def unwrap(url):
(Pdb) 
> /usr/lib/python2.7/urllib.py(1071)unwrap()
-> url = url.strip()
(Pdb) 
> /usr/lib/python2.7/urllib.py(1072)unwrap()
-> if url[:1] == '<' and url[-1:] == '>':
(Pdb) 
> /usr/lib/python2.7/urllib.py(1074)unwrap()
-> if url[:4] == 'URL:': url = url[4:].strip()
(Pdb) 
> /usr/lib/python2.7/urllib.py(1075)unwrap()
-> return url
(Pdb) 
--Return--
> /usr/lib/python2.7/urllib.py(1075)unwrap()->'http://revie...ilon.com/api/'
-> return url
(Pdb) 
> /usr/lib/python2.7/urllib2.py(230)__init__()
-> self.__original, self.__fragment = splittag(self.__original)
(Pdb) 
--Call--
> /usr/lib/python2.7/urllib.py(1183)splittag()
-> def splittag(url):
(Pdb) 
> /usr/lib/python2.7/urllib.py(1186)splittag()
-> if _tagprog is None:
(Pdb) 
> /usr/lib/python2.7/urllib.py(1187)splittag()
-> import re
(Pdb) 
> /usr/lib/python2.7/urllib.py(1188)splittag()
-> _tagprog = re.compile('^(.*)#([^#]*)$')
(Pdb) 
--Call--
> /home/vthyng/e/python27/lib/python2.7/re.py(192)compile()
-> def compile(pattern, flags=0):
(Pdb) 
> /home/vthyng/e/python27/lib/python2.7/re.py(194)compile()
-> return _compile(pattern, flags)
(Pdb) 
--Call--
> /home/vthyng/e/python27/lib/python2.7/re.py(230)_compile()
-> def _compile(*key):
(Pdb) 
> /home/vthyng/e/python27/lib/python2.7/re.py(232)_compile()
-> pattern, flags = key
(Pdb) 
> /home/vthyng/e/python27/lib/python2.7/re.py(233)_compile()
-> bypass_cache = flags & DEBUG
(Pdb) n
> /home/vthyng/e/python27/lib/python2.7/re.py(234)_compile()
-> if not bypass_cache:
(Pdb) 
> /home/vthyng/e/python27/lib/python2.7/re.py(235)_compile()
-> cachekey = (type(key[0]),) + key
(Pdb) 
> /home/vthyng/e/python27/lib/python2.7/re.py(236)_compile()
-> try:
(Pdb) 
> /home/vthyng/e/python27/lib/python2.7/re.py(237)_compile()
-> p, loc = _cache[cachekey]
(Pdb) 
KeyError: ((<type 'str'>, '^(.*)#([^#]*)$', 0),)
> /home/vthyng/e/python27/lib/python2.7/re.py(237)_compile()
-> p, loc = _cache[cachekey]
(Pdb) 
> /home/vthyng/e/python27/lib/python2.7/re.py(240)_compile()
-> except KeyError:
(Pdb) 
> /home/vthyng/e/python27/lib/python2.7/re.py(241)_compile()
-> pass
(Pdb) 
> /home/vthyng/e/python27/lib/python2.7/re.py(242)_compile()
-> if isinstance(pattern, _pattern_type):
(Pdb) 
> /home/vthyng/e/python27/lib/python2.7/re.py(246)_compile()
-> if not sre_compile.isstring(pattern):
(Pdb) 
> /home/vthyng/e/python27/lib/python2.7/re.py(248)_compile()
-> try:
(Pdb) 
> /home/vthyng/e/python27/lib/python2.7/re.py(249)_compile()
-> p = sre_compile.compile(pattern, flags)
(Pdb) 
> /home/vthyng/e/python27/lib/python2.7/re.py(252)_compile()
-> if not bypass_cache:
(Pdb) 
> /home/vthyng/e/python27/lib/python2.7/re.py(253)_compile()
-> if len(_cache) >= _MAXCACHE:
(Pdb) 
> /home/vthyng/e/python27/lib/python2.7/re.py(255)_compile()
-> if p.flags & LOCALE:
(Pdb) 
> /home/vthyng/e/python27/lib/python2.7/re.py(260)_compile()
-> loc = None
(Pdb) 
> /home/vthyng/e/python27/lib/python2.7/re.py(261)_compile()
-> _cache[cachekey] = p, loc
(Pdb) 
> /home/vthyng/e/python27/lib/python2.7/re.py(262)_compile()
-> return p
(Pdb) 
--Return--
> /home/vthyng/e/python27/lib/python2.7/re.py(262)_compile()-><_sre.SR...43f7c1f0>
-> return p
(Pdb) 
--Return--
> /home/vthyng/e/python27/lib/python2.7/re.py(194)compile()-><_sre.SR...43f7c1f0>
-> return _compile(pattern, flags)
(Pdb) 
> /usr/lib/python2.7/urllib.py(1190)splittag()
-> match = _tagprog.match(url)
(Pdb) 
> /usr/lib/python2.7/urllib.py(1191)splittag()
-> if match: return match.group(1, 2)
(Pdb) 
> /usr/lib/python2.7/urllib.py(1192)splittag()
-> return url, None
(Pdb) c
>>> Running: git rev-parse refs/heads/asdf
>>> Running: git merge-base d7f098cba71aee63ed82000ebb2f30c37f01426d origin/asdf
>>> Running: git rev-parse dba95fd8175ea52196c8e6d5dd34a374903ef353
>>> Running: git status --porcelain --untracked-files=no --ignore-submodules=dirty
>>> Running: git rev-parse --git-dir
>>> Running: git version
>>> Running: git -c core.quotepath=false -c diff.noprefix=false diff --no-color --full-index --ignore-submodules -M --no-ext-diff dba95fd8175ea52196c8e6d5dd34a374903ef353..d7f098cba71aee63ed82000ebb2f30c37f01426d
>>> make_request {}
> /home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py(574)make_request()
-> try:
(Pdb) request.url
(Pdb) 
(Pdb) c
Traceback (most recent call last):
  File "/home/vthyng/e/python27/bin/rbt", line 11, in <module>
    sys.exit(main())
  File "/home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/commands/main.py", line 133, in main
    command.run_from_argv([RB_MAIN, command_name] + args)
  File "/home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/commands/__init__.py", line 663, in run_from_argv
    exit_code = self.main(*args) or 0
  File "/home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/commands/post.py", line 798, in main
    diff_validator = api_root.get_diff_validation()
  File "/home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/resource.py", line 492, in <lambda>
    self._get_template_request(url, **kwargs)))
  File "/home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/decorators.py", line 27, in request_method
    *args, **kwargs)
  File "/home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/transport/sync.py", line 75, in execute_request_method
    return self._execute_request(request)
  File "/home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/transport/sync.py", line 84, in _execute_request
    rsp = self.server.make_request(request)
  File "/home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py", line 574, in make_request
    try:
rbtools.api.errors.ServerInterfaceError: [Errno 111] Connection refused
(python27) ✘-1 ~/w/netboot [asdf ↑·1|✔] 
12:06 $ rbt post --debug
>>> RBTools 0.7.10
>>> Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609]
>>> Running on Linux-4.10.0-37-generic-x86_64-with-Ubuntu-16.04-xenial
>>> Home = /home/vthyng
>>> Current directory = /home/vthyng/w/netboot
>>> Command line: rbt post --debug
>>> Running: tf vc help
>>> Checking for a Subversion repository...
>>> Unable to execute "svn help": skipping SVN
>>> Checking for a Git repository...
>>> Running: git rev-parse --git-dir
>>> Running: git config core.bare
>>> Running: git rev-parse --show-toplevel
>>> Running: git symbolic-ref -q HEAD
>>> Running: git config --get branch.asdf.merge
>>> Running: git config --get branch.asdf.remote
>>> Running: git config --get remote.origin.url
>>> repository info: Path: g...@github.localserver.com:vthyng/netboot.git, Base path: , Supports changesets: False
>>> Making HTTP GET request to http://reviewboard.localserver.com/api/
>>> make_request {}
> /home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py(574)make_request()
-> try:
(Pdb) c
>>> Running: git rev-parse refs/heads/asdf
>>> Running: git merge-base d7f098cba71aee63ed82000ebb2f30c37f01426d origin/asdf
>>> Running: git rev-parse dba95fd8175ea52196c8e6d5dd34a374903ef353
>>> Running: git status --porcelain --untracked-files=no --ignore-submodules=dirty
>>> Running: git rev-parse --git-dir
>>> Running: git version
>>> Running: git -c core.quotepath=false -c diff.noprefix=false diff --no-color --full-index --ignore-submodules -M --no-ext-diff dba95fd8175ea52196c8e6d5dd34a374903ef353..d7f098cba71aee63ed82000ebb2f30c37f01426d
>>> make_request {}
> /home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py(574)make_request()
-> try:
(Pdb) c
>>> Cached response for HTTP GET https://reviewboard.localserver.com/api/validation/diffs/ expired and was modified
>>> make_request {}
> /home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py(574)make_request()
-> try:
(Pdb) c
>>> make_request {}
> /home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py(574)make_request()
-> try:
(Pdb) c
>>> Cached response for HTTP GET https://reviewboard.localserver.com/api/review-requests/?only-links=create&only-fields= expired and was modified
>>> make_request {}
> /home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py(574)make_request()
-> try:
(Pdb) c
>>> make_request {}
> /home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py(574)make_request()
-> try:
(Pdb) c
>>> make_request {}
> /home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py(574)make_request()
-> try:
(Pdb) c
>>> make_request {}
> /home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py(574)make_request()
-> try:
(Pdb) c
>>> Running: git log --reverse --pretty=format:%s%n%n%b ^dba95fd8175ea52196c8e6d5dd34a374903ef353 d7f098cba71aee63ed82000ebb2f30c37f01426d
>>> make_request {}
> /home/vthyng/e/python27/local/lib/python2.7/site-packages/rbtools/api/request.py(574)make_request()
-> try:
(Pdb) c
Review request #65234 posted.




Vince

Vince Thyng

unread,
Jan 15, 2018, 5:51:12 PM1/15/18
to Review Board Community
Adding to my previous post, we are seeing django_session table records getting created when the webui is used, and I wasn able to use a sessionid created there with rbt by putting it in the .rbtools-cookies file, however no session is getting created when we get these failures over rbt.  We seem to be narrowing in on the problem, but now need to understand how authentication is being handled differently via rbt / the api compared to the webui.

Vince

On Tuesday, January 6, 2015 at 2:59:26 PM UTC-8, Julian Mehnle wrote:

Christian Hammond

unread,
Jan 15, 2018, 5:59:23 PM1/15/18
to revie...@googlegroups.com
Hi Vince,

Is Review Board configured to use the same domain in General Settings as you have specified in .reviewboardrc? Can you confirm that for me, and also confirm that restarting Apache doesn't fix anything? I'm wondering because it sounds like the cookie is being generated for the wrong domain, which would mean that upon initial authentication, you're getting a cookie and then trying to use it again for the wrong server. Since the RBTools debug output has been modified to mask the domain, I can't verify any of this myself.

What is your web server configuration like? Is Apache handling all requests itself, or are you going through Nginx or another proxy?

Christian

--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "Review Board Community" group.

To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Vince Thyng

unread,
Jan 15, 2018, 6:34:22 PM1/15/18
to Review Board Community

Confirmed, the domain matches exactly.

We have restarted apache many times while troubleshooting this, but tried a restart again just now.  We wanted to try `sudo python -m ipdb $(which rb-site) manage /var/www/reviewboard runserver 0.0.0.0:80`, but ran in to trouble with https not being available.

Sorry, that .rbtools-cookies file post was confusing.  It shows our production server in there as otherserver.com (which I can still post to just fine even after removing the session for it from .rbtools-cookies), and this new one that will replace it as localserver.com.  I think what is noteable about my testing is that when I remove the cookies file, it is not getting populated again, yet if I put a session in there manually that I can see in the database, it works.

Logins via webui work, while new sessions via rbt do not.

We are using apache 2.4.6 without a proxy in front, on centos 7.3

I think it is a pretty basic config, but I removed the 80->443 redirect and tested again just now in case that has introduced a problem.  Still no love.

<VirtualHost *:443>

  ## Vhost docroot
  DocumentRoot "/var/www/reviewboard/"
  ## Alias declarations for resources outside the DocumentRoot
  Alias /static "/var/www/reviewboard/htdocs/static"

  ## Directories, there should at least be a declaration for /var/www/reviewboard/

  <Directory "/var/www/reviewboard/">
    Options -Indexes +FollowSymLinks
    AllowOverride None
    Require all granted
  </Directory>

  ## Logging
  ErrorLog "/var/log/httpd/reviewboard.localserver.com_error_ssl.log"
  ServerSignature Off
  CustomLog "/var/log/httpd/reviewboard.localserver.com_access_ssl.log" combined

  ## SSL directives
  SSLEngine on
  SSLCertificateFile      "/etc/pki/tls/certs/_.west.isilon.com.crt"
  SSLCertificateKeyFile   "/etc/pki/tls/private/_.west.isilon.com.key"
  SSLCertificateChainFile "/etc/pki/tls/certs/_.west.isilon.com.chain.crt"
  SSLCACertificatePath    "/etc/pki/tls/certs"
  WSGIScriptAlias / "/var/www/reviewboard/htdocs/reviewboard.wsgi"
</VirtualHost>


Something else I have noticed is that even with reviewboard in debug mode (set in System Settings->Logging log level = DEBUG, I don't see anything in the reviewboard.log file except 
2018-01-15 20:05:00,809 - INFO -  - root - Reloading logging settings
Is there a way to get it to report ldap failures there?

Vince
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Christian Hammond

unread,
Jan 15, 2018, 10:58:40 PM1/15/18
to revie...@googlegroups.com
Hi Vince,

The debug log shows an immediate failure after providing a login/password, and it's not the one I'd expect if there was an issue with the credentials (you'd see "The username or password was not correct."), which makes me wonder if there's an issue with the credentials even reaching the server.

I've seen this happen when going through an outbound HTTP(S) proxy for a company. If the company has one set up at all, and your system is configured to go through it, then it's likely going to interfere with the requests. Just to sanity-check, can you try passing --no-proxy to RBTools in your test?

LDAP errors will show up as warnings/errors, without the need to enable debug logging. You should see a debug message for "Attempting to authenticate user ..."

If you aren't seeing anything from LDAP, then it sounds like it's not going through LDAP. Can you confirm LDAP is showing up as the auth backend in Authentication Settings?

Christian

To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Vince Thyng

unread,
Jan 16, 2018, 11:56:54 AM1/16/18
to Review Board Community
Hello Christian,

   I was hoping that would be it, but I get the same problem.  I am pretty sure my apache config is the problem.  I replaced my apache customizations with the /var/www/reviewboard/conf/apache-wsgi.conf file and it wrote the session to the .rbtools-cookies file.  Still errored, but it was about ssl which isn't included in that basic file.  So I think I am on the right track.

Thank you very much for your help!

Vince

Vince Thyng

unread,
Jan 16, 2018, 2:14:43 PM1/16/18
to Review Board Community
I think this all came down to not having 'WSGIPassAuthorization On' in my apache config.

Vince

Christian Hammond

unread,
Jan 16, 2018, 5:36:12 PM1/16/18
to revie...@googlegroups.com
Ahh, that would do it, indeed. Sorry, I didn't check for that.

Christian

To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages