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

Problems with Ubuntu 14 - firefox #8

Closed
phoebebright opened this issue Sep 15, 2015 · 25 comments
Closed

Problems with Ubuntu 14 - firefox #8

phoebebright opened this issue Sep 15, 2015 · 25 comments

Comments

@phoebebright
Copy link

Having run hitch init as my hitch user I run hitch test simple_reminder.test and get these errors. Not sure if they are related. Same errors occurr for both python 2.7 and 3.

RUNNING TEST Sign up, create reminder and wait for email reminder to arrive in python 2.7.10
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Traceback (most recent call last):
  File "/home/django/django-remindme/pyv2.7.10/bin/pip", line 7, in <module>
    from pip import main
  File "/home/django/django-remindme/pyv2.7.10/lib/python2.7/site-packages/pip/__init__.py", line 2, in <module>
    from __future__ import absolute_import
ImportError: No module named __future__
RUNNING TEST Sign up, create reminder and wait for email reminder to arrive in python 2.7.10
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Traceback (most recent call last):
  File "/home/django/django-remindme/pyv2.7.10/bin/pip", line 7, in <module>
    from pip import main
  File "/home/django/django-remindme/pyv2.7.10/lib/python2.7/site-packages/pip/__init__.py", line 2, in <module>
    from __future__ import absolute_import
ImportError: No module named __future__

and then...

[        Err Firefox] Traceback (most recent call last):
[        Err Firefox]   File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
[        Err Firefox]     "__main__", mod_spec)
[        Err Firefox]   File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
[        Err Firefox]     exec(code, run_globals)
[        Err Firefox]   File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/hitchselenium/server.py", line 30, in <module>
[        Err Firefox]     run()
[        Err Firefox]   File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/hitchselenium/server.py", line 14, in run
[        Err Firefox]     driver = webdriver.Firefox(firefox_profile=Profile())
[        Err Firefox]   File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/selenium/webdriver/firefox/webdriver.py", line 77, in __init__
[        Err Firefox]     self.binary, timeout),
[        Err Firefox]   File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/selenium/webdriver/firefox/extension_connection.py", line 49, in __init__
[        Err Firefox]     self.binary.launch_browser(self.profile)
[        Err Firefox]   File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 68, in launch_browser
[        Err Firefox]     self._wait_until_connectable()
[        Err Firefox]   File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 98, in _wait_until_connectable
[        Err Firefox]     raise WebDriverException("The browser appears to have exited "
[        Err Firefox] selenium.common.exceptions.WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.

and later:

Exception occurred in Sign up, create reminder and wait for email reminder to arrive in python 3.4.3 (/home/django/django-remindme/django-remindme-tests/simple_reminder.test) setup.


[0]: function 'set_up'   ( self.stacktrace[0].ipython() )
  /home/django/django-remindme/django-remindme-tests/engine.py

    98 :         )
    99 : 
--> 100 :         self.services.startup(interactive=False)
    101 : 
    102 :         # Configure selenium driver



[1]: function 'startup'   ( self.stacktrace[1].ipython() )
  /home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/hitchserve/service_bundle.py

    180 :             if interactive:
    181 :                 self.start_interactive_mode()
--> 182 :             raise what_happened
    183 :         else:
    184 :             if interactive:



hitchserve.hitch_exception.ServiceSuddenStopException

Service 'Firefox' stopped suddenly.

In [1]: exit

[            WARNING] Celery stopped prematurely.
[            WARNING] Django stopped prematurely.
[              Hitch] Stopping Postgres
[            WARNING] Cron stopped prematurely.
[              Hitch] Stopping Redis
[              Hitch] Stopping HitchSMTP
[            WARNING] Firefox stopped prematurely.
[              Hitch] Celery Stopped
[              Hitch] Postgres Stopped
[              Hitch] Redis Stopped
[              Hitch] Firefox Stopped
[              Hitch] Django Stopped
[              Hitch] HitchSMTP Stopped
[              Hitch] Cron Stopped
[              Hitch] Shutdown successful in 0.1 seconds

looking for the firefox log, I came across the stdout directory:

drwxrwxr-x 2 hitcher hitcher 4096 Sep 15 09:10 ./
drwxrwxr-x 5 hitcher hitcher 4096 Sep 15 09:10 ../
-rw-rw-r-- 1 hitcher hitcher    0 Sep 15 09:10 celery_poststart.err
-rw-rw-r-- 1 hitcher hitcher    0 Sep 15 09:10 celery_poststart.out
-rw-rw-r-- 1 hitcher hitcher  280 Sep 15 09:10 celery_setup.err
-rw-rw-r-- 1 hitcher hitcher    0 Sep 15 09:10 celery_setup.out
-rw-rw-r-- 1 hitcher hitcher    0 Sep 15 09:10 cron_poststart.err
-rw-rw-r-- 1 hitcher hitcher    0 Sep 15 09:10 cron_poststart.out
-rw-rw-r-- 1 hitcher hitcher    0 Sep 15 09:10 cron_setup.err
-rw-rw-r-- 1 hitcher hitcher    0 Sep 15 09:10 cron_setup.out
-rw-rw-r-- 1 hitcher hitcher    0 Sep 15 09:10 django_poststart.err
-rw-rw-r-- 1 hitcher hitcher    0 Sep 15 09:10 django_poststart.out
-rw-rw-r-- 1 hitcher hitcher  280 Sep 15 09:10 django_setup.err
-rw-rw-r-- 1 hitcher hitcher   27 Sep 15 09:10 django_setup.out
-rw-rw-r-- 1 hitcher hitcher   14 Sep 15 09:10 driver.err
-rw-rw-r-- 1 hitcher hitcher   14 Sep 15 09:10 driver.out
-rw-rw-r-- 1 hitcher hitcher    0 Sep 15 09:10 firefox_poststart.err
-rw-rw-r-- 1 hitcher hitcher    0 Sep 15 09:10 firefox_poststart.out
-rw-rw-r-- 1 hitcher hitcher    0 Sep 15 09:10 firefox_setup.err
-rw-rw-r-- 1 hitcher hitcher    0 Sep 15 09:10 firefox_setup.out
-rw-rw-r-- 1 hitcher hitcher    0 Sep 15 09:10 hitchsmtp_poststart.err
-rw-rw-r-- 1 hitcher hitcher    0 Sep 15 09:10 hitchsmtp_poststart.out
-rw-rw-r-- 1 hitcher hitcher    0 Sep 15 09:10 hitchsmtp_setup.err
-rw-rw-r-- 1 hitcher hitcher    0 Sep 15 09:10 hitchsmtp_setup.out
-rw-rw-r-- 1 hitcher hitcher    0 Sep 15 09:10 postgres_poststart.err
-rw-rw-r-- 1 hitcher hitcher   60 Sep 15 09:10 postgres_poststart.out
-rw-rw-r-- 1 hitcher hitcher  194 Sep 15 09:10 postgres_setup.err
-rw-rw-r-- 1 hitcher hitcher 1587 Sep 15 09:10 postgres_setup.out
-rw-rw-r-- 1 hitcher hitcher    0 Sep 15 09:10 redis_poststart.err
-rw-rw-r-- 1 hitcher hitcher    0 Sep 15 09:10 redis_poststart.out
-rw-rw-r-- 1 hitcher hitcher    0 Sep 15 09:10 redis_setup.err
-rw-rw-r-- 1 hitcher hitcher    0 Sep 15 09:10 redis_setup.out

checking the contents of these files:

more celery_setup.err
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'

more django_setup.err
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'

stdlog# more django_setup.out
Checking Django version...

stdlog# more driver.err

stdlog# more postgres_poststart.out
Creating users and databases...
CREATE ROLE
CREATE DATABASE

stdlog# 

stdlog# more postgres_setup.err

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Havn't managed to find firefox log, if there is one. A bit of googling suggests maybe an incompatibility between the versions of firefox and selenium? Am happy to keep researching this but reporting it in case there is an easy solution.

@crdoconnor
Copy link
Contributor

Hi Phoebe,

Could you let me know a couple of things:

  • What version of firefox do you have installed? (firefox -V)
  • Is your machine 32 bit or 64 bit? (run uname -a)

Apart from the firefox problem (which looks like it might be an old version of firefox), I think the other issue is that python did not build properly. I used pyenv for building python, which has some suggestions here:

https://github.com/yyuu/pyenv/wiki/Common-build-problems

@crdoconnor
Copy link
Contributor

Can you first try:

Remove django-remindme/pyv2.7.10 directory
Remove django-remindme/pyv3.4.3 directory
Remove the ~/.hitchpkg directory
Run sudo apt-get update ; sudo apt-get upgrade

Then try running the test again.

@phoebebright
Copy link
Author

firefox -V

 (process:21709): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed

Mozilla Firefox 40.0.

uname -a

 Linux jenkins 3.13.0-042stab108.2 #1 SMP Tue May 12 18:07:50 MSK 2015 x86_64 x86_64 x86_64 GNU/Linux

@phoebebright
Copy link
Author

Am using the python versions that were installed on the server as default. Should I build them again? Am reinstalling now...

@crdoconnor
Copy link
Contributor

No, no need to change the versions of python you have installed. It only uses the system python to bootstrap itself.

Hitch installs its own version(s) of python in a directory called "~/.hitchpkg" and then creates a virtualenv from that to run your code with. It does this so that you can specify the exact version of python you want to test your code with instead of just using whatever the system happens to have installed. It also means that you can run the same tests against multiple versions of python (django-remindme-tests does this).

Unfortunately there seems to be a problem with what it is doing currently. I suspect deleting the above 3 directories and running hitch test . again may solve the problem. It will download and build those python versions by itself if they are not there.

If that doesn't work, I will dig deeper to see what else it could be.

@crdoconnor
Copy link
Contributor

Can you also try just running firefox on the console? Does it run ok?

@crdoconnor
Copy link
Contributor

I may have replicated issue on my machine. It appears to happen when the virtualenv (/home/django/django-remindme/pyv2.7.10) exists but the base python it is built upon - "~/.hitchpkg/python2.7.10/bin/python" does not exist or is not accessible.

The question is how ~/.hitchpkg suddenly disappeared or stopped working for you. When you run a test it should take care of building both.

@phoebebright
Copy link
Author

That was exciting! Whole server upgraded and all shiny and new.
But now have a permissions problem.
If I do hitch init as my hitcher user, still get pyuv problem but just the same as before
But then I run the tests and get a permissions problem:

Permission denied

RUNNING TEST Sign up, create reminder and wait for email reminder to arrive in python 3.4.3
Using base prefix '/home/hitcher/.hitchpkg/python3.4.3'
Traceback (most recent call last):
  File "/home/hitcher/.hitchpkg/python3.4.3/bin/virtualenv", line 11, in <module>
    sys.exit(main())
  File "/home/hitcher/.hitchpkg/python3.4.3/lib/python3.4/site-packages/virtualenv.py", line 832, in main
    symlink=options.symlink)
  File "/home/hitcher/.hitchpkg/python3.4.3/lib/python3.4/site-packages/virtualenv.py", line 994, in create_environment
    site_packages=site_packages, clear=clear, symlink=symlink))
  File "/home/hitcher/.hitchpkg/python3.4.3/lib/python3.4/site-packages/virtualenv.py", line 1170, in install_python
    mkdir(lib_dir)
  File "/home/hitcher/.hitchpkg/python3.4.3/lib/python3.4/site-packages/virtualenv.py", line 448, in mkdir
    os.makedirs(path)
  File "/home/hitcher/.hitchpkg/python3.4.3/lib/python3.4/os.py", line 227, in makedirs
    makedirs(head, mode, exist_ok)
  File "/home/hitcher/.hitchpkg/python3.4.3/lib/python3.4/os.py", line 227, in makedirs
    makedirs(head, mode, exist_ok)
  File "/home/hitcher/.hitchpkg/python3.4.3/lib/python3.4/os.py", line 237, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/home/django/django-remindme/pyv3.4.3'


builtins.FileNotFoundError

[Errno 2] No such file or directory: '/home/django/django-remindme/pyv3.4.3/bin/python'

hitcher@jenkins:/home/django/django-remindme/django-remindme-tests$ ll
total 52
drwxr-xr-x 4 hitcher root    4096 Sep 15 12:25 ./
drwxr-xr-x 5 root    root    4096 Sep 15 11:35 ../
-rw-r--r-- 1 hitcher root      96 Sep 13 16:44 base.yml
-rw-r--r-- 1 hitcher root    6000 Sep 13 16:44 engine.py
-rw-r--r-- 1 hitcher root      46 Sep 13 16:44 .git
-rw-r--r-- 1 hitcher root      24 Sep 13 16:44 .gitignore
drwxrwxr-x 3 hitcher hitcher 4096 Sep 15 12:25 .hitch/
-rw-r--r-- 1 hitcher root     665 Sep 15 12:28 hitchreqs.txt
drwxr-xr-x 2 hitcher root    4096 Sep 13 21:32 __pycache__/
-rw-r--r-- 1 hitcher root    3590 Sep 13 16:44 README.rst
-rw-r--r-- 1 hitcher root     935 Sep 13 16:44 settings.yml
-rw-r--r-- 1 hitcher root     779 Sep 13 16:44 simple_reminder.test
hitcher@jenkins:/home/django/django-remindme/django-remindme-tests$ cd .hitch
hitcher@jenkins:/home/django/django-remindme/django-remindme-tests/.hitch$ ll
total 12
drwxrwxr-x 3 hitcher hitcher 4096 Sep 15 12:25 ./
drwxr-xr-x 4 hitcher root    4096 Sep 15 12:25 ../
drwxrwxr-x 7 hitcher hitcher 4096 Sep 15 12:27 virtualenv/

Tried also changing django-remindme-tests to have chmod 777, no change.
If I switch to root user however, it has started installing python ok, but expect it to cough when it gets to postgres...

Am now running with python 2.7.10 and 3.4.3 and the problem occurs with both.

Thanks for your help on this, really would like to get this working as I'd much prefer to invest my testing time in writing hitch tests than low level selenium tests.

@crdoconnor
Copy link
Contributor

It looks like some of your files still belong to root. Try going to your home directory and running this command:

sudo chown -R hitcher:hitcher .

You might want to delete the django-remindme directory and check it out again as well to make sure everything's clean:

git clone --recursive https://github.com/hitchtest/django-remindme.git

@crdoconnor
Copy link
Contributor

Thanks for your help on this, really would like to get this working as I'd much prefer to invest my testing time in writing hitch tests than low level selenium tests.

Thank you for using the software and reporting issues. I'm always happy to see your bug reports :)

@phoebebright
Copy link
Author

Doing a proper chown sorted the ownership, but now back to the firefox problem:

