Server export not available in docker

120 views
Skip to first unread message

Ismail Mehrez

unread,
Jun 10, 2022, 11:35:55 AM6/10/22
to Review Board Community
Hello, 

I an trying to export a number of review requests using the server export feature in PowerPack Server Import and Export | Documentation | Review Board.
I am using the docker-compose installation provided in the official docs Installing with Docker | Documentation | Review Board with reviewboard image 4.0.6-1. The review board starts Ok and I can use it with no problems, however the export-db subcommand is not available in the container and the powerPack extension is enabled. (This is a clean installation not importing any old data).

I have also added the trial license for Powerpack.

Can someone help to solve this?

Thanks.

I can see this in the ReviewBoard init logs:
reviewboard_1  | + rb-site manage /site enable-extension rbpowerpack.extension.PowerPackExtension
reviewboard_1  | INFO:root:Using reviewboard.scmtools.svn.pysvn backend for SVN
reviewboard_1  | ERROR:djblets.extensions.manager:The Review Board Power Pack extension uses the deprecated "htdocs" directory for static files. This is no longer supported. It must be updated to use a "static" directory instead.


root@ddb5232b45c9:/# pip list | grep Review
ReviewBoard             4.0.6
ReviewBoardPowerPack    4.0


root@ddb5232b45c9:/# rb-site manage /site/ export-db
INFO:root:Using reviewboard.scmtools.svn.pysvn backend for SVN
Unknown command: 'export-db'
Type 'rb-site manage /site help' for usage.


root@ddb5232b45c9:/# rb-site manage /site/ list-extensions
INFO:root:Using reviewboard.scmtools.svn.pysvn backend for SVN
* Name: reviewbot-extension
  Status: disabled
  ID: reviewbotext.extension.ReviewBotExtension

* Name: rbintegrations
  Status: enabled
  ID: rbintegrations.extension.RBIntegrationsExtension

* Name: ReviewBoardPowerPack
  Status: enabled
  ID: rbpowerpack.extension.PowerPackExtension

Christian Hammond

unread,
Jun 10, 2022, 5:09:52 PM6/10/22
to revie...@googlegroups.com
Hi Ismail,

We’re putting out new Docker images likely next week, and they’ll include the new Power Pack.

In the meantime, you can upgrade within your container through:

    pip install -U ReviewBoardPowerPack
    killall -HUP gunicorn 

You can also build your own images that derive from ours and specify the versions of the dependencies you need without waiting for new releases.

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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/reviewboard/277d1f0a-3ed5-4918-9527-b833fc27a898n%40googlegroups.com.
--
--
Christian Hammond
President/CEO of Beanbag
Makers of Review Board

Ismail Mehrez

unread,
Jun 11, 2022, 6:34:45 AM6/11/22
to Review Board Community
Thanks christian for the reply

The current version already had PowerPack 4.0 installed and thanks to your infor, I updated that to 5.0.
However, the export-db subcommand is not available for the 'rb-site mange' command.

root@b9ae4ece0449:/# pip list | grep PowerPack
ReviewBoardPowerPack    5.0

root@b9ae4ece0449:/# rb-site manage /site/ export-db

INFO:root:Using reviewboard.scmtools.svn.pysvn backend for SVN
Unknown command: 'export-db'
Type 'rb-site manage /site help' for usage.

How can I access it?

Ismail

Christian Hammond

unread,
Jun 11, 2022, 7:49:36 PM6/11/22
to revie...@googlegroups.com
Looked into this and there's a bug in the current builds preventing those commands from working in that environment. We have new versions of Review Board, RBTools, and Power Pack scheduled for this coming week. Once those are out, you should be good to go. Announcements for new releases will be made here and through the Official Announcements mailing list (https://www.reviewboard.org/mailing-lists/).

Christian

Ismail Mehrez

unread,
Jul 11, 2022, 12:14:35 PM7/11/22
to Review Board Community
Hi Christian,

