Opened 10 years ago

Closed 4 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:

Description

... 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, 10 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
WARNING:mediagoblin.auth.tools:No authentication is enabled
Traceback (most recent call last):
  File "/srv/mediagoblin/mediagoblin-dev/bin/gmg", line 9, in <module>
    load_entry_point('mediagoblin==0.7.2.dev', 'console_scripts', 'gmg')()
  File "/srv/mediagoblin/mediagoblin-dev/mediagoblin/gmg_commands/__init__.py", line 156, in main_cli
    args.func(args)
  File "/srv/mediagoblin/mediagoblin-dev/mediagoblin/gmg_commands/users.py", line 88, in makeadmin
    username=six.text_type(args.username.lower())).one()
  File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/query.py", line 2323, in one
  File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/query.py", line 2366, in __iter__
  File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/query.py", line 2381, in _execute_and_instances
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 662, in execute
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 761, in _execute_clauseelement
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 874, in _execute_context
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 1024, in _handle_dbapi_exception
  File "build/bdist.linux-x86_64/egg/sqlalchemy/util/compat.py", line 196, in raise_from_cause
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 867, in _execute_context
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/default.py", line 324, in do_execute
sqlalchemy.exc.OperationalError: (OperationalError) no such table: core__users u'SELECT core__users.id AS core__users_id, core__users.username AS core__users_username, core__users.email 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, core__users.bio 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, core__locations_1.id AS core__locations_1_id, core__locations_1.name 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__locations_1.id = 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, 10 years ago

Status: newaccepted

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

comment:3 by Christopher Allan Webber, 10 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, 9 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, 4 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.