So I reinstalled tyk-gateway and redis again but this time after calling
apt-get remove, I also called
apt-get purge and
rm -rf /opt/tyk-gateway/.
Now I get the templates and JS files when installing tyk-gateway. Don't know what happened but it seems okay now.
My JS middleware now works too.
It leaves us with Pyhton. When I started back I still had the error "No module named 'dispatcher'" but I added
"python_path_prefix": "/opt/tyk-gateway/" to my tyk.conf and now the error changed. Here is the stack trace :
[Oct 26 19:17:16] INFO python: Setting PYTHONPATH to '/opt/tyk-gateway/coprocess/python:/opt/tyk-gateway/middleware/python:/opt/tyk-gateway/event_handlers:/opt/tyk-gateway/coprocess/python/proto'
[Oct 26 19:17:16] INFO python: Initializing interpreter, Py_Initialize()
Traceback (most recent call last):
File "/opt/tyk-gateway/coprocess/python/dispatcher.py", line 7, in <module>
from tyk.object import TykCoProcessObject
File "/opt/tyk-gateway/coprocess/python/tyk/object.py", line 3, in <module>
from tyk.session import TykSession
File "/opt/tyk-gateway/coprocess/python/tyk/session.py", line 1, in <module>
import coprocess_session_state_pb2 as session_state_pb
File "/opt/tyk-gateway/coprocess/python/proto/coprocess_session_state_pb2.py", line 6, in <module>
from google.protobuf import descriptor as _descriptor
ImportError: No module named 'google'
[Oct 26 19:17:16] ERROR coprocess: Can't initialize a dispatcher
From the file
/opt/tyk-gateway/coprocess/python/proto/coprocess_session_state_pb2.py it looks like an issue with protobuf. I tried uninstalling it and restarting the process to build it from https://tyk.io/docs/customise-tyk/plugins/rich-plugins/python/ but I still get the issue.
Any idea of what's going on ? During the building & install it told me that protobuf was installed in
Installed /usr/local/lib/python3.5/dist-packages/protobuf-3.1.0-py3.5-linux-x86_64.egg. Could it be because Tyk uses Python3.4 ?