Restoring admin privileges

Hi,

Is there a way for me to acquire admin privileges for my non-privileged indico account in the absence of another user with admin privileges? Is there a safe way to poke into the database for this?

How it happened:
I was site admin of our Indico installation (currently v1.2). I was in the process adding another user as site admin and it showed an error message and logged me out. When I logged in I was no longer admin. I could not capture the error messages on screen but I did send the bug report.

Thanks
npanyam

1.2, really? :confused: You need to upgrade ASAP. Your version is no longer supported since a few years, and hasn’t received any updates (besides some security fixes) for at least 5 years.

IIRC Indico 1.2 has a script that can grant admin privileges to a user: indico_admin grant YOURUSERID
So no need to poke around in the database.

Hi,

Thanks for the hint about the script indico_admin. However, the script puts out a bunch of errors and reports no user even though the user does exist and can login. Am I using the script incorrectly? or could there be something else wrong with my setup?

> root@indico:~# indico_admin grant pn
> /usr/local/lib/python2.7/dist-packages/setuptools-28.5.0-py2.7.egg/pkg_resources/__init__.py:190: RuntimeWarning: You have iterated over the result of pkg_resources.parse_version. This is a legacy behavior which is inconsistent with the new version class introduced in setuptools 8.0. In most cases, conversion to a tuple is unnecessary. For comparison of versions, sort the Version instances directly. If you have another use case requiring the tuple, please file a bug with the setuptools project describing that need.
> Traceback (most recent call last):
>   File "/usr/local/lib/python2.7/dist-packages/indico-1.2.1rc10-py2.7.egg/indico/util/admin.py", line 160, in main
>     return args.cmd().run(args)
>   File "/usr/local/lib/python2.7/dist-packages/indico-1.2.1rc10-py2.7.egg/indico/util/admin.py", line 48, in run
>     result = self._run(args)
>   File "/usr/local/lib/python2.7/dist-packages/indico-1.2.1rc10-py2.7.egg/indico/util/admin.py", line 71, in _run
>     self.printUserInfo(avatar, args.id)
>   File "/usr/local/lib/python2.7/dist-packages/indico-1.2.1rc10-py2.7.egg/indico/util/admin.py", line 55, in printUserInfo
>     raise Exception("User id '%s' does not exist" % args_id)
> Exception: User id 'pn' does not exist

You need their numeric user ID. I don’t remember if we show it anywhere in legacy Indico. The first user has ID 0 though, so if that’s you then it’d be easy.

IIRC you can use AvatarHolder().getInstance().getList() to print all users which includes their ID (it’s the dict key).

Hi,

I am unable to grant user privileges using the indico_admin script - shows up some python. “indico_admin grant ” ends with

File “/usr/local/lib/python2.7/dist-packages/cffi-1.8.3-py2.7-linux-x86_64.egg/cffi/api.py”, line 59, in init
“version mismatch, %s != %s” % (backend.version, version)
AssertionError: version mismatch, 1.5.2 != 1.8.3

I’d now like to upgrade from 1.2.1rc10 to the latest production version. I have two queries, one of the two related to the issue in this email thread. What I plan is not actually an upgrade because I plan to set it up on a new server, so it will be a fresh Indico install and using backed up data from old Indico (v1.2)

Qn#1: Should I somehow resolve the admin user issue before taking a final backup, or will newer Indico give me some tools to resolve the carried forward issue? I

Qn#2: Is it possible to run the latest Indico behind a reverse-proxy (nginx) ? Has this been done?

Thanks a lot for help!
Nagaraj

Better upgrade first. All the mess with broken dependencies etc should be gone in 2.x.

Sure. Our own deployment has this setup for example: haproxy loadbalancer → nginx+uwsgi on the individual workers (the latter is actually the default setup that’s done in the setup guide) .

This is a very good idea. Note that you have to use 2.0 first to run the indico-migrate tool to import the data from the 1.2 database; you may have some issues installing that version (since it’s also very old and some dependencies broke) but I think there are workarounds for those issues here in the forum. Also, if you follow the nginx/apache config guide it will be tuned for 2.2+, so if you try to access the 2.0 instance the UI may look somewhat broken - so best to just migrate the data from 1.2 and then upgrade to 2.3 straight away.