Hello,
I’ve got tyk gateway + dashboard installed on red hat.
Installation was done using: https://tyk.io/tyk-documentation/get-started/with-tyk-on-premise/installation/redhat-rhel-centos/
Then based on the documentation I tried to create some ‘hello world’ plugin using python.
I’ve got the following setting in the tyk.conf
“coprocess_options”: {
“enable_coprocess”: true
},
“enable_bundle_downloader”: true,
“bundle_base_url”: “http://<server_IP>:8080/test/”,
additionally in the api configuration I’ve got:
“custom_middleware_bundle”:“bundle.zip” which is created using tyk-cli.
Inside the bundle I’ve got the followiing
manifest.json
{
“file_list”: [
“mymiddleware.py”
],
“custom_middleware”: {
“pre”: [
{
“name”: “MyPreMiddleware”
}
],
“post”: [
],
“driver”: “python”
},
“checksum”: “”,
“signature”: “”
}
and
mymiddleware.py:
from tyk.decorators import *
from gateway import TykGateway as tyk
@Hook
def MyPreMiddleware(request, session, spec):
request.add_header(‘myheader’, ‘myvalue’)
return request, session
After restarting/reloading tyk-gateway with these setting I got the following error:
time=“Feb 17 11:14:29” level=error msg=“Couldn’t create bundle directory: mkdir middleware/bundles/b333cfebefbe4107578952cae4b72f78-bundle.zip: no such file or directory” api_id=b333cfebefbe4107578952cae4b72f78 org_id= path=- server_name=“http://<IP/blablabla>” user_id=- user_ip=-
I’ve found the solution: The problem was that in /opt/tyk-gateway/middleware there was no bundles directory
WHY?
Anyway, after the directory was created, the tyk downloaded the bundle and stored it in the right path.
BUT
Now I’m getting the following for both python/lua cases:
time=“Feb 17 14:29:22” level=error msg=“CP Driver not supported: python”
time=“Feb 17 14:52:09” level=error msg=“CP Driver not supported: lua”
WHY?
Did I miss some configuration steps?
Regards.