rails-sqlserver / tiny_tds

TinyTDS - Simple and fast FreeTDS bindings for Ruby using DB-Library.
Other
606 stars 189 forks source link

TinyTds::Error: Bad numbytes parameter passed to dbstrcpy #537

Open Nyazfoxsoft opened 1 year ago

Nyazfoxsoft commented 1 year ago

Hi,

I'm having an issue with using this gem. Hoping someone can point to the right direction. Many thanks

Environment

Operating System

Using MacOS M1 Venture ProductName: macOS ProductVersion: 13.2.1 BuildVersion: 22D68

TinyTDS Version and Information Using Version: freetds v1.3.18

Compile-time settings (established with the "configure" script)
                            Version: freetds v1.3.18
             freetds.conf directory: /opt/homebrew/etc
     MS db-lib source compatibility: no
        Sybase binary compatibility: yes
                      Thread safety: yes
                      iconv library: yes
                        TDS version: 7.3
                              iODBC: no
                           unixodbc: yes
              SSPI "trusted" logins: no
                           Kerberos: yes
                            OpenSSL: yes
                             GnuTLS: no
                               MARS: yes

FreeTDS Version freetds 1.3.18_1

Description

I'm getting the following error when trying to access an item from database using rails console

1] pry(main)> StockItem.last

TinyTds::Error: Bad numbytes parameter passed to dbstrcpy

from /Users/nyaz/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/tiny_tds-2.1.5/lib/tiny_tds/client.rb:60:in `connect'
andyundso commented 1 year ago

Hello @Nyazfoxsoft

can you provide any information about the server you are trying to connect? Specifically SQL server version and which authentication method you use.

Nyazfoxsoft commented 1 year ago

Hi @andyundso

The server is running Linux 5.15.0-76-generic #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

The SQL details

Microsoft SQL Server 2012 (SP4-GDR) (KB4532098) - 11.0.7493.4 (X64) 
    Dec 24 2019 19:33:24 
    Copyright (c) Microsoft Corporation
    Standard Edition (64-bit) on Windows NT 6.3 <X64> (Build 9600: ) (Hypervisor)

in my rails application I use host, username and password to connect and connected to same server using VPN