Comments (35)
Can you paste the sample program which produced you this error?
Give me some information about the error like:
What were you trying to do?
was the connection successful?
Thanks,
Akhil.
from go_ibm_db.
@akhilravuri1
Error recurrence step:
1、Download go_ibm_db and configure the environment variable in the home path. Run the demo successfully and go build.I will get binary file.
2、Linux creates Shared folders with Windows
3、Put the binaries in a Shared folder and execute.You will get this error.
Thanks.
from go_ibm_db.
Are you executing the binary file in windows?
Thanks,
Akhil
from go_ibm_db.
@akhilravuri1
No. I execute the binary file at shared folders in linux.
Thanks
from go_ibm_db.
@firewaternottogther In step 1, you are configuring the environment variables in the home path. I assume you have updated PATH, INCLUDE, and LD_LIBRARY_PATH env vars. Now, in step 3, you are moving the binary to a different folder. Have you updated the environment variables as per this new folder?
To make it working, please add the .../clidriver/bin:.../clidriver/lib
in your PATH and LD_LIBRARY_PATH system environment variable. Then it should work. Thanks.
from go_ibm_db.
@akhilravuri1
sorry,I disagree.I only change the binary file location, the program reads the location is still the same.Where is the location of the clidriver read in your code and I want to see its logic.
Thanks.
from go_ibm_db.
@firewaternottogther I have created a shared folder using samba and copied the binary to the shared folder and executed it. It was working fine.
Try to add the clidriver/lib in the $PATH variable and execute the file once again.
Under github.com/ibmdb/go_ibm_db/api folder in each Unix file, we use LDFLAGS linking based on the environment variables. These env vars(CGO_CFLAGS, CGO_LDFLAGS) will have the path to the clidriver.
Thanks,
Akhil
from go_ibm_db.
@akhilravuri1
I'm so sorry. I tried to add the clidriver/lib in the $PATH variable and execute the file once again.Error is still.
Since this scenario cannot be reproduced, we can change the scenario and put this binary on another host without go environment to run.How do we set the environment variables
Thanks
from go_ibm_db.
you can put the binary in any system with same os and architecture ( go lang is platform dependent in case of binaries) but clidriver should be present in that system.
Env's to be set:-
export DB2HOME=/home/uname/go/src/github.com/ibmdb/go_ibm_db/installer/clidriver (PATH TO CLIDRIVER)
export CGO_CFLAGS=-I$DB2HOME/include
export CGO_LDFLAGS=-L$DB2HOME/lib
export LD_LIBRARY_PATH=/home/uname/go/src/github.com/ibmdb/go_ibm_db/installer/clidriver/lib
Thanks,
Akhil.
from go_ibm_db.
@akhilravuri1
This is the location of the clidrive.
Env's to be set:
but error are still there.I'm sorry, I really hope you can answer.
Thanks.
from go_ibm_db.
The driver is under root if you don't have the permissions you can't read the data. Try to place the driver in another folder or change the permission by
sudo chmod -R 777 foldername
Thanks,
AKhil
from go_ibm_db.
@akhilravuri1
After adding permissions, error is still reported.Can we contact each other by email?
Thanks
from go_ibm_db.
@firewaternottogther
can you collect db2 and cli traces
db2trc on -f trc.dmp
run your application
db2trc off
db2trc flw trc.dmp trc.flw
db2trc fmt trc.dmp trc.fmt
db2trc fmt -c trc.dmp trc.fmtc
db2trc fmt -cli trc.dmp trc.cli
and share the trc.flw, trc.fmt, trc.fmtc and trc.cli files with us to assist you further.
Thanks,
Akhil
from go_ibm_db.
@firewaternottogther
Have you collected the traces?
Thanks,
Akhil
from go_ibm_db.
@akhilravuri1
Sorry for the late reply!
Thanks,
Xu
from go_ibm_db.
@firewaternottogther
share the files, not the Image.
Thanks,
Akhil
from go_ibm_db.
@akhilravuri1
info.zip
Thanks,
Xu
from go_ibm_db.
Hi @firewaternottogther
There is no data in the file. Can you run the application again when the trace is on and share the files.
Thanks,
Akhil
from go_ibm_db.
@akhilravuri1
Probably because of my Linux environment.Every time I report this error,even if there is a configuration in the configuration file, I will source /etc/profile and it's ok.I'll look around.
thanks a lot,
xu
from go_ibm_db.
Hi,
@akhilravuri1
I'm facing the same issue, is this problem resolved ?
from go_ibm_db.
The problem is because of the user environment issues.
Thanks,
Akhil
from go_ibm_db.
Thanks for the quick response @akhilravuri1.
Sorry for the late reply.
Here are the environment variables i have set in my LINUX environment.:
export DB2HOME=/home/db2inst2/db2_cli_odbc_driver/odbc_cli/clidriver (PATH TO CLIDRIVER)
export CGO_CFLAGS=-I$DB2HOME/include
export CGO_LDFLAGS=-L$DB2HOME/lib
export LD_LIBRARY_PATH=/home/db2inst2/db2_cli_odbc_driver/odbc_cli/clidriver/lib
but still am facing this error in the GUI of hammerdb
What am I doing wrong here? Please guide me, I'm really stuck with this for so long.
from go_ibm_db.
Hi @Prathyusha6
Can you please set the env variables to the clidriver downloaded by the go_ibm_db driver?
Just wanted to check later we will replace it with the values you are using.
If you haven't download the clidriver using go_ibm_db please follow the below steps.
go to the installer folder where go_ibm_db is downloaded in your system (Example: /home/uname/go/src/github.com/ibmdb/go_ibm_db/installer) and run setup.go file (go run setup.go)
where uname is the username
The above command will download the clidriver.
Set the below environment variables with the path of the clidriver downloaded
export DB2HOME=/home/uname/go/src/github.com/ibmdb/go_ibm_db/installer/clidriver
export CGO_CFLAGS=-I$DB2HOME/include
export CGO_LDFLAGS=-L$DB2HOME/lib
export LD_LIBRARY_PATH=/home/uname/go/src/github.com/ibmdb/go_ibm_db/installer/clidriver/lib
from go_ibm_db.
Thanks @akhilravuri1 .
Have downloaded go_ibm_driver and set the environments as:
export DB2HOME=/root/go/src/github.com/ibmdb/go_ibm_db/installer/clidriver
export CGO_CFLAGS=-I$DB2HOME/include
export CGO_LDFLAGS=-L$DB2HOME/lib
export LD_LIBRARY_PATH=/root/go/src/github.com/ibmdb/go_ibm_db/installer/clidriver/lib
but still the error remained same
from go_ibm_db.
Hi @Prathyusha6
I see you are working under root..there might be some permission issues.
Please check that.
I will try to reproduce the issue..Please tell us which version of 'go' and 'db2' are you using.
If possible please paste the output of db2level.
Thanks,
Akhil
from go_ibm_db.
@akhilravuri1
Tried changing the directory to home/user , still getting the same result.
changed env vars to :
export DB2HOME=/home/user/go/src/github.com/ibmdb/go_ibm_db/installer/clidriver
export CGO_CFLAGS=-I$DB2HOME/include
export CGO_LDFLAGS=-L$DB2HOME/lib
export LD_LIBRARY_PATH=/home/user/go/src/github.com/ibmdb/go_ibm_db/installer/clidriver/lib
db2level output
should i write or include any configuration files as well ?
i hv added db2cli.ini file with
[tstcli1x]
uid=####
pwd=####
autocommit=0
TableType="'TABLE','VIEW','SYSTEM TABLE'"
[tstcli2x]
; Assuming dbalias2 is a database in DB2 for MVS.
SchemaList="'OWNER1','OWNER2',CURRENT SQLID"
[MyVeryLongDBALIASName]
dbalias=dbalias3
SysSchema=MYSCHEMA
Please help me with this na @akhilravuri1
Thanks,
Prathyusha.
from go_ibm_db.
Hi @Prathyusha6
Does your PATH contain multiple dsdriver?
Please paste the output of PATH and LD_LIBRARY_PATH.
Thanks,
Akhil
from go_ibm_db.
@akhilravuri1
I think no, can you plz guide me where to get it ?
Here are the env vars:
Thanks,
Prathyusha
from go_ibm_db.
Hi @Prathyusha6
Are you running go application?
Can you please run this sample go application and paste the output?
package main
import (
_ "github.com/ibmdb/go_ibm_db"
"database/sql"
"fmt"
)
func main(){
con:="HOSTNAME=host;DATABASE=name;PORT=number;UID=username;PWD=password"
db, err:=sql.Open("go_ibm_db", con)
if err != nil{
fmt.Println(err)
}
err = db.Ping()
if err != nil {
fmt.Println(err)
} else {
fmt.Println("CONNECTION SUCCESS")
}
db.Close()
}
Thanks,
Akhil
from go_ibm_db.
I have set
GOROOT=/usr/local/go/
GOPATH=/home/user/go/src
PATH = $PATH:/usr/local/go/bin
GOROOT and GOPATH are set wrong here ?
Thanks,
Prathyusha
from go_ibm_db.
Go PATH has to home/user/go please remove src.
If you see the image...it checks in /home/user/go/src/src/github.com/ibmdb/go_ibm_db path.
Thanks,
Akhil
from go_ibm_db.
Oh sry. Thanks @akhilravuri1
Got the success result and tried running hammerdb again but still popping up the same error..
from go_ibm_db.
from go_ibm_db.
Hi @Prathyusha6
Sorry for the late reply...I was trying to install HammerDb
yes..we can talk about this in email.
But just for conformation...Does this do anything with go driver?
Because the Go application runs fine in this your previous comment.
Thanks,
Akhil
from go_ibm_db.
The same issue here, how to solve this please
from go_ibm_db.
Related Issues (20)
- ../../go/pkg/mod/github.com/ibmdb/[email protected]/api/api_unix.go:13:11: fatal error: sqlcli1.h: No such file or directory HOT 2
- How to fix CLI0129E An attempt to allocate a handle failed because there are no more handles to allocate HOT 2
- After connecting to db2 successfully, Chinese character display exception in the query result HOT 14
- Stored procedures support array-based input parameters HOT 2
- Inconsistent GSKIT Error 2 HOT 12
- fatal error: invalid pointer found on stack HOT 6
- [help]how to debug the cost breakdown HOT 2
- The gbk encoded Chinese field may be truncated when read in the utf8 operating environment HOT 1
- SQL_DECIMAL type uses comma as separator, not period, so it can't convert to float64 HOT 5
- [CRITICAL] - double byte characters are truncated for CHAR columns HOT 1
- Driver support sql.Named or not? HOT 2
- DECIMAL Precision is lost by binding variables by inserting string HOT 4
- Get Clob CLI0131E Invalid string or buffer lengt HOT 2
- Does go_ibm_db support informix HOT 1
- Support go_ibm_db driver with UBI 9 and openssl 3.0 HOT 6
- Adding Dynamic Cursor Functionalities HOT 1
- Add env var to override cli driver download url
- DB2 Connection TCP/IP Error HOT 13
- fatal error: 'sqlcli1.h' file not found on macOS HOT 1
- fatal error: 'sqlcli1.h' file not found on macOS HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go_ibm_db.