Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when testing telegraf config on Windows: driver "sqlite" not supported #11259

Closed
kuzyn opened this issue Jun 6, 2022 · 5 comments · Fixed by #11260
Closed

Error when testing telegraf config on Windows: driver "sqlite" not supported #11259

kuzyn opened this issue Jun 6, 2022 · 5 comments · Fixed by #11260
Labels
bug unexpected problem or unintended behavior platform/windows

Comments

@kuzyn
Copy link

kuzyn commented Jun 6, 2022

Relevant telegraf.conf

[[inputs.sql]]
  interval = "5m"
  driver = "sqlite"
  dsn = "C:/PATH/TO/DB"

  [[inputs.sql.query]]
    query="SELECT * FROM tableName ORDER BY day DESC LIMIT 1"

Logs from Telegraf

[telegraf] Error running agent: could not initialize input inputs.sql: driver "sqlite" not supported use one of [clickhouse cockroach maria mssql mysql pgx postgres snowflake sqlserver tidb]

System info

Telegraf 1.22.4; Windows 10 Pro

Docker

No response

Steps to reproduce

  1. Configure conf to point to sqlite database
  2. Run telegraf with the --test and --debug switches
  3. It gives the error above
    ...

Expected behavior

Works and show a test example of the sql metrics

Actual behavior

Gives the error aboves

Additional info

This config works on Linux (with updated dsn path). The database can be loaded via the sqlite3.exe util, so I know it's not corrupt... Is there a limitation with telegraf, sqlite and Windows 10?

@kuzyn kuzyn added the bug unexpected problem or unintended behavior label Jun 6, 2022
powersj added a commit to powersj/telegraf that referenced this issue Jun 6, 2022
Enable windows support with the sqlite driver library.

fixes: influxdata#11259
@powersj
Copy link
Contributor

powersj commented Jun 6, 2022

It is/was a limitation of the sqlite library itself that Telegraf users. Telegraf imports modernc.org/sqlite as a driver for sqlite.

If you look at our import file, it is only enabled for linux, freebsd, and darwin. Looking at the sqlite driver's project, it was not until last November that Windows support was fully enabled:

2021-11-13 v1.14.0:
Support windows/amd64. This target had previously only experimental status because of a now resolved memory leak.

I have created #11260 which updates the library and adds the windows build flags. Once artifacts are built, can you please try testing those?

Thanks!

@powersj powersj added the waiting for response waiting for response from contributor label Jun 6, 2022
@kuzyn
Copy link
Author

kuzyn commented Jun 6, 2022

Hi Joshua, thanks for triggering that quick build! Same error on telegraf-1.23.0~acea120f_windows_amd64.zip

Going from the structure in inputs/plugins/sql and the drivers_sqlite.go and drivers.go files... is it possible that it's not getting pulled into the available driver list in the same way as other drivers?

https://github.com/powersj/telegraf/blob/fix/11259/plugins/inputs/sql/sql.go#L329

@telegraf-tiger telegraf-tiger bot removed the waiting for response waiting for response from contributor label Jun 6, 2022
@powersj
Copy link
Contributor

powersj commented Jun 6, 2022

@kuzyn thanks for the quick attempt. I have pushed another few changes and confirmed that I get past the missing driver error and get to connect to the database failed. Can you try again with the latest artifacts?

Thanks!

@powersj powersj added the waiting for response waiting for response from contributor label Jun 6, 2022
@kuzyn
Copy link
Author

kuzyn commented Jun 6, 2022

Yup @powersj works fine on my end as well. Thanks for the fix! Do you expect this to be rolled into 1.23 ?

@telegraf-tiger telegraf-tiger bot removed the waiting for response waiting for response from contributor label Jun 6, 2022
@powersj
Copy link
Contributor

powersj commented Jun 6, 2022

Yup @powersj works fine on my end as well. Thanks for the fix! Do you expect this to be rolled into 1.23 ?

yes - I just pushed a formatting change for go.mod, so I'll need a review from someone on the team tomorrow, and then I should be able to push and release in next week's v1.23 release!

Thanks for trying it out for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior platform/windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants