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?
ldez
July 20, 2020, 7:48am
2
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
ldez
July 20, 2020, 8:11am
4
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
ldez
July 20, 2020, 8:57am
7
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?
ldez
July 20, 2020, 9:17am
9
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?
ldez
July 20, 2020, 9:20am
11
the check fail for the same thing, I will fix that.
Yes, i got email right now
ldez
July 20, 2020, 9:26am
13
done (some text for 20 symbols limit )
ldez
July 20, 2020, 9:30am
15
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
Thanks a lot !