Auto check plugin is failed

Hi there!

I made the plugin GitHub - negasus/traefik-plugin-ip2location: traefik-plugin-ip2location

but Traefik Bot cannot run it with error

failed to run with Yaegi: plugin: failed to create a new plugin instance: error open database file, open IP2LOCATION-LITE-DB1.IPV6.BIN: no such file or directory

External database file is needed for this plugin. And i place it to the repository. How can I fix this error?

PS: Maybe add plugin tag?

Hello,

Have you try to run the plugin in Traefik with the dev mode?

# static configuration
# ...

experimental:
  pilot:
    token: xxxxxxx

  devPlugin:
    goPath: /your/go/path/
    moduleName: github.com/negasus/traefik-plugin-ip2location

# dynamic configuration
http:
  routers:
    my-router:
      rule: hostregexp(`{host:.+}`)
      service: service-foo
      entryPoints:
        - web
      middlewares:
        - my-plugin

  services:
    service-foo:
      loadBalancer:
        servers:
          - url: http://127.0.0.1:5000

  middlewares:
    my-plugin:
      plugin:
        dev:
          fromHeader: 'X-Custom-IP'
          filename: 'IP2LOCATION-LITE-DB1.IPV6.BIN'
          headers:
            CountryShort: X-GEO-CountryShort
            CountryLong: X-GEO-CountryLong
            Region: X-GEO-Region
            City: X-GEO-City
            Isp: X-GEO-Isp
            Latitude: X-GEO-Latitude
            Longitude: X-GEO-Longitude
            Domain: X-GEO-Domain
            Zipcode: X-GEO-Zipcode
            Timezone: X-GEO-Timezone
            Netspeed: X-GEO-Netspeed
            Iddcode: X-GEO-Iddcode
            Areacode: X-GEO-Areacode
            Weatherstationcode: X-GEO-Weatherstationcode
            Weatherstationname: X-GEO-Weatherstationname
            Mcc: X-GEO-Mcc
            Mnc: X-GEO-Mnc
            Mobilebrand: X-GEO-Mobilebrand
            Elevation: X-GEO-Elevation
            Usagetype: X-GEO-Usagetype
1 Like

Locally the plugin works fine

PS: I set absolute path for the database file

Have you try with your test data configuration?

INFO[2020-07-20T10:11:56+02:00] Starting provider *traefik.Provider {}       
ERRO[2020-07-20T10:11:57+02:00] error open database file, open IP2LOCATION-LITE-DB1.IPV6.BIN: no such file or directory  routerName=my-router@file entryPointName=web
ERRO[2020-07-20T10:11:57+02:00] error open database file, open IP2LOCATION-LITE-DB1.IPV6.BIN: no such file or directory  routerName=my-router@file entryPointName=web

I don't know how to specify the path for the file. I can't specify an absolute path, like /Users/negasus/plugin/database.bin

The plugin user must specify the path to the file he needs

the main problem is the path to the file, for now I made some improvements on the plugin validation to skip this.

Could you try to close the issue: https://github.com/negasus/traefik-plugin-ip2location/issues/1

I closed it. Should i receive email about succesfull plugin check?

no but you will see your plugin here: https://pilot.traefik.io/plugins

We check the plugins every 30min: https://github.com/containous/plugindemo#traefik-pilot

But I modified to 10min temporary.

I still not received email (if fails) and not see my plugin in common list.
Issue closing is works for new check?

the check fail for the same thing, I will fix that.

Yes, i got email right now

you can close the new issue https://github.com/negasus/traefik-plugin-ip2location/issues/2

done (some text for 20 symbols limit :slight_smile: )

Success: https://pilot.traefik.io/plugins/271558701445284371/ip2location-plugin

Great! Thanks) I has new achievement)

1 Like

Hi, I was inspired by negasus/traefik-plugin-ip2location, and made a plugin https://github.com/jiangwennn/traefik-plugin-ip2location-redirect

Now I got the same issue here, could you please help me with this :sweat_smile:

Thanks a lot !