[        Err Firefox] Traceback (most recent call last):
[        Err Firefox]   File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
[        Err Firefox]     "__main__", mod_spec)
[        Err Firefox]   File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
[        Err Firefox]     exec(code, run_globals)
[        Err Firefox]   File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/hitchselenium/server.py", line 30, in <module>
[        Err Firefox]     run()
[        Err Firefox]   File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/hitchselenium/server.py", line 14, in run
[        Err Firefox]     driver = webdriver.Firefox(firefox_profile=Profile())
[        Err Firefox]   File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/selenium/webdriver/firefox/webdriver.py", line 77, in __init__
[        Err Firefox]     self.binary, timeout),
[        Err Firefox]   File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/selenium/webdriver/firefox/extension_connection.py", line 49, in __init__
[        Err Firefox]     self.binary.launch_browser(self.profile)
[        Err Firefox]   File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 68, in launch_browser
[        Err Firefox]     self._wait_until_connectable()
[        Err Firefox]   File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 98, in _wait_until_connectable
[        Err Firefox]     raise WebDriverException("The browser appears to have exited "
[        Err Firefox] selenium.common.exceptions.WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.
[     Setup Postgres] ok
[     Setup Postgres] creating collations ... 
Python 3.4.0 (default, Jun 19 2015, 14:20:21) 
Type "copyright", "credits" or "license" for more information.

IPython 4.0.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.



Exception occurred in Sign up, create reminder and wait for email reminder to arrive in python 2.7.10 (/home/django/django-remindme/django-remindme-tests/simple_reminder.test) setup.


[0]: function 'set_up'   ( self.stacktrace[0].ipython() )
  /home/django/django-remindme/django-remindme-tests/engine.py

    98 :         )
    99 : 
--> 100 :         self.services.startup(interactive=False)
    101 : 
    102 :         # Configure selenium driver



[1]: function 'startup'   ( self.stacktrace[1].ipython() )
  /home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/hitchserve/service_bundle.py

    180 :             if interactive:
    181 :                 self.start_interactive_mode()
--> 182 :             raise what_happened
    183 :         else:
    184 :             if interactive:



hitchserve.hitch_exception.ServiceSuddenStopException

Service 'Firefox' stopped suddenly.

firefox -V

 (process:3723): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
 Mozilla Firefox 40.0.3

@phoebebright
Copy link
Author

selenium==2.47.1

@phoebebright
Copy link
Author

Possible related issue: SeleniumHQ/selenium#981

@crdoconnor
Copy link
Contributor

Does the browser launch?

@crdoconnor
Copy link
Contributor

Try running the command:

.hitch/virtualenv/bin/python -m hitchselenium.server

In the django-remindme/django-remindme-tests directory.

Does it say anything?

I have the exact same version of firefox and selenium too and it works fine. Definitely not a version issue.

@phoebebright
Copy link
Author

