mozilla-services / syncserver

Run-Your-Own Firefox Sync Server
Mozilla Public License 2.0
1.87k stars 145 forks source link

Can't use it on Ubuntu 16.04 with Python 3.5 / Apache #97

Open AdamPerkins opened 7 years ago

AdamPerkins commented 7 years ago

It works as standalone mode with gunicorn.

But when I try to use it behind Apache with the syncserver.wsgi script I have errors. It seems the errors are coming because the script isn't supporting the actual Python 3.5

What can I do ?

  DocumentRoot /media/data/www/syncserver
  WSGIProcessGroup sync
  WSGIDaemonProcess sync user=ffsync group=ffsync processes=2 threads=25 python-path=/opt/syncserver/local/lib/python2.7/site-packages/
  WSGIPassAuthorization On
  WSGIScriptAlias / /opt/syncserver/syncserver.wsgi
  CustomLog /media/data/www/syncserver/log/access.log combined
  ErrorLog  /media/data/www/syncserver/log/error.log
[Sun Sep 17 20:05:04 2017] [wsgi:error] [pid 6053] [client 192.168.0.31:4717] mod_wsgi (pid=6053): Target WSGI script '/opt/syncserver/syncserver.wsgi' cannot be loaded as Python module.
[Sun Sep 17 20:05:04 2017] [wsgi:error] [pid 6053] [client 192.168.0.31:4717] mod_wsgi (pid=6053): Exception occurred processing WSGI script '/opt/syncserver/syncserver.wsgi'.
[Sun Sep 17 20:05:04 2017] [wsgi:error] [pid 6053] [client 192.168.0.31:4717] Traceback (most recent call last):
[Sun Sep 17 20:05:04 2017] [wsgi:error] [pid 6053] [client 192.168.0.31:4717]   File "/opt/syncserver/syncserver.wsgi", line 9, in <module>
[Sun Sep 17 20:05:04 2017] [wsgi:error] [pid 6053] [client 192.168.0.31:4717]     from ConfigParser import NoSectionError
[Sun Sep 17 20:05:04 2017] [wsgi:error] [pid 6053] [client 192.168.0.31:4717] ImportError: No module named 'ConfigParser'
rfk commented 7 years ago

Unfortunately I don't think we're likely to prioritize a port of this codebase to python3 just from a sheer "we have too much work and not enough people" standpoint, but if you're interested in attempting to port it across yourself I'd be happy to offer some pointers.

AdamPerkins commented 7 years ago

Unfortunately I never have done anything in Python. I also don't know if the whole application would need a rewrite or just the interface part of the wsgi interface (the Apache module is using 3.5.x, syncserver is providing a python lib with 2.7).

return42 commented 7 years ago

FWIW: I started a Py3 movement https://github.com/return42/moz-cloud but i stopped 7 month ago, because it seems to me, that there is no interest in such a work .. may bee I'am wrong and it make sense to revive this task? However, to do so, I need some support by the maintainers.

rfk commented 7 years ago

However, to do so, I need some support by the maintainers.

Hi @return42, thanks for the reminder, I do recall that project and taking a brief look in the past, but not having the bandwidth to follow it up. What sort of support would you need from me in order to pick it back up again?

return42 commented 7 years ago

What sort of support would you need from me in order to pick it back up again?

Hi @rfk .. not you personally. The Mozilla cloud services is a collection services spread around in various repositories. To name a few: hawkauthlib, konfig, mozservices, tokenlib, tokenserver ... most of them are not hard and already ported in my project. Before I start to port the syncserver and server-syncstorage I like to see this work upstream. IMO it should not be hard to bring this work upstream, it depends on how the maintainers work with. But ATM I haven't got any compliance.

I think there are really things we need to discuss, e.g. I added some boilerplate code to the repos with a uniform build/deploy/test/debug environment, which builds and runs tests in isolated Py2 and Py3 virtualenv. I don't know if the maintainers are fine with such a boilerplate.

Something which must also be discussed is M2Crypto which is needed by PyBrowserID. I helped to port M2Crypto to Py3 and by doing this I realized, that M2Crypto should be replaced by https://cryptography.io

So what I mean is, we really need some discussion about "how". I have no connections to members of the mozilla team, maybe you can stimulate something?

rfk commented 7 years ago

Hi @rfk .. not you personally.

Well, thing is that most of those libs are not really under active development any more, so unfortunately I'm about the closest thing we have to "the maintainers" on Mozilla staff these days :-(

Can you link me to a PR for one of your previous ports and I'll take a fresh look?

I added some boilerplate code to the repos with a uniform build/deploy/test/debug environment, which builds and runs tests in isolated Py2 and Py3 virtualenv. I don't know if the maintainers are fine with such a boilerplate.

FWIW I'm fine with such boilerplate in principle, especially if it's close to how we currently use makefiles in some of the larger projects like https://github.com/mozilla/tokenserver

return42 commented 7 years ago

I'm about the closest thing we have to "the maintainers" on Mozilla staff these days

Too many cooks spoil the broth ;) .. I haven't sent a PR so far, just some issues to inform the maintainers. Now I understand why I got no feedback.

You can take a look at my 'status-page' https://github.com/return42/moz-cloud#status repositories with a 'passed Py27 & Py35 tests' are ready for a PR.

IMO we should start from bottom to top. I mean first lets start with the very simple 'konfig' (https://github.com/mozilla-services/konfig/network). What do you think, should we take after?

if it's close to how we currently use to how we currently use makefiles

It is ;) https://github.com/return42/tokenserver/blob/six/Makefile

Thanks!

rfk commented 7 years ago

IMO we should start from bottom to top

That sounds right to me; in fact the order you have them listed at [1] is probably as good as any :-)

[1] https://github.com/return42/moz-cloud#status

return42 commented 7 years ago

Hi @rfk, I started a PR (test shot) with hawkauthlib https://github.com/mozilla-services/hawkauthlib/pull/2 if I see some progress I will send more PRs / Thanks!

rfk commented 7 years ago

Thanks! I had this in my inbox from the PR notification, but your reminder here is welcome and appreciated. :-)

snIP3r23 commented 6 years ago

i do have the same error on a gentoo machine: ModuleNotFoundError: No module named 'ConfigParser' but i found out that doing a fresh install i get no ConfigParser package in my python search path /opt/syncserver/local/lib/python2.7/site-packages but there is a configparser package. changing the syncserver.wsgi from ConfigParser to configparser results in an error. in requirements.txt there is also a line for new configparser package configparser==3.5 am i missing something or is this correct?