Thanks for looking into this. It works now but there is an issue.
What is the correct way to upgrade the database from reviewboard v2.5 to 4.0.7? I have an old instance that I am trying to upgrade in order to be able to export part of it.
"rb-site upgrade" did work (to 3.0 then 4.07) and finished successfully and reviewboard is up. However, when I try to export it doesn't work. I believe the database schema is not correct:

root@1d5ade473564:/# rb-site manage /site export-db -- --review-requests=138850

INFO:root:Using reviewboard.scmtools.svn.pysvn backend for SVN
Traceback (most recent call last):
  File "/venv/bin/rb-site", line 8, in <module>
    sys.exit(main())
  File "/venv/lib/python3.8/site-packages/reviewboard/cmdline/rbsite.py", line 2732, in main
    command.run(site, options)
  File "/venv/lib/python3.8/site-packages/reviewboard/cmdline/rbsite.py", line 2502, in run
    site.run_manage_command(manage_command, manage_args)
  File "/venv/lib/python3.8/site-packages/reviewboard/cmdline/rbsite.py", line 1036, in run_manage_command
    manage_util.execute()
  File "/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/venv/lib/python3.8/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/venv/lib/python3.8/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "build/bdist.macosx-12.0-arm64/wheel/rbpowerpack/importexport/management/commands/export-db.py", line 177, in handle
  File "build/bdist.macosx-12.0-arm64/wheel/rbpowerpack/importexport/exporter.py", line 170, in export_database
  File "build/bdist.macosx-12.0-arm64/wheel/rbpowerpack/importexport/exporter.py", line 651, in _calculate_users
  File "build/bdist.macosx-12.0-arm64/wheel/rbpowerpack/importexport/exporter.py", line 764, in _get_users_for_review_request_ids
  File "/venv/lib/python3.8/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/venv/lib/python3.8/site-packages/django/db/models/query.py", line 787, in filter
    return self._filter_or_exclude(False, *args, **kwargs)
  File "/venv/lib/python3.8/site-packages/django/db/models/query.py", line 805, in _filter_or_exclude
    clone.query.add_q(Q(*args, **kwargs))
  File "/venv/lib/python3.8/site-packages/django/db/models/sql/query.py", line 1250, in add_q
    clause, _ = self._add_q(q_object, self.used_aliases)
  File "/venv/lib/python3.8/site-packages/django/db/models/sql/query.py", line 1268, in _add_q
    child_clause, needed_inner = self._add_q(
  File "/venv/lib/python3.8/site-packages/django/db/models/sql/query.py", line 1273, in _add_q
    child_clause, needed_inner = self.build_filter(
  File "/venv/lib/python3.8/site-packages/django/db/models/sql/query.py", line 1210, in build_filter
    condition = self.build_lookup(lookups, col, value)
  File "/venv/lib/python3.8/site-packages/django/db/models/sql/query.py", line 1105, in build_lookup
    lhs = self.try_transform(lhs, name, lookups)
  File "/venv/lib/python3.8/site-packages/django/db/models/sql/query.py", line 1117, in try_transform
    raise FieldError(
django.core.exceptions.FieldError: Unsupported lookup '' for AutoField or join on the field not permitted.

Christian Hammond

unread,
Jul 20, 2022, 4:14:52 PM7/20/22
to revie...@googlegroups.com
Hi Ismail,

The correct procedure for any upgrade is to:

1. Back up the database through your normal database SQL dump tool.
2. Upgrade Review Board packages.
3. Run 'rb-site upgrade' on the site directory.

If you're using the Docker image exclusively, a new image pointed to your older database will attempt an upgrade automatically on startup.

If the database upgrade didn't show any errors, and you're able to use Review Board, then the upgrade was likely successful.

The database export problem here may just be a bad query. It's hard to tell from what limited information is available in the traceback. Are you able to perform an export if you allow it to export all review request IDs, rather than selectively choosing IDs?

Christian

Reply all
Reply to author
Forward
0 new messages