Opened 9 years ago

Closed 3 years ago

#1008 closed enhancement (no-action)

gmg makeadmin <user> don't work...

Reported by: Manuel Owned by:
Priority: minor Milestone:
Component: programming Keywords:
Cc: Parent Tickets:


... if launched from the bin dir.

It works well when launched from mediagoblin/ but fails from mediagoblin/bin

Change History (5)

comment:1 by ayleph, 9 years ago

Here's some output to illustrate the issue above. Change to the bin directory and run gmg makeadmin.

~/mediagoblin-dev/bin $ gmg makeadmin
usage: gmg makeadmin [-h] username
gmg makeadmin: error: too few arguments

So far so good, but then give it a username.

 ~/mediagoblin-dev/bin $ gmg makeadmin ayleph authentication is enabled
Traceback (most recent call last):
  File "/srv/mediagoblin/mediagoblin-dev/bin/gmg", line 9, in <module>
    load_entry_point('', 'console_scripts', 'gmg')()
  File "/srv/mediagoblin/mediagoblin-dev/mediagoblin/gmg_commands/", line 156, in main_cli
  File "/srv/mediagoblin/mediagoblin-dev/mediagoblin/gmg_commands/", line 88, in makeadmin
  File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/", line 2323, in one
  File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/", line 2366, in __iter__
  File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/", line 2381, in _execute_and_instances
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/", line 662, in execute
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/", line 761, in _execute_clauseelement
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/", line 874, in _execute_context
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/", line 1024, in _handle_dbapi_exception
  File "build/bdist.linux-x86_64/egg/sqlalchemy/util/", line 196, in raise_from_cause
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/", line 867, in _execute_context
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/", line 324, in do_execute
sqlalchemy.exc.OperationalError: (OperationalError) no such table: core__users u'SELECT AS core__users_id, core__users.username AS core__users_username, AS core__users_email, core__users.pw_hash AS core__users_pw_hash, core__users.created AS core__users_created, core__users.wants_comment_notification AS core__users_wants_comment_notification, core__users.wants_notifications AS core__users_wants_notifications, core__users.license_preference AS core__users_license_preference, core__users.url AS core__users_url, AS core__users_bio, core__users.uploaded AS core__users_uploaded, core__users.upload_limit AS core__users_upload_limit, core__users.location AS core__users_location, core__users.activity AS core__users_activity, AS core__locations_1_id, AS core__locations_1_name, core__locations_1.position AS core__locations_1_position, core__locations_1.address AS core__locations_1_address \nFROM core__users LEFT OUTER JOIN core__locations AS core__locations_1 ON = core__users.location \nWHERE core__users.username = ?' (u'ayleph',)

Well, that exploded, so go back up a directory to verify it actually works there.

~/mediagoblin-dev $ gmg makeadmin ayleph
** Message: pygobject_register_sinkfunc is deprecated (GstObject)
The user is now Admin

comment:2 by ayleph, 9 years ago

Status: newaccepted

Trying to make better use of the Trac workflow by marking this bug confirmed.

comment:3 by Christopher Allan Webber, 9 years ago

I believe the source of the problem here is that it's running without any local config file, since gmg looks for a config file from the directory being run from if one is not specified otherwise...

I'm not sure that's a bug then? The true bug is that a warning that a config file hasn't been found?

comment:4 by Loic Dachary, 8 years ago

Type: defectenhancement

switching to enhancement (i.e. it would be nice to be able to run from the bin directory)

comment:5 by Ben Sturmfels, 3 years ago

Resolution: no-action-required
Status: acceptedclosed

Closing this old bug report - for now gmg needs to either be run in the same directory as the mediagoblin.ini config file or run with the --conf_file argument.

Note: See TracTickets for help on using tickets.