Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python exception on installation #41

Open
rchl opened this issue May 18, 2013 · 6 comments
Open

Python exception on installation #41

rchl opened this issue May 18, 2013 · 6 comments

Comments

@rchl
Copy link
Collaborator

rchl commented May 18, 2013

Creating group 'critic' ...
Creating user 'critic' ...
Creating directory '/etc/critic' ...
Creating directory '/etc/critic/main' ...
Creating directory '/usr/share/critic' ...
Creating directory '/var/lib/critic/relay' ...
Creating directory '/var/lib/critic/outbox' ...
Creating directory '/var/lib/critic/outbox/sent' ...
Creating directory '/var/cache/critic' ...
Creating directory '/var/cache/critic/main' ...
Creating directory '/var/cache/critic/main/highlight' ...
Creating directory '/var/git' ...
Creating directory '/var/log/critic' ...
Creating directory '/var/log/critic/main' ...
Creating directory '/var/run/critic' ...
Creating directory '/var/run/critic/main' ...
Creating directory '/var/run/critic/main/sockets' ...
Creating directory '/var/run/critic/main/wsgi' ...
Copied 318 files into /usr/share/critic ...
Creating database ...
Enabling module expires.
To activate the new configuration, you need to run:
  service apache2 restart
Enabling module rewrite.
To activate the new configuration, you need to run:
  service apache2 restart
Module wsgi already enabled
Enabling site critic-main.
To activate the new configuration, you need to run:
  service apache2 reload
 * Restarting web server apache2                                                                                                                                               apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
 ... waiting .apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
                                                                                                                                                                        [ OK ]
 Adding system startup for /etc/init.d/critic-main ...
   /etc/rc0.d/K20critic-main -> ../init.d/critic-main
   /etc/rc1.d/K20critic-main -> ../init.d/critic-main
   /etc/rc6.d/K20critic-main -> ../init.d/critic-main
   /etc/rc2.d/S20critic-main -> ../init.d/critic-main
   /etc/rc3.d/S20critic-main -> ../init.d/critic-main
   /etc/rc4.d/S20critic-main -> ../init.d/critic-main
   /etc/rc5.d/S20critic-main -> ../init.d/critic-main
FAILED: installation.initd.execute()
Traceback (most recent call last):
  File "install.py", line 151, in <module>
    if hasattr(module, "install") and not module.install(data):
  File "/home/rchlodnicki/workspace/critic/installation/initd.py", line 49, in install
    installation.process.check_call([target_path, "start"])
  File "/usr/lib/python2.7/subprocess.py", line 537, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 524, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1308, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

ERROR: Installation aborted.

 Removing any system startup links for /etc/init.d/critic-main ...
   /etc/rc0.d/K20critic-main
   /etc/rc1.d/K20critic-main
   /etc/rc2.d/S20critic-main
   /etc/rc3.d/S20critic-main
   /etc/rc4.d/S20critic-main
   /etc/rc5.d/S20critic-main
   /etc/rc6.d/K20critic-main
Site critic-main disabled.
To activate the new configuration, you need to run:
  service apache2 reload
Enabling site default.
To activate the new configuration, you need to run:
  service apache2 reload
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
@rchl
Copy link
Collaborator Author

rchl commented May 18, 2013

Then I've tried uninstall.py and it first failed because /etc/critic wasn't created.
I've created it and ran uninstall.py again - it completed successfully.
Tried run install.py again and got:

Where should Critic's persistent data files live? [/var/lib/critic]
Invalid input: directory already exists (NOTE: if Critic is already installed and you want to upgrade to the latest version of Critic, then run upgrade.py rather than re-running install.py).

Looks like uninstall misses some stuff.

@mo
Copy link
Collaborator

mo commented May 18, 2013

Which distro where you trying to install on when you saw the original install.py crash?

As a temporary workaround until uninstall.py is improved, you might be able to completely remove critic and loose all data etc using this nasty sledgehammer:

    sudo killall -u critic
    sleep 0.2
    sudo killall -9 -u critic
    sudo service critic-main stop
    sudo service apache2 stop
    sudo rm -rf /etc/critic /var/{lib,log,cache,run}/critic /usr/share/critic /var/git
    sudo rm -f /etc/apache2/sites-{enabled,available}/critic-main /etc/init.d/critic-main /usr/bin/criticctl
    sudo -u postgres psql -c "drop database critic;"
    sudo -u postgres psql -c "drop user critic;"
    sudo gpasswd -d molsson critic
    sudo deluser --system critic
    sudo delgroup --system critic
    sudo update-rc.d critic-main remove
    sudo service apache2 restart
    sudo rm -rf ~/src/critic/.install.data

@mo
Copy link
Collaborator

mo commented May 18, 2013

replace molsson and ~/src/critic with your equivalents ofc

@rchl
Copy link
Collaborator Author

rchl commented May 18, 2013

Using Ubuntu 13.04.
Thanks for the sledge hammer. I won't use it for now as I can make uninstall complete successfully after creating that dir manually.
I would be more interested in a way to make it install properly. :)

@jensl
Copy link
Owner

jensl commented May 18, 2013

Ubuntu 13.04 is certainly a well-tested and supported OS. Or at least the "server" variant is. Odd that you should have a problem with it. Can you check if you have an (executable) /bin/sh?

@rchl
Copy link
Collaborator Author

rchl commented May 18, 2013

I found out what's the problem. It's the fact that cloned repo had CRLF line endings (apparently autocrlf = true is not a good default on linux). Works fine with "false" and cloning again.
Feel free to resolve or maybe handle it somehow (bail out quickly with a warning/error maybe?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants