TykTechnologies / custom-plugin-examples

Custom plugin examples for the Tyk Gateway - if you ever needed to extend the functionality!
https://tyk.io
36 stars 5 forks source link

502 Bad Gateway #6

Open can-lang opened 3 years ago

can-lang commented 3 years ago

Hi,

I try to use an example custom-plugin on tyk-cloud. But I got error 502 Bad Gateway.

Produce Steps:

  1. Created AWS IAM user then enable plugins like https://tyk.io/docs/tyk-cloud/configuration-options/using-plugins/setup-control-plane/
  2. Created manifest.json and middleware.py like https://tyk.io/docs/tyk-cloud/configuration-options/using-plugins/python-code-bundle/
  3. Created bundle.zip with docker:
    docker run \
    --rm \
    -v $(pwd):/cloudplugin \
    --entrypoint "/bin/sh" -it \
    -w "/cloudplugin" \
    tykio/tyk-gateway:v3.1.2 \
    -c '/opt/tyk-gateway/tyk bundle build -y'
  4. Downloaded mservctl for mac
  5. Created python-demo.mservctl.yaml file with endpoint and token that coming from dashboard.
  6. Push bundle.zip to s3: ./mservctl.macos.amd64 --config ~/my-tyk-plugin/python-demo.mservctl.yaml push ~/my-tyk-plugin/bundle.zip
  7. Checked s3 and seen bundle.zip file
  8. Created new api with bundle-id and Custom-Authorization like https://tyk.io/docs/tyk-cloud/configuration-options/using-plugins/api-test/
  9. Tested but gotten 502 Bad Gateway as response. Tested with and without Authorization header but result is same.

Any suggestion?