1. Marcin Kuzminski
  2. RhodeCode
  3. Issues


Issue #267 wontfix

RhodeCode crashes when run from start-stop-daemon

Sean Russell
created an issue

RhodeCode won't start on Ubuntu (on my machine) from start-stop-daemon, as in an init script. The problem shows itself as this stack trace (listed at the bottom); the fundamental issue is that neither {{{VCSRC_PATH}}} nor {{{HOME}}} are defined in the start-stop-daemon function (which I suspect unsets all environment variables), so the line:

{{{ VCSRC_PATH = os.environ.get('VCSRC_PATH', abspath(os.getenv('HOME'), '.vcsrc')) }}}

throws a {{{NoneType}}} error. This looks like a failure to check for valid arguments, resulting in a null pointer bug; my fix was to provide a default value in case {{{HOME}}} is not defined, thereby ensuring that the statement evaluates to something other than null and preventing {{{os.path.join()}}} from crashing:

{{{ VCSRC_PATH = os.environ.get('VCSRC_PATH', abspath(os.getenv('HOME', ''), '.vcsrc')) }}}

This started happening after an upgrade from 1.1.8 to 1.2.1. RhodeCode is installed with Python in a venv.

{{{ Traceback (most recent call last): File "/var/www/rhodecode-venv/bin/paster", line 8, in <module> load_entry_point('PasteScript==', 'console_scripts', 'paster')() File "/var/www/rhodecode-venv/lib/python2.6/site-packages/paste/script/command.py", line 104, in run invoke(command, command_name, options, args[1:]) File "/var/www/rhodecode-venv/lib/python2.6/site-packages/paste/script/command.py", line 143, in invoke exit_code = runner.run(args) File "/var/www/rhodecode-venv/lib/python2.6/site-packages/paste/script/command.py", line 238, in run result = self.command() File "/var/www/rhodecode-venv/lib/python2.6/site-packages/paste/script/serve.py", line 279, in command self.logging_file_config(log_fn) File "/var/www/rhodecode-venv/lib/python2.6/site-packages/paste/script/command.py", line 788, in logging_file_config here=os.path.dirname(config_file))) File "/usr/lib/python2.6/logging/config.py", line 76, in fileConfig formatters = _create_formatters(cp) File "/usr/lib/python2.6/logging/config.py", line 133, in _create_formatters c = _resolve(class_name) File "/usr/lib/python2.6/logging/config.py", line 94, in _resolve found = import(used) File "/var/www/rhodecode-venv/lib/python2.6/site-packages/rhodecode/init.py", line 38, in <module> from rhodecode.lib.utils import get_current_revision File "/var/www/rhodecode-venv/lib/python2.6/site-packages/rhodecode/lib/utils.py", line 40, in <module> from vcs import get_backend File "/var/www/rhodecode-venv/lib/python2.6/site-packages/vcs/init.py", line 22, in <module> from vcs.backends import get_repo, get_backend File "/var/www/rhodecode-venv/lib/python2.6/site-packages/vcs/backends/init.py", line 13, in <module> from vcs.conf import settings File "/var/www/rhodecode-venv/lib/python2.6/site-packages/vcs/conf/settings.py", line 5, in <module> VCSRC_PATH = os.environ.get('VCSRC_PATH', abspath(os.getenv('HOME'), '.vcsrc')) File "/var/www/rhodecode-venv/lib/python2.6/site-packages/vcs/conf/settings.py", line 3, in <lambda> abspath = lambda p: os.path.abspath(os.path.join(p)) File "/var/www/rhodecode-venv/lib/python2.6/posixpath.py", line 67, in join elif path == '' or path.endswith('/'): AttributeError: 'NoneType' object has no attribute 'endswith' Removing PID file /var/www/rhodecode/rhodecode.pid }}}

Comments (1)

  1. Log in to comment