Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Unable to connnect to SQLServer dataserver parameter not Working

オープン
#151 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
静か
技術スタック
ruby, sql
領域
backend, databases

調査の方向性

ソースファイルやテストは指定されていません。まず SQL output plugin configuration と TinyTDS connection error から始め、次にその host パラメータと dataserver パラメータが SQLServer adapter にどのように渡されるかを追跡します。報告された設定エラーなしで、文書化された動作する接続を確立できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Ruby
スター
112
フォーク
58
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

fluent/fluent-plugin-sql のほかの issue

fluent/fluent-plugin-sql の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。