Page MenuHomePhabricator

Vagrant Setup alembic config errors
Closed, DeclinedPublic

Description

Setting up Vagrant via the mediawiki installation guide works fine (http://127.0.0.1:8080/wiki/Main_Page), but on trying to set up a wikimetrics instance and running "vagrant reload --provision", I get an "The SSH command responded with a non-zero exit status." error and thus the wikimetrics site isn't available on localhost:5000.

The Vagrant stdout points to a "tablename = db.config['ARCHIVE_TABLENAME']; KeyError: 'ARCHIVE_TABLENAME'".

Log of my Vagrant stdout is here.

Related Objects

Event Timeline

Memeht created this task.May 19 2015, 12:32 AM
Memeht raised the priority of this task from to Needs Triage.
Memeht updated the task description. (Show Details)
Memeht added subscribers: Memeht, Milimetric.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 19 2015, 12:32 AM
bd808 added a subscriber: bd808.

The interesting part of the Puppet trace is:

==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns: Traceback (most recent call last):
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:   File "/usr/local/bin/alembic", line 9, in <module>
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:     load_entry_point('alembic==0.6.4', 'console_scripts', 'alembic')()
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:   File "/usr/local/lib/python2.7/dist-packages/alembic/config.py", line 298, in main
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:     CommandLine(prog=prog).main(argv=argv)
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:   File "/usr/local/lib/python2.7/dist-packages/alembic/config.py", line 293, in main
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:     self.run_cmd(cfg, options)
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:   File "/usr/local/lib/python2.7/dist-packages/alembic/config.py", line 279, in run_cmd
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:     **dict((k, getattr(options, k)) for k in kwarg)
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:   File "/usr/local/lib/python2.7/dist-packages/alembic/command.py", line 125, in upgrade
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:     script.run_env()
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:   File "/usr/local/lib/python2.7/dist-packages/alembic/script.py", line 203, in run_env
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:     util.load_python_file(self.dir, 'env.py')
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:   File "/usr/local/lib/python2.7/dist-packages/alembic/util.py", line 212, in load_python_file
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:     module = load_module_py(module_id, path)
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:   File "/usr/local/lib/python2.7/dist-packages/alembic/compat.py", line 58, in load_module_py
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:     mod = imp.load_source(module_id, path, fp)
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:   File "database_migrations/env.py", line 18, in <module>
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:     from wikimetrics.configurables import db, setup_testing_config
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:   File "/vagrant/wikimetrics/wikimetrics/__init__.py", line 4, in <module>
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:     from .controllers import *
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:   File "/vagrant/wikimetrics/wikimetrics/controllers/__init__.py", line 11, in <module>
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:     from home import *
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:   File "/vagrant/wikimetrics/wikimetrics/controllers/home.py", line 3, in <module>
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:     from authentication import is_public
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:   File "/vagrant/wikimetrics/wikimetrics/controllers/authentication.py", line 20, in <module>
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:     from wikimetrics.models import UserStore
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:   File "/vagrant/wikimetrics/wikimetrics/models/__init__.py", line 3, in <module>
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:     from mediawiki import *
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:   File "/vagrant/wikimetrics/wikimetrics/models/mediawiki/__init__.py", line 8, in <module>
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:     from archive import *
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:   File "/vagrant/wikimetrics/wikimetrics/models/mediawiki/archive.py", line 9, in <module>
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:     class Archive(db.MediawikiBase):
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:   File "/vagrant/wikimetrics/wikimetrics/models/mediawiki/archive.py", line 34, in Archive
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns:     __tablename__ = db.config['ARCHIVE_TABLENAME']
==> default: Notice: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns: KeyError: 'ARCHIVE_TABLENAME'
==> default: Error: /usr/local/bin/alembic upgrade head returned 1 instead of one of [0]
==> default: Error: /Stage[main]/Wikimetrics::Database/Exec[alembic_upgrade_head]/returns: change from notrun to 0 failed: /usr/local/bin/alembic upgrade head returned 1 instead of one of [0]

I took a look this morning and this worked out of the box for me. The error pasted above basically means the configuration file didn't get written to /etc/wikimetrics/ Could you check that directory for the db_conf.yaml file and see if it has an ARCHIVE_TABLENAME property? If not, could you try setting up vagrant from scratch and seeing if it has problems writing to that file before it errors out here? I know this sucks, but troubleshooting these kinds of issues always seems like a moving target to me.

I remember seeing a db_config.yaml.erb file with the 'ARCHIVE_TABLENAME' property, in the ./puppet/modules/wikimetrics/templates directory. I'm currently afk, but once I get back I'll try to setting up vagrant afresh.

Memeht added a comment.EditedMay 21 2015, 6:57 PM

So, I tried reinstalling twice last night, and both times I get an error message on running the wikimetrics vagrant setup. From looking at the stdout error code, a bunch of failed dependencies seems to be at fault.

And this makes sense, since vagrant is using apt-get to download the packages, and apt-get isn't the package manager used for my Mac OS X computer. Is there a way to specify HomeBrew or some other package manager to Vagrant?

Here are the errors thrown to stout

@Memeht, honestly I feel your pain. Every person I know who's tried to work with mediawiki-vagrant runs into some problems like this. I don't see why apt-get would be a problem, because puppet is executing that code inside the guest operating system, which is ubuntu. But clearly there's some kind of problem. I can offer two paths out of this:

  1. If all you're trying to do is run wikimetrics locally, I can help you set it up directly so you don't need mediawiki-vagrant. Just throw a google hangout on my calendar and I'm happy to help.
  1. If you're trying to get mediawiki-vagrant running for other purposes, I have no useful advice other than _completely_ wiping everything and re-installing the latest version of everything, then trying again. And by completely wiping I mean ~/.vagrant.d and ~/VirtualBox VMs and uninstalling vagrant and virtualbox with --purge, --obliterate-into-nothingess or whatever super final options are available in brew. If it helps, last time I had a problem with vagrant, I had to repeat the uninstall / reinstall process for hours until I figured out how to get rid of every last trace and get a fresh working copy. And Marcel went through a similar thing. Since then, I haven't had any problems so I'm keeping my fingers crossed.
Memeht added a comment.EditedMay 27 2015, 3:53 PM

@Millimetric I'm trying to run wikimetrics locally. I've also created a google hangouts session and invited you to the event via your Phabricator calendar. Let me know if the time works.

@Milimetric So sorry got the times screwed up, are you available later today still?

@Memeht: yes. I can grab some lunch and hang out now if you want.

@Milimetric That would be wonderful! Say, 1p.m PST?

mforns closed this task as Declined.Mar 26 2019, 2:08 PM
mforns added a subscriber: mforns.

Declining because Wikimetrics is being discontinued. See: T211835.

Restricted Application added a project: Analytics. · View Herald TranscriptMar 26 2019, 2:08 PM