(virtualenv)hitcher@jenkins:/home/django/django-remindme/django-remindme-tests$ .hitch/virtualenv/bin/python -m hitchselenium.server
Traceback (most recent call last):
  File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/hitchselenium/server.py", line 30, in <module>
    run()
  File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/hitchselenium/server.py", line 14, in run
    driver = webdriver.Firefox(firefox_profile=Profile())
  File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/selenium/webdriver/firefox/webdriver.py", line 77, in __init__
    self.binary, timeout),
  File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/selenium/webdriver/firefox/extension_connection.py", line 49, in __init__
    self.binary.launch_browser(self.profile)
  File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 68, in launch_browser
    self._wait_until_connectable()
  File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 98, in _wait_until_connectable
    raise WebDriverException("The browser appears to have exited "
selenium.common.exceptions.WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.

@phoebebright
Copy link
Author

How should I lauch firefox? Tried:

(virtualenv)hitcher@jenkins:/home/django/django-remindme/django-remindme-tests$ firefox

(process:9007): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Error: no display specified

(virtualenv)hitcher@jenkins:/home/django/django-remindme/django-remindme-tests$ firefox &
[1] 9227
(virtualenv)hitcher@jenkins:/home/django/django-remindme/django-remindme-tests$
(process:9227): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Error: no display specified

@crdoconnor
Copy link
Contributor

Oh, you're running it on a server you ssh'ed into?

Are you sshing in from a mac or another linux machine?

@phoebebright
Copy link
Author

yes

@phoebebright
Copy link
Author

do you want to open a skype session? might be quicker

@crdoconnor
Copy link
Contributor

In any case, you will need to:

  • ssh in again with the -X switch on to enable X11 forwarding.
  • Once you are logged in: sudo apt-get install xauth xserver-xorg xvfb dbus-x11
  • Run this command:

export DISPLAY=127.0.0.1:10.0

Then when you run firefox command on the terminal it should appear. If firefox appears then the hitch test should work.

Alternatively you can run the following command:

hitch test . --extra '{"xvfb":true}'

That should run the test but it won't display the firefox window.

If you are using a Mac you will need an X server installed. If you are using Linux it should just work.

@phoebebright
Copy link
Author

[ Err Setup Postgres] WARNING: enabling "trust" authentication for local connections
[ Err Setup Postgres] You can change this by editing pg_hba.conf or using the option -A, or
[ Err Setup Postgres] --auth-local and --auth-host, the next time you run initdb.
[              Hitch] Starting Postgres
[              Hitch] Directory: /home/django/django-remindme/django-remindme-tests/.hitch
[              Hitch] Command: /home/hitcher/.hitchpkg/postgresql-9.3.9/postgresql-9.3.9/bin/postgres -p 15432 -D /home/django/django-remindme/django-remindme-tests/.hitch/pgdata --unix_socket_directories=/home/django/django-remindme/django-remindme-tests/.hitch/pgdata --log_destination=stderr
[       Err Postgres] LOG:  database system was shut down at 2015-09-15 14:42:31 IST
[       Err Postgres] LOG:  MultiXact member wraparound protections are now enabled
[       Err Postgres] LOG:  database system is ready to accept connections
[              Hitch] Postgres Loaded.
[       Err Postgres] LOG:  autovacuum launcher started
[      Post Postgres] Creating users and databases...
[      Post Postgres] CREATE ROLE
[      Post Postgres] CREATE DATABASE
[       Setup Django] Checking Django version...
[   Err Setup Celery] Could not find platform dependent libraries <exec_prefix>
[   Err Setup Celery] Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
[   Err Setup Django] Could not find platform dependent libraries <exec_prefix>
[   Err Setup Django] Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
[   Err Setup Celery] Traceback (most recent call last):
[   Err Setup Celery]   File "<string>", line 1, in <module>
[   Err Setup Celery]   File "/home/django/django-remindme/pyv2.7.10/lib/python2.7/site-packages/celery/__init__.py", line 8, in <module>
[   Err Setup Celery]     from __future__ import absolute_import
[   Err Setup Celery] ImportError: No module named __future__
[              Hitch] Starting Celery
[              Hitch] Directory: /home/django/django-remindme
[              Hitch] Command: /home/django/django-remindme/pyv2.7.10/bin/python -u -m celery worker --app=remindme --loglevel=INFO --concurrency=2
[         Err Celery] Could not find platform dependent libraries <exec_prefix>
[         Err Celery] Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
[         Err Celery] Could not import runpy module
[   Err Setup Django] Traceback (most recent call last):
[   Err Setup Django]   File "<string>", line 1, in <module>
[   Err Setup Django]   File "/home/django/django-remindme/pyv2.7.10/lib/python2.7/site-packages/django/__init__.py", line 1, in <module>
[   Err Setup Django]     from django.utils.version import get_version
[   Err Setup Django]   File "/home/django/django-remindme/pyv2.7.10/lib/python2.7/site-packages/django/utils/version.py", line 1, in <module>
[   Err Setup Django]     from __future__ import unicode_literals
[   Err Setup Django] ImportError: No module named __future__
[              Hitch] Starting Django
[              Hitch] Directory: /home/django/django-remindme
[              Hitch] Command: /home/django/django-remindme/pyv2.7.10/bin/python -u /home/django/django-remindme/manage.py runserver 18080 --verbosity 1 --noreload --settings=remindme.settings
[         Err Django] Could not find platform dependent libraries <exec_prefix>
[         Err Django] Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
[         Err Django] Traceback (most recent call last):
[         Err Django]   File "/home/django/django-remindme/manage.py", line 8, in <module>
[         Err Django]     
[         Err Django] from django.core.management import execute_from_command_line
[         Err Django]   File "/home/django/django-remindme/pyv2.7.10/lib/python2.7/site-packages/django/__init__.py", line 1, in <module>
[         Err Django]     
[         Err Django] from django.utils.version import get_version
[         Err Django]   File "/home/django/django-remindme/pyv2.7.10/lib/python2.7/site-packages/django/utils/version.py", line 1, in <module>
[         Err Django]     
[         Err Django] from __future__ import unicode_literals
[         Err Django] ImportError
[         Err Django] : 
[         Err Django] No module named __future__

@phoebebright
Copy link
Author

[     Setup Postgres] Initializing postgresql database...
[              Hitch] Starting Firefox
[              Hitch] Directory: /home/django/django-remindme/django-remindme-tests/.hitch
[              Hitch] Command: /home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/bin/python3 -u -m hitchselenium.server
[              Hitch] Starting HitchSMTP
[              Hitch] Directory: /home/django/django-remindme/django-remindme-tests/.hitch
[              Hitch] Command: /home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/bin/python3 -u -m hitchsmtp.smtp --port 10025
[              Hitch] Starting Redis
[              Hitch] Directory: /home/django/django-remindme/django-remindme-tests/.hitch
[              Hitch] Command: /root/.hitchpkg/redis-2.8.4/redis-2.8.4/src/redis-server --port 16379
[              Redis] [13961] 15 Sep 15:21:59.345 * Max number of open files set to 10032
[              Redis]                 _._                                                  
[              Redis]            _.-``__ ''-._                                             
[              Redis]       _.-``    `.  `_.  ''-._           Redis 2.8.4 (00000000/0) 64 bit
[              Redis]   .-`` .-```.  ```\/    _.,_ ''-._                                   
[              Redis]  (    '      ,       .-`  | `,    )     Running in stand alone mode
[              Redis]  |`-._`-...-` __...-.``-._|'` _.-'|     Port: 16379
[              Redis]  |    `-._   `._    /     _.-'    |     PID: 13961
[              Redis]   `-._    `-._  `-./  _.-'    _.-'                                   
[              Redis]  |`-._`-._    `-.__.-'    _.-'_.-'|                                  
[              Redis]  |    `-._`-._        _.-'_.-'    |           http://redis.io        
[              Redis]   `-._    `-._`-.__.-'_.-'    _.-'                                   
[              Redis]  |`-._`-._    `-.__.-'    _.-'_.-'|                                  
[              Redis]  |    `-._`-._        _.-'_.-'    |                                  
[              Redis]   `-._    `-._`-.__.-'_.-'    _.-'                                   
[              Redis]       `-._    `-.__.-'    _.-'                                       
[              Redis]           `-._        _.-'                                           
[              Redis]               `-.__.-'                                               
[              Redis] [13961] 15 Sep 15:21:59.357 # Server started, Redis version 2.8.4
[              Redis] [13961] 15 Sep 15:21:59.357 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
[              Redis] [13961] 15 Sep 15:21:59.357 * The server is now ready to accept connections on port 16379
[              Hitch] Redis Loaded.
[ Err Setup Postgres] initdb: cannot be run as root
[ Err Setup Postgres] Please log in (using, e.g., "su") as the (unprivileged) user that will
[ Err Setup Postgres] own the server process.
[              Hitch] Starting Postgres
[              Hitch] Directory: /home/django/django-remindme/django-remindme-tests/.hitch
[              Hitch] Command: /root/.hitchpkg/postgresql-9.3.9/postgresql-9.3.9/bin/postgres -p 15432 -D /home/django/django-remindme/django-remindme-tests/.hitch/pgdata --unix_socket_directories=/home/django/django-remindme/django-remindme-tests/.hitch/pgdata --log_destination=stderr
Python 3.4.0 (default, Jun 19 2015, 14:20:21) 
Type "copyright", "credits" or "license" for more information.

IPython 4.0.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.



Exception occurred in Sign up, create reminder and wait for email reminder to arrive in python 2.7.10 (/home/django/django-remindme/django-remindme-tests/simple_reminder.test) setup.


[0]: function 'set_up'   ( self.stacktrace[0].ipython() )
  /home/django/django-remindme/django-remindme-tests/engine.py

    95 :         )
    96 : 
--> 97 :         self.services.startup(interactive=False)
    98 : 
    99 :         # Configure selenium driver



[1]: function 'startup'   ( self.stacktrace[1].ipython() )
  /home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/hitchserve/service_bundle.py

    176 :             if interactive:
    177 :                 self.start_interactive_mode()
--> 178 :             six.reraise(*what_happened)
    179 :         elif isinstance(what_happened, Exception):
    180 :             if interactive:



[2]: function 'reraise'   ( self.stacktrace[2].ipython() )
  /home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/six.py

    656 :             value = tp()
    657 :         if value.__traceback__ is not tb:
--> 658 :             raise value.with_traceback(tb)
    659 :         raise value
    660 : 



[3]: function 'run_setup'   ( self.stacktrace[3].ipython() )
  /home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/hitchserve/service_handle.py

    42 :                 sys.stdout = open(self.bundle_engine.service_bundle.hitch_dir.setup_out(self.service.name), "ab", 0)
    43 :                 sys.stderr = open(self.bundle_engine.service_bundle.hitch_dir.setup_err(self.service.name), "ab", 0)
--> 44 :                 self.service.setup()
    45 :             except Exception as e:
    46 :                 pickling_support.install()



[4]: function 'setup'   ( self.stacktrace[4].ipython() )
  /home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/hitchpostgres/postgres_service.py

    91 :         shutil.rmtree(self.pgdata, ignore_errors=True)
    92 :         # TODO : Put back encoding + locale
--> 93 :         self.subcommand(self.postgres_package.initdb, self.pgdata).run()
    94 : 
    95 :     def poststart(self):



[5]: function 'run'   ( self.stacktrace[5].ipython() )
  /home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/hitchserve/hitch_service.py

    76 :             else:
    77 :                 kwargs['stdout'] = sys.stdout
--> 78 :                 return subprocess.check_call(self.command, **kwargs)
    79 :         except subprocess.CalledProcessError:
    80 :             if ignore_errors:



[6]: function 'check_call'   ( self.stacktrace[6].ipython() )
  /usr/lib/python3.4/subprocess.py

    555 :         if cmd is None:
    556 :             cmd = popenargs[0]
--> 557 :         raise CalledProcessError(retcode, cmd)
    558 :     return 0
    559 : 



subprocess.CalledProcessError

Command '['/root/.hitchpkg/postgresql-9.3.9/postgresql-9.3.9/bin/initdb', '/home/django/django-remindme/django-remindme-tests/.hitch/pgdata']' returned non-zero exit status 1

In [1]: exit

[            WARNING] Firefox stopped prematurely.
[              Hitch] Stopping HitchSMTP
[            WARNING] Postgres stopped prematurely.
[            WARNING] Cron stopped prematurely.
[            WARNING] Celery stopped prematurely.
[            WARNING] Django stopped prematurely.
[              Hitch] Stopping Redis
[              Hitch] Firefox Stopped
[              Hitch] Postgres Stopped
[              Hitch] Celery Stopped
[              Hitch] Redis Stopped
[              Hitch] HitchSMTP Stopped
[              Hitch] Django Stopped
[              Hitch] Cron Stopped
[              Hitch] Shutdown successful in 0.1 seconds

@phoebebright
Copy link
Author

ndme/django-remindme-tests/.hitch/pgdata -l logfile start
[ Err Setup Postgres] WARNING: enabling "trust" authentication for local connections
[ Err Setup Postgres] You can change this by editing pg_hba.conf or using the option -A, or
[ Err Setup Postgres] --auth-local and --auth-host, the next time you run initdb.
[              Hitch] Starting Postgres
[              Hitch] Directory: /home/django/django-remindme/django-remindme-tests/.hitch
[              Hitch] Command: /home/hitcher/.hitchpkg/postgresql-9.3.9/postgresql-9.3.9/bin/postgres -p 15432 -D /home/django/django-remindme/django-remindme-tests/.hitch/pgdata --unix_socket_directories=/home/django/django-remindme/django-remindme-tests/.hitch/pgdata --log_destination=stderr
[       Err Postgres] LOG:  database system was shut down at 2015-09-15 16:07:24 IST
[       Err Postgres] LOG:  MultiXact member wraparound protections are now enabled
[       Err Postgres] LOG:  database system is ready to accept connections
[              Hitch] Postgres Loaded.
[       Err Postgres] LOG:  autovacuum launcher started
[      Post Postgres] Creating users and databases...
[      Post Postgres] CREATE ROLE
[      Post Postgres] CREATE DATABASE
[       Setup Django] Checking Django version...
[       Setup Django] Running migrations...
[              Hitch] Starting Celery
[              Hitch] Directory: /home/django/django-remindme
[              Hitch] Command: /home/django/django-remindme/pyv2.7.10/bin/python -u -m celery worker --app=remindme --loglevel=INFO --concurrency=2
[         Err Celery] /home/django/django-remindme/pyv2.7.10/lib/python2.7/site-packages/celery/apps/worker.py:161: CDeprecationWarning: 
[         Err Celery] Starting from version 3.2 Celery will refuse to accept pickle by default.
[         Err Celery] The pickle serializer is a security concern as it may give attackers
[         Err Celery] the ability to execute any command.  It's important to secure
[         Err Celery] your broker from unauthorized access when using pickle, so we think
[         Err Celery] that enabling pickle should require a deliberate action and not be
[         Err Celery] the default choice.
[         Err Celery] If you depend on pickle then you should set a setting to disable this
[         Err Celery] warning and to be sure that everything will continue working
[         Err Celery] when you upgrade to Celery 3.2::
[         Err Celery]     CELERY_ACCEPT_CONTENT = ['pickle', 'json', 'msgpack', 'yaml']
[         Err Celery] You must only enable the serializers that you will actually use.
[         Err Celery]   warnings.warn(CDeprecationWarning(W_PICKLE_DEPRECATED))
[         Err Celery] [2015-09-15 15:07:41,355: WARNING/MainProcess] /home/django/django-remindme/pyv2.7.10/lib/python2.7/site-packages/celery/apps/worker.py:161: CDeprecationWarning: 
[         Err Celery] Starting from version 3.2 Celery will refuse to accept pickle by default.
[         Err Celery] The pickle serializer is a security concern as it may give attackers
[         Err Celery] the ability to execute any command.  It's important to secure
[         Err Celery] your broker from unauthorized access when using pickle, so we think
[         Err Celery] that enabling pickle should require a deliberate action and not be
[         Err Celery] the default choice.
[         Err Celery] If you depend on pickle then you should set a setting to disable this
[         Err Celery] warning and to be sure that everything will continue working
[         Err Celery] when you upgrade to Celery 3.2::
[         Err Celery]     CELERY_ACCEPT_CONTENT = ['pickle', 'json', 'msgpack', 'yaml']
[         Err Celery] You must only enable the serializers that you will actually use.
[         Err Celery]   warnings.warn(CDeprecationWarning(W_PICKLE_DEPRECATED))
[             Celery]  
[             Celery]  -------------- celery@jenkins v3.1.17 (Cipater)
[             Celery] ---- **** ----- 
[             Celery] --- * ***  * -- Linux-3.13.0-042stab108.2-x86_64-with-debian-jessie-sid
[             Celery] -- * - **** --- 
[             Celery] - ** ---------- [config]
[             Celery] - ** ---------- .> app:         remindme:0x7f865e79f850
[             Celery] - ** ---------- .> transport:   redis://localhost:16379/1
[             Celery] - ** ---------- .> results:     disabled
[             Celery] - *** --- * --- .> concurrency: 2 (prefork)
[             Celery] -- ******* ---- 
[             Celery] --- ***** ----- [queues]
[             Celery]  -------------- .> celery           exchange=celery(direct) key=celery
[             Celery]                 
[             Celery] [tasks]
[             Celery]   . remindme.celery.send_reminders
[         Err Celery] [2015-09-15 15:07:41,397: INFO/MainProcess] Connected to redis://localhost:16379/1
[              Hitch] Celery Loaded.
[         Err Celery] [2015-09-15 15:07:41,415: INFO/MainProcess] mingle: searching for neighbors
[         Err Celery] [2015-09-15 15:07:42,421: INFO/MainProcess] mingle: all alone
[         Err Celery] /home/django/django-remindme/pyv2.7.10/lib/python2.7/site-packages/celery/fixups/django.py:254: UserWarning: Using settings.DEBUG leads to a memory leak, never use this setting in production environments!
[         Err Celery]   warnings.warn('Using settings.DEBUG leads to a memory leak, never '
[         Err Celery] [2015-09-15 15:07:42,432: WARNING/MainProcess] /home/django/django-remindme/pyv2.7.10/lib/python2.7/site-packages/celery/fixups/django.py:254: UserWarning: Using settings.DEBUG leads to a memory leak, never use this setting in production environments!
[         Err Celery]   warnings.warn('Using settings.DEBUG leads to a memory leak, never '
[         Err Celery] [2015-09-15 15:07:42,433: WARNING/MainProcess] celery@jenkins ready.
[        Err Firefox] Traceback (most recent call last):
[        Err Firefox]   File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
[        Err Firefox]     "__main__", mod_spec)
[        Err Firefox]   File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
[        Err Firefox]     exec(code, run_globals)
[        Err Firefox]   File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/hitchselenium/server.py", line 30, in <module>
[        Err Firefox]     run()
[        Err Firefox]   File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/hitchselenium/server.py", line 14, in run
[        Err Firefox]     driver = webdriver.Firefox(firefox_profile=Profile())
[        Err Firefox]   File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/selenium/webdriver/firefox/webdriver.py", line 77, in __init__
[        Err Firefox]     self.binary, timeout),
[        Err Firefox]   File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/selenium/webdriver/firefox/extension_connection.py", line 49, in __init__
[        Err Firefox]     self.binary.launch_browser(self.profile)
[        Err Firefox]   File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 68, in launch_browser
[        Err Firefox]     self._wait_until_connectable()
[        Err Firefox]   File "/home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 98, in _wait_until_connectable
[        Err Firefox]     raise WebDriverException("The browser appears to have exited "
[        Err Firefox] selenium.common.exceptions.WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.
Python 3.4.0 (default, Jun 19 2015, 14:20:21) 
Type "copyright", "credits" or "license" for more information.

IPython 4.0.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.



Exception occurred in Sign up, create reminder and wait for email reminder to arrive in python 2.7.10 (/home/django/django-remindme/django-remindme-tests/simple_reminder.test) setup.


[0]: function 'set_up'   ( self.stacktrace[0].ipython() )
  /home/django/django-remindme/django-remindme-tests/engine.py

    95 :         )
    96 : 
--> 97 :         self.services.startup(interactive=False)
    98 : 
    99 :         # Configure selenium driver



[1]: function 'startup'   ( self.stacktrace[1].ipython() )
  /home/django/django-remindme/django-remindme-tests/.hitch/virtualenv/lib/python3.4/site-packages/hitchserve/service_bundle.py

    180 :             if interactive:
    181 :                 self.start_interactive_mode()
--> 182 :             raise what_happened
    183 :         else:
    184 :             if interactive:



hitchserve.hitch_exception.ServiceSuddenStopException

Service 'Firefox' stopped suddenly.

In [1]: exit

[              Hitch] Stopping Redis
[            WARNING] Firefox stopped prematurely.
[              Hitch] Stopping HitchSMTP
[              Hitch] Stopping Django
[              Hitch] Stopping Cron
[              Hitch] Stopping Celery
[              Hitch] Stopping Postgres
[              Hitch] Redis Stopped
[              Hitch] HitchSMTP Stopped
[              Hitch] Cron Stopped
[              Hitch] Postgres Stopped
[              Hitch] Firefox Stopped
[              Hitch] Django Stopped
[              Hitch] Celery Stopped

@phoebebright
Copy link
Author

In summary, there were three main problems with my setup:

  1. I had logged in as root and done the intial installation as root, then switched to a newly created hitchuser so there were permission errors. Once I uninstalled and installed and ran as hitchuser the permission problems went away.
  2. If logging into the server via ssh, need to use the -X flag to allow firefox to run.
  3. Issues with node-less and lessc. See this email: "util.puts: Use console.log instead" issue less/less.js#1529

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

2 participants