sqsh gives "dsp_desc_bind: Memory allocation failure for column #1" - freetds

On Ubuntu 18.04 with freetds 1.00.82-2 and sqsh 2.1.7-4build1, I get the following when trying to SELECT foo FROM bar where foo is an nvarchar column:
dsp_desc_bind: Memory allocation failure for column #1
Why does this happen? I see some ancient bug reports, but I can't see any solutions there; this error message is quite ungooglable.

I tried downgrading freetds to 0.91.6, which I had working on Ubuntu 17.10, and then got the more understandable error message
Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier.
which led me to the solution:
Edit /etc/freetds/freetds.conf and add a section
[YourDbHostname]
host = localhost
port = 1433
tds version = 8.0
Now it works :)
EDIT: Seems like sqsh-2.5.16.1 ignores this file now? Another solution is to just use the -G argument, e.g. sqsh -G 8.0 -i foo.sql

Related

./prereqs-ubuntu.sh Error: Ubuntu focal is not supported

I'm trying to use composer and for the same I'm using the below command for installation.
curl -O https://hyperledger.github.io/composer/latest/prereqs-ubuntu.sh
chmod u+x prereqs-ubuntu.sh
These above commands successfully executed.
But when I executed this command (./prereqs-ubuntu.sh) then I'm getting below error
Terminal Throws Error ///Ubuntu focal is not supported
Please help
Hyperledger Composer Installation
I also find this kind of error during Hyperledger Composer installation this problem mainly depends on the Ubuntu version.
Steps to overcome this problem.
upgrade ubuntu version as per your ubuntu versoin please follow:
https://www.fosslinux.com/38303/how-to-upgrade-to-ubuntu-20-04-lts-focal-fossa.htm
open file prereqs-ubuntu.sh with your compatible editor
update line:
#Array of supported versions
declare -a versions=('trusty' 'xenial' 'yakkety', 'bionic');
with
# Array of supported versions
declare -a versions=('trusty' 'xenial' 'yakkety', 'bionic', 'focal');
After saving this file
Run command: ./prereqs-ubuntu.sh
I hope this problem will resolve if anything please feel free to write.

Using pymssql 2.2 not connecting to SQL server

I was using a Macos system install of Python rather than a virtualenv. On this I had installed freetds and pymssql 2.1. This connected fine to a database using:
pymssql.connect(server='the.host.name\instance', user='username' etc . . ).
Realising that virtualenv is the proper way to do stuff I created a python 2.7-based virtual env and tried to pip install pymssql but got an error message. Quick hunt found the fix - namely to install from git with:
pip install git+https://github.com/pymssql/pymssql.git
but now my connection call returns a host-not responding error. I have used tsql to debug (TDSDUMP=stdout) and it looks like the address\instance is causing a problem. Connecting to databases that have an address but no instance works fine
When I revert to my system-wide install and run it, I see that freetds resolves a port number for the database instance to a specific port (portNo).
Under my virtualenv, if I do my call to pymssql using this port number, my connection is fine.
pymssql.connect(server='the.host.name\instance', user='username', port='portNo', etc . . .)
whilst this work around works - I'm guessing that any change on the server might break it.
Any ideas why my pymssql call fails under these conditions?
Explicit is better than implicit. It is best to always include the port number (at least I do).
Review the following two items:
Make sure both installatons of pymssql (the global one and the one you get inside the virtualenv) are actually linked against the same FeeeTDS version. It could be you have more than one FreeTDS version installed and this is the reason you're seeing different behavior.
When the server parameter contains \ characters, make sure you either double quote it ('the.host.name\\instance') or use raw string notation (r'the.host.name\instance'). This is standard Python development practice.

Ejabberd installation strange issue

OS: Debian 8.1 X64
trying to install eJabberd Community server based on this tutorial
At the end of installation, it pops error message
Error: Error running Post Install Script.
The installation may have not completed correctly
What am I doing wrong?
It looks like /bin/sh is Dash on your system (apparently the default since Debian Squeeze). However, the postinstall.sh script inside the package uses brace expansion, which while widely supported in various shells is not required by the POSIX standard, and thus Dash is not in error by not supporting it. The postinstall.sh script should either specify /bin/bash instead of /bin/sh in its first line, or abstain from using Bash-specific features.
You should be able to get a functioning ejabberd install by explicitly running the postinstall script with Bash:
sudo bash /opt/ejabberd-15.07/bin/postinstall.sh

Could not connect to a primary node for replica set <Moped::Cluster nodes=[<Moped::Node resolved_address="127.0.0.1:27017">]>

I'm following though with the RailsApp tutorial with Devise and Mongoid (http://railsapps.github.io/tutorial-rails-mongoid-devise.html) and am encountering the following error when I get to 'Rake db:seed' down at the 'Set Up a Database Seed File' section.
Could not connect to a primary node for replica set <Moped::Cluster nodes=[<Moped::Node resolved_address="127.0.0.1:27017">]>
I've tried the instructions from nixoncd on this page here but has not fixed the issue. It tells me 'file exists' and 'Already loaded'. 'https://groups.google.com/forum/#!topic/mongodb-user/Hhh8iNCciMk
I get this if I type 'mongod' in terminal.
ERROR: could not read from config file
Any help welcome. I'm on a Mac OSX Mountain Lion with Mongoid installed using homebrew - though MongoDB was installed using the download package mongodb.org.
MongoDB shell version: 2.4.6
Thanks
EDIT: I'm not sure if this issue is related or not. Also having issues launching mongoDB. Also posted issue here:
mongoDB, could not read from config file -- config in different folder / Uninstall it?
First See if your database is running by mongo , If yes
Use this command:
sudo rm /var/lib/mongodb/mongod.lock
mongod --repair
sudo service mongodb start
Your database will work.
Installing MongoDB solved this for me:
sudo apt-get install mongodb-server
The answers above will work for you in the majority of the cases where this error occurs.
However, I would like to note that you can also get the Could not connect to a primary node for replica set error when trying to write exceptionally large batches of records to MongoDB in one request. I have encountered this error when writing more than 200,000 1 KB documents to a remote MongoDB server with in one request. The remote server had 8 GB memory and would handle several requests at once. This error can be avoided by cutting down the batch size of your requests.

How to use -I backend with Mdb-tools 0.7~rc1-4?

I want to convert ms-access database to sql via mdbtools.
on ubuntu 11.10 32bit with mdbtools 0.5.99.0.6pre1.0.20051109-7.1 when i am using mdbtools -I backend is working fine. i.e. i got file with Insert statement.
but on ubuntu 12.04lts 64bit, mdbtools, 0.7~rc1-4 i am not able to convert mdb file into sql file.
my syntax is :
mdb-tools -I >
please let me know any correction is needed.
Thanks in advance.
mdb-tools -I access shuld work
Supported backends are: access, sybase, oracle, postgres, mysql

Resources