Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Unable to connnect to SQLServer dataserver parameter not Working

Open
#151 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Quiet
Tech stack
ruby, sql
Domain
backend, databases

Research direction

No source files or tests are named. Start with the SQL output plugin configuration and the TinyTDS connection error, then trace how its host and dataserver parameters are passed to the SQLServer adapter; done means establishing a documented, working connection without the reported configuration errors.

Written by the indexing model from the issue text.

Description

enhancement

So I've been working with this plugin for some days and finally achieved sending logs to a local sqlserver container.
Now that Im trying in prepo I'm not able to connecto to the database.
And so I startted with

<match docker.caesar**>
    @type copy
    <store>
        @type stdout
    </store>
    <store>
        @type sql
        log_level info
        host 172........\sql2019pre
        port 1433
        chema_search_path piscinalogs
        database db_Poseidon
        adapter sqlserver
        username "#{ENV['USER']}"
        password "#{ENV['PASSWORD']}"
        state_file /var/run/fluentd/sql_state
        <table>
            table logs
column_mapping 'time:timestamp,level:level,mensaje:message,Container_Name:containerName,App_Name:appName,Env:enviroment'
            # This is the default table because it has no "pattern" argument in <table>
            # The logic is such that if all non-default <table> blocks
            # do not match, the default one is chosen.
            # The default table is required.
            flush_interval 10s
        </table>
    </store>
</match>

This configuration did not work since it returns
fluentd | 2024-08-29 09:42:24 +0000 [warn]: #0 failed to flush the buffer. retry_times=0 next_retry_time=2024-08-29 09:42:26 +0000 chunk="620cf46e28eacdbcecf964d3ed2978be" error_class=TinyTds::Error error="Server name not found in configuration files"
Then I investigated how activerecords connects to database and encounter that they used the param: dataserver
When removing the host param in order to introduce the dataserver param :

<match docker.caesar**>
    @type copy
    <store>
        @type stdout
    </store>
    <store>
        @type sql
        log_level info
        dataserver 172.......\sql2019pre
        port 1433
        chema_search_path piscinalogs
        database db_Poseidon
        adapter sqlserver
        username "#{ENV['USER']}"
        password "#{ENV['PASSWORD']}"
        state_file /var/run/fluentd/sql_state
        <table>
            table logs
column_mapping 'time:timestamp,level:level,mensaje:message,Container_Name:containerName,App_Name:appName,Env:enviroment'
            # This is the default table because it has no "pattern" argument in <table>
            # The logic is such that if all non-default <table> blocks
            # do not match, the default one is chosen.
            # The default table is required.
            flush_interval 10s
        </table>
    </store>
</match>

It returns:
fluentd | 2024-08-29 09:45:42 +0000 [error]: config error file="/fluentd/etc/fluent.conf" error_class=Fluent::ConfigError error="'host' parameter is required"
And so I decided to let both parameters

<match docker.caesar**>
    @type copy
    <store>
        @type stdout
    </store>
    <store>
        @type sql
        host  172......
        dataserver 172.......\sql2019pre
        port 1433
        chema_search_path piscinalogs
        database db_Poseidon
        adapter sqlserver
        username "#{ENV['USER']}"
        password "#{ENV['PASSWORD']}"
        state_file /var/run/fluentd/sql_state
        <table>
            table logs
column_mapping 'time:timestamp,level:level,mensaje:message,Container_Name:containerName,App_Name:appName,Env:enviroment'
            # This is the default table because it has no "pattern" argument in <table>
            # The logic is such that if all non-default <table> blocks
            # do not match, the default one is chosen.
            # The default table is required.
            flush_interval 10s
        </table>
    </store>
</match>

It returns: fluentd | 2024-08-29 09:48:34 +0000 [warn]: #0 failed to flush the buffer. retry_times=4 next_retry_time=2024-08-29 09:48:48 +0000 chunk="620cf5c1a09d87697d7c0f92760ef3fb" error_class=TinyTds::Error error="Unable to connect: Adaptive Server is unavailable or does not exist (172......)"
Im quite lost at this point

Dominant language
Ruby
Stars
112
Forks
58
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fluent/fluent-plugin-sql

All issues in fluent/fluent-plugin-sql

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.