Reviewboard 2.5.6.1 & comment severity

46 views
Skip to first unread message

harish varadarajan

unread,
Sep 5, 2016, 11:07:05 AM9/5/16
to reviewboard
Post installing reviewboard 2.6.6.1 and extension Comment Severity 0.5.1, when trying to run collectstatic, the following error is seen.
The version of lessc is 2.7.1
File "/usr/lib/python2.7/site-packages/pipeline/compilers/__init__.py", line 99, in execute_command
    raise CompilerError(stderr)
pipeline.exceptions.CompilerError: NameError: variable @STATIC_ROOT is undefined in /usr/lib/python2.7/site-packages/reviewboard/static/rb/css/pages/reviews.less on line 3, column 21:
2 @import (reference) "../mixins/upload-diff.less";
3 @import (reference) "@{STATIC_ROOT}djblets/css/mixins/markdown.less";

I remember reading a post that lessc versions 2.X is not supported. 
If yes, could this be the case of above failure ?
If not, what could cause this behavior. Any inputs on how to proceed further / fix this, will be helpful.

Thanks.

Harish


David Trowbridge

unread,
Sep 5, 2016, 12:56:57 PM9/5/16
to reviewboard
Why are you running collectstatic? If you're installing from our pre-built packages, all the static media has already been compiled.

-David

--
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...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

harish varadarajan

unread,
Sep 6, 2016, 3:58:13 AM9/6/16
to reviewboard
Hi David,

In our environment, we had moved the reviewboard instance from one server to another, while as well upgrading versions from 2.0.15 to 2.5.6.1
Post setting up sql, apache, we had run rb-site install and moved over the DB from older host to newer one, post which rb-site upgrade and rb-site manage $site collectstatic was run.

Considering the fact that now collectstatic has been run in a production environment, and that comment severity is broken, is there a way to fix this.
I believe copying of static contents from older server to newer one should never be done and hence what would be the correct way to populate these contents.

Thanks.

--
Harish

Christian Hammond

unread,
Sep 6, 2016, 5:00:07 AM9/6/16
to revie...@googlegroups.com
Hi,

rb-site upgrade manages the static media for Review Board itself, and extensions missing static media files will have them copied from the extension.

Try erasing the contents of $sitedir/static and then do:

rb-site upgrade $sitedir
rb-site manage $sitedir install-extension-media -- --force

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.


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

harish varadarajan

unread,
Sep 6, 2016, 5:09:36 AM9/6/16
to revie...@googlegroups.com
Hi Christian,

Thanks for the inputs.
But, this didn't solve the issue.

Log of rb-site upgrade:
Rebuilding directory structure
Updating database. This may take a while.

The log output below, including warnings and errors,
can be ignored unless upgrade fails.

------------------ <begin log output> ------------------
Creating tables ...
There are unapplied evolutions for webapi.
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)
No evolution required.
------------------- <end log output> -------------------

Resetting in-database caches.

Upgrade complete!

Log of rb-site manage:
There are unapplied evolutions for webapi.
There are unapplied evolutions for webapi.
There are unapplied evolutions for webapi.

From the developer tools of chrome, for an already present review request:

GET http://$site/static/ext/rbmotd.extension.MotdExtension/css/default.min.css 404 (Not Found)
(index):796 GET http://$site/static/ext/rbseverity.extension.SeverityExtension/js/severity-review.min.js 
(index):802 Uncaught ReferenceError: RBSeverity is not defined

Post moving the previous static, and running rb-site manage $sitedir install-extension-media -- --force, I find that the directory structures css and js were not created under static.



--
Harish

You received this message because you are subscribed to a topic in the Google Groups "reviewboard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/reviewboard/fSfbi8N9Msk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to reviewboard+unsubscribe@googlegroups.com.

Christian Hammond

unread,
Sep 6, 2016, 5:31:06 AM9/6/16
to revie...@googlegroups.com
The fact that the upgrade didn't complain about any evolutions being required, but install-static-media did, is a bit of a red flag for me. I'm not sure how you went about performing the migration between servers, but I wouldn't have expected to see those errors... It could be preventing the static media from installing.

1) When you say the css and js directories were not created under static, do you mean $sitedir/htdocs/static? That would have been handled under rb-site upgrade.

Can you run:

    $ find $sitedir

(Replace $sitedir, of course, with the path to the site directory, which contains conf/ and htdocs/ and such.)


2) How did you handle getting the new Python modules on the new server? Did you copy them over, or reinstall?

What I'm going to have you do is force a reinstall of the rbseverity egg. First, we're going to ensure you have the latest version of pip:

    pip install -U pip

Then, we're going to uninstall with pip, and re-install with easy_install:

    pip uninstall pip
    easy_install -U rbseverity

The reason is that we don't currently ship wheels for rbseverity, just eggs, and so we need easy_install for this. If you had previously installed using pip, then things might not have been installed exactly right. Or, if you copied over packages from the old server, it also might not have installed right.

You'll also want to do this for any other extension you have.


3) Once you've done the above, re-run the install-extension-media command, and then restart Apache.

If that shows the "unapplied evolutions" again, we'll have to diagnose that next. However, it's 2:30AM here, so I won't be up any longer. I'll be around to look into this further tomorrow.


4)  Just as a sanity check, go into the Review Board admin page -> Extensions and make sure none of the extensions are reporting any errors. If they are, let me know which ones and what the error says.


Christian


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

harish varadarajan

unread,
Sep 6, 2016, 7:45:27 AM9/6/16
to revie...@googlegroups.com
Hi Christian,

reinstalling through easy_install and running install-static-media helped, though i had to run collectstatic to populate the static directory with the right contents for css / js and ext.
The comment severity now shows up for the review comments.

Thanks to the team at beanbag for the help and assistance.



--
Harish

Christian Hammond

unread,
Sep 6, 2016, 1:31:18 PM9/6/16
to revie...@googlegroups.com
You definitely should not need to run collectstatic, and doing so can definitely break things in ways you may not have encountered yet. It's best to forget that command exists. If static media is not working without it, you have a bigger issue to solve on the server.

harish varadarajan

unread,
Sep 6, 2016, 9:44:34 PM9/6/16
to reviewboard, chri...@beanbaginc.com
Hi Christian,

Thanks for the inputs. Let me triage further on this and provide inputs on what and where is breaking.
Based on your comments, if something was to break because of using collectstatic, I believe it has to be related only to extensions.
Is my understanding correct.

--
Harish

Christian Hammond

unread,
Sep 6, 2016, 11:45:45 PM9/6/16
to harish varadarajan, reviewboard
Hi Harish,

collectstatic will also affect the Review Board media. It will end up recompiling the media files locally, which may result in different styles than what we ship. This can impact extensions, but also various parts of Review Board itself, particularly in the upcoming 3.0 (as media compilation will be more involved, and potentially more sensitive to platform differences).

Review Board and extensions all ship the static media designed for production use, so it's important that those are used. collectstatic will prevent those from being used altogether.

Christian

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

Reply all
Reply to author
Forward
0 new messages