LUA + PYTHON PLUGINS: panic: runtime error: invalid memory address or nil pointer dereference

The custom_middleware_bundle should contain the .zip at the end, we use this internally to identify the file format as we may support other formats (in the future).

The .zip extension was the problem but it was actually because s3 needed it. Without it s3 returns a 403 not authorized error as it does not match the file name in the bucket.

Used tcpdump to view the outgoing http requests and noticed what was wrong. :rolling_eyes:

Good to know that the gateway also need the extension. May be worth updating the docs so the example has the extension as I actually left it off because of the example.

https://tyk.io/docs/customise-tyk/plugins/rich-plugins/python/tutorial-add-demo-plugin-api/

Now on to my next error :laughing:

level=error msg="Couldn't create bundle directory: mkdir middleware/bundles/API_ID-authorization.zip: no such file or directory

Hopefully this will be an easier one for me to sort.

Thanks Matías!

Looks like it is assumed the bundle directory exists within the middleware directory.

https://github.com/TykTechnologies/tyk/blob/master/coprocess_bundle.go#L27

Can’t see anything anything that actually creates the directory if it does not exist. The bundle directory does not exist in the docker image. And I guess it will also cause problems when I actually mount a volume instead of using ephemeral storage.

Right, you need to create this directory. Users who use it with Docker add a volume for this.

Volume added. :thumbsup: Will keep an eye out for the patch that allows HTTPS in the future. :slight_smile:

1 Like