How to import plugin that uses unsafe package

I've created a plugin that depends on a library that is using unsafe library.
On CI / CD I call yaegi with -unsafe flag and all my tests are passing.

But Pilot had created an error my repo mentioning the problem with unsafe
Here's the link to the issue created by Pilot

How could I tell Pilot to enable -unsafe flag ?

Hello @ievgenii-shepeliuk,

Currently Traefik, and by extension Pilot does not allow the unsafe library to be used for security and stability reasons (the library is called unsafe for a reason).

If you want to use unsafe in plugins, you will have to build your own version of Traefik that enables its use in the Yaegi Interpreter, and bypass Pilot by using private plugins in Traefik v2.5 (Which is currently in RC, not stable)

Hello @daniel.tomcej

I've been able to workaround the issue by patching vendored code and removing unsafe usage.

But currently I have another problem

My plugin uses a file with data inside for initialization, and Pilot says that file is not found, although file exists in git repo and path is correct.

I've checked the similar plugin that contains file inside, but I can't see any difference from my one.

Could you help on this ?

Also I've found a thread about that another plugin

And from that thread I see that some manual actions were made by Pilot team to accept that plugin.

Hello @ievgenii-shepeliuk,

right now your plugin fails validation because it will not start without the database file:

The validation platform does not load the database file, and therefore the test fails.

Could you just update the code to allow the plugin to run without the external file? Another option would be to link to a URL and load the file dynamically.

Hello @daniel.tomcej

This plugin behaves the same way, but it is accepted by Pilot

And the reason is some workaround from Pilot team by @ldez ,
that is described in the thread I've mentioned in one previous post.

I realize that I could implement proposed workaround, but why should I do it, if there's another plugin that works like that and it is already accepted by Pilot.

I created a hard-coded exception but I would prefer not to have to add another one.

Could you follow the recommendation made by @daniel.tomcej ?

Yes, sure. I have no other options.
Thanks for the explanation.

@ldez @daniel.tomcej The pllugin finally appeared at Pilot site

But now I receive

2021/07/16 18:08:42 traefik.go:76: command traefik error: failed to download plugin github.com/GiGInnovationLabs/traefikgeoip2: failed to call service: Get "https://plugin.pilot.traefik.io/public/download/github.com/GiGInnovationLabs/traefikgeoip2/v0.0.7": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

I was trying to install it in local k8s cluster, same happens when I try to click this link from browser.

Is it some temporary issue ?

Hello @ldez @daniel.tomcej

Since Friday - the same issue still persists.
Although the plugin is published on Pilot site - it can not be downloaded.
I receive two types of errors

  1. Timeout: Client.Timeout exceeded while awaiting headers
  2. 503: Service unavailable

It seems as not temporary issue, but rather a bug with this particular plugin.
Could you please help ?

Can you try it again?

Now it works, thanks.

May you reveal what is the issue ?
Does it happen after releasing every new plugin version ?

I am asking since it's sort of critical for production. Currently, I'm testing in local K8S cluster, but in case I will start deploying to prod and the same error will happen again - the prod will be down

So, I need to understand better the reason of the issue and how to avoid it when updating a plugin.

It was just a memory adjustment of our platform.
We improved the detection for this issue, the problem is under control now.

Thank you for the explanation

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.