docker-env icon indicating copy to clipboard operation
docker-env copied to clipboard

Sybase 16.0 DB is not getting setup properly on Docker Desktop for Mac

Open veekay98 opened this issue 3 years ago • 26 comments

Getting this error when trying to login to isql CT-LIBRARY error: ct_connect(): network packet layer: internal net library error: Net-Lib protocol driver call to connect two endpoints failed

veekay98 avatar Oct 07 '21 11:10 veekay98

Here is the output of the command docker run -p 5000:5000 --rm datagrip/sybase:latest

STARTING... (about 30 sec) =============== SYBASE STARTED ========================== SYBASE_USER: tester SYBASE_PASSWORD: guest1234 SYBASE_DB: testdb =============== CREATING LOGIN/PWD ========================== CT-LIBRARY error: ct_connect(): network packet layer: internal net library error: Net-Lib protocol driver call to connect two endpoints failed =============== CREATING DB ========================== CT-LIBRARY error: ct_connect(): network packet layer: internal net library error: Net-Lib protocol driver call to connect two endpoints failed =============== CREATING SCHEMA ========================== CT-LIBRARY error: ct_connect(): network packet layer: internal net library error: Net-Lib protocol driver call to connect two endpoints failed

veekay98 avatar Oct 07 '21 12:10 veekay98

Can someone please help out here? Thanks.

veekay98 avatar Oct 19 '21 02:10 veekay98

It looks like some issues in Sybase ACE and I start to experience the same issue recently. At least it works in Linux

00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  Current process (0x30002) infected with signal 11 (SIGSEGV)
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  Address 0x0x00007f4a24031190 (), siginfo (code, address) = (2, 0x0x00007f4a24031190)
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  **** Saved signal context (0x0x000000014a6474c0): ****
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  uc_flags: 0x7, uc_link: 0x(nil)
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  uc_sigmask: 0x416000 0xb 0x2 0x24031190
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  uc_stack: ss_sp: 0x(nil), ss_size: 0x0, ss_flags: 0x2
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  General Registers (uc_mcontext.gregs):
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  	PC : 0x00007f4a24031190 ()
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel          RAX : 0x00007f4a24031190  RBX : 0x000000014a647dc0
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel          RCX : 0x00007f4a240439a0  RDX : 0x00007f4a24000078
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  	RBP : 0x000000014a647f00  RSP : 0x000000014a647a58
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  	R8  : 0x0000000000000001  R9  : 0x00007f4a24019810
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  	R10 : 0x0000000000000001  R11 : 0x00007f4a38b10620
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  	R12 : 0x00007f4a24031190  R13 : 0x00007f4a24004970
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  	R14 : 0x00007f4a24031080  R15 : 0x00007f4a24030fe8
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  	RDI : (nil)  RSI : (nil)
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  	RIP : 0x00007f4a24031190  CSGSFS : 0x002b000000000033
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  	TRAPNO : 0x000000000000000e  ERR : 0x0000000000000015
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  	EFL : 0x0000000000010206
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  **** end of signal context ****
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  pc: 0x00000000012deabc pcstkwalk+0x46e()
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  pc: 0x00000000012de48f ucstkgentrace+0x20f()
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  pc: 0x00000000012db382 ucbacktrace+0x54()
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  pc: 0x0000000001587225 terminate_process+0xe95()
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  pc: 0x0000000001310144 kisignal+0x31b()
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  pc: 0x00007f4a24031190 ()
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  pc: 0x00000000011fc075 Snap::Validate()+0x35()
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  pc: 0x00000000008ae3d0 SnapValidation+0x82()
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  pc: 0x000000000158331c dsinit+0x25c()
00:0002:00000:00000:2022/02/02 11:18:37.09 kernel  end of stack trace, kernel service process: kpid 196610
00:0001:00000:00000:2022/02/02 11:20:36.94 kernel  Warning: The internal timer is not progressing. If this message is generated multiple times, report to SAP Technical Support and restart the server (alarminterval=0).
00:0001:00000:00000:2022/02/02 11:30:36.26 kernel  Warning: The internal timer is not progressing. If this message is generated multiple times, report to SAP Technical Support and restart the server (alarminterval=0).

tjlee avatar Feb 02 '22 11:02 tjlee

Mainly caused by https://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc00729.1500/html/errMessageAdvRes/CACFEEEC.htm => so I need to rewrite start and wait in bash

tjlee avatar Feb 03 '22 08:02 tjlee

@tjlee I'm also looking for a resolution to this issue. Any chance you can give some direction on what needs to be rewritten? I can take a stab at it locally and respond back if I can get it to work as expected?

I've tried upping the 'wait' that's already configured in the entrypoint.sh script to a bigger value, but the app never seems to init properly/i always get the error that @veekay98 mentioned. When i look at the ASE logs, i see the same thing you mention above @tjlee.

I'm running on a Windows host, but I've also tried in a Linux VM and get the same result, even when upping the wait to 75s.

Any guidance is appreciated.

Thanks! :)

ConnorDouglasEmpire avatar Jun 22 '22 15:06 ConnorDouglasEmpire

I would be interested as well on the timeout. @tljee any updates?

djauregui76 avatar Jul 12 '22 00:07 djauregui76

Hi, I was just searching for a solution to this very problem and found your question, and a little bit later the answer here.

https://answers.sap.com/questions/13286419/ase-16-signal-11-stack-trace-snapvalidate-kba-3018.html

In your docker RUN script add this -T11889 flag which switches off the Snap Validation routine causing the problem. It is working fine now for me. This only seemed to affect Sybase when run in Docker 20.x.y engine, docker 19.x.y seemed to work fine which is another workaround :).

root@28e4eac8ad0a install]# pwd /opt/sybase/ASE-16_0/install [root@28e4eac8ad0a install]# cat RUN_MYSYBASE #!/bin/sh .. /opt/sybase/ASE-16_0/bin/dataserver
-d/opt/sybase/data/master.dat
-e/opt/sybase/ASE-16_0/install/MYSYBASE.log
-c/opt/sybase/ASE-16_0/MYSYBASE.cfg
-M/opt/sybase/ASE-16_0
-N/opt/sybase/ASE-16_0/sysam/MYSYBASE.properties
-i/opt/sybase
-sMYSYBASE
-T11889 \

doresome avatar Aug 10 '22 22:08 doresome

Hi, I was just searching for a solution to this very problem and found your question, and a little bit later the answer here.

https://answers.sap.com/questions/13286419/ase-16-signal-11-stack-trace-snapvalidate-kba-3018.html

In your docker RUN script add this -T11889 flag which switches off the Snap Validation routine causing the problem. It is working fine now for me. This only seemed to affect Sybase when run in Docker 20.x.y engine, docker 19.x.y seemed to work fine which is another workaround :).

root@28e4eac8ad0a install]# pwd /opt/sybase/ASE-16_0/install [root@28e4eac8ad0a install]# cat RUN_MYSYBASE #!/bin/sh .. /opt/sybase/ASE-16_0/bin/dataserver -d/opt/sybase/data/master.dat -e/opt/sybase/ASE-16_0/install/MYSYBASE.log -c/opt/sybase/ASE-16_0/MYSYBASE.cfg -M/opt/sybase/ASE-16_0 -N/opt/sybase/ASE-16_0/sysam/MYSYBASE.properties -i/opt/sybase -sMYSYBASE -T11889 \

Using Docker Engine version 24.0.1, can confirm -T11889 fixed the problem! Thank you so much!

iambearman avatar Jul 03 '23 07:07 iambearman

Hi, i'am face to the same problem i'am using the last version of docker engine, i didn't inderstand where we should add -T11889, can you give me an exemple of this ?

I used this command : docker run -p 5000:5000 --rm datagrip/sybase:latest -T11889

# Interfaces file directory: /opt/sybase # SAP Adaptive Server Enterprise name: MYSYBASE # /opt/sybase/ASE-16_0/bin/dataserver \ -d/opt/sybase/data/master.dat \ -e/opt/sybase/ASE-16_0/install/MYSYBASE.log \ -c/opt/sybase/ASE-16_0/MYSYBASE.cfg \ -M/opt/sybase/ASE-16_0 \ -N/opt/sybase/ASE-16_0/sysam/MYSYBASE.properties \ -i/opt/sybase \ -sMYSYBASE \ Thnx

Mustaphabns avatar Sep 30 '23 13:09 Mustaphabns

First of all, I am sorry for your poor soul that you have to use Sybase (or you actually like it?), I have no choice but to use Sybase because that's what my company had.

Second, follow these steps

  1. run command docker run -p 5000:5000 --name sybase -v sybase-data:/opt/sybase datagrip/sybase:16.0
  2. wait for it until it stop at
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
=============== WAITING FOR master.dat SPACE ALLOCATION ==========================
=============== WAITING FOR INITIALIZATION ==========================
=============== SYBASE STARTED ==========================
SYBASE_USER: tester
SYBASE_PASSWORD: guest1234
SYBASE_DB: testdb
=============== CREATING LOGIN/PWD ==========================
CT-LIBRARY error:
	ct_connect(): network packet layer: internal net library error: Net-Lib protocol driver call to connect two endpoints failed
=============== CREATING DB ==========================
CT-LIBRARY error:
	ct_connect(): network packet layer: internal net library error: Net-Lib protocol driver call to connect two endpoints failed
=============== SYBASE INITIALIZED ==========================
  1. If you are familiar with Unix/Linux shell operation, you may continue to step 4-9, else just do 3.1 and ignore step 4-9 3.1. run command: docker exec -it sybase bash -c "sed -i '$ s/$/-T11889 \\\\/' /opt/sybase/ASE-16_0/install/RUN_MYSYBASE && echo '' >> /opt/sybase/ASE-16_0/install/RUN_MYSYBASE"
  2. open another shell, and run command docker exec -it sybase bash to get inside the container
  3. inside container shell, run command cd /opt/sybase/ASE-16_0/install
  4. inside container shell, run command vi RUN_MYSYBASE
  5. add -T11889 \ to the last line such that it should looks something like this (keep one more empty line as the last line), save and exit the file
#!/bin/sh
#
# SAP ASE page size (KB):       16k
# Master device path:   /opt/sybase/data/master.dat
# Error log path:       /opt/sybase/ASE-16_0/install/MYSYBASE.log
# Configuration file path:      /opt/sybase/ASE-16_0/MYSYBASE.cfg
# Directory for shared memory files:    /opt/sybase/ASE-16_0
# License properties file:      /opt/sybase/ASE-16_0/sysam/MYSYBASE.properties
# Interfaces file directory:    /opt/sybase
# SAP Adaptive Server Enterprise name:  MYSYBASE
#
/opt/sybase/ASE-16_0/bin/dataserver \
-d/opt/sybase/data/master.dat \
-e/opt/sybase/ASE-16_0/install/MYSYBASE.log \
-c/opt/sybase/ASE-16_0/MYSYBASE.cfg \
-M/opt/sybase/ASE-16_0 \
-N/opt/sybase/ASE-16_0/sysam/MYSYBASE.properties \
-i/opt/sybase \
-sMYSYBASE \
-T11889 \
<<<empty line here>>>
  1. close the container shell
  2. open another shell and run command docker stop sybase to stop the Sybase container
  3. the first shell that has Sybase container running should now have exited the container
  4. run command docker start sybase to start Sybase container again
  5. wait for a good 5 minutes to let Sybase correctly setup
  6. use your tools/program to login with
  • username: tester
  • password: guest1234 or
  • username: sa
  • password: myPassword
  1. when you are done using the Sybase container, run command docker stop sybase to stop it
  2. next time you wanna use the container again, just run command docker start sybase, all of the previously stored data are still there because of the docker volume.

iambearman avatar Sep 30 '23 14:09 iambearman

Thank's for your quick response, it's not my choice, it's consumer choice :/ .

I still have the same issue when tring to connect to database with ISQL:

/opt/sybase/OCS-16_0/bin/isql -Usa -PmyPassword -SMYSYBASE CT-LIBRARY error: ct_connect(): network packet layer: internal net library error: Net-Lib protocol driver call to connect two endpoints failed

Mustaphabns avatar Sep 30 '23 15:09 Mustaphabns

start your docker, exec an interactive bash, make your RUN file look like this below by adding a line to the last by one line. Restart your docker, it should then work.

-T11889 \

$ sudo docker start syb syb $ sudo docker exec --interactive --tty syb bash --login [root@1911757ee96f /]# cat /opt/sybase/ASE-16_0/install/RUN_MYSYBASE #!/bin/sh

SAP ASE page size (KB): 16k

Master device path: /opt/sybase/data/master.dat

Error log path: /opt/sybase/ASE-16_0/install/MYSYBASE.log

Configuration file path: /opt/sybase/ASE-16_0/MYSYBASE.cfg

Directory for shared memory files: /opt/sybase/ASE-16_0

License properties file: /opt/sybase/ASE-16_0/sysam/MYSYBASE.properties

Interfaces file directory: /opt/sybase

SAP Adaptive Server Enterprise name: MYSYBASE

/opt/sybase/ASE-16_0/bin/dataserver -d/opt/sybase/data/master.dat -e/opt/sybase/ASE-16_0/install/MYSYBASE.log -c/opt/sybase/ASE-16_0/MYSYBASE.cfg -M/opt/sybase/ASE-16_0 -N/opt/sybase/ASE-16_0/sysam/MYSYBASE.properties -i/opt/sybase -sMYSYBASE -T11889 \

i still have the same issue when restarting container or try to connect directly by ISQL

Mustaphabns avatar Sep 30 '23 15:09 Mustaphabns

I don't have isql with me, would you mind share your isql interface file content for reference?

iambearman avatar Sep 30 '23 15:09 iambearman

I made an typo in step 3.1, it should be -T11889 not -T18899, please remove all sybase container, and sybase-data volume and try again

iambearman avatar Sep 30 '23 15:09 iambearman

A successful start will have these messages at the bottom of the log

sudo docker exec syb bash -c ":; cd /opt/sybase/ASE-16_0/install/; tail -5 MYSYBASE.log"

00:0002:00000:00002:2023/09/30 15:31:31.24 server  Master device size: 564 megabytes, or 288768 virtual pages. (A virtual page is 2048 bytes.)
00:0002:00000:00002:2023/09/30 15:31:31.24 kernel  Warning: Cannot set console to nonblocking mode, switching to blocking mode.
00:0002:00000:00002:2023/09/30 15:31:31.24 kernel  Console logging is disabled. This is controlled via the 'enable console logging' configuration parameter.
00:0006:00000:00000:2023/09/30 15:31:58.90 kernel  Performing space allocation for device '/opt/sybase/data/master.dat' (0.06 Gb).  This may take some time.
00:0002:00000:00013:2023/09/30 15:31:59.03 kernel  Finished initialization.

doresome avatar Sep 30 '23 15:09 doresome

The only change I had to make was add line 20 as below


$ sudo docker exec syb bash -c ":; cd /opt/sybase/ASE-16_0/install/; cat -n RUN_MYSYBASE | tail -5"
    17  -N/opt/sybase/ASE-16_0/sysam/MYSYBASE.properties \
    18  -i/opt/sybase \
    19  -sMYSYBASE \
    20  -T11889 \
    21

doresome avatar Sep 30 '23 16:09 doresome

A successful start will have these messages at the bottom of the log

sudo docker exec syb bash -c ":; cd /opt/sybase/ASE-16_0/install/; tail -5 MYSYBASE.log"

00:0002:00000:00002:2023/09/30 15:31:31.24 server  Master device size: 564 megabytes, or 288768 virtual pages. (A virtual page is 2048 bytes.)
00:0002:00000:00002:2023/09/30 15:31:31.24 kernel  Warning: Cannot set console to nonblocking mode, switching to blocking mode.
00:0002:00000:00002:2023/09/30 15:31:31.24 kernel  Console logging is disabled. This is controlled via the 'enable console logging' configuration parameter.
00:0006:00000:00000:2023/09/30 15:31:58.90 kernel  Performing space allocation for device '/opt/sybase/data/master.dat' (0.06 Gb).  This may take some time.
00:0002:00000:00013:2023/09/30 15:31:59.03 kernel  Finished initialization.

i already add tag -T11889 and i have the same issue, here is ma log file "MYSYBASE.log": 00:0000:00000:00000:2023/10/01 09:25:30.43 kernel Create Thread Pool 1, "syb_default_pool", type="Engine (Multiplexed)", with 1 threads 00:0000:00000:00000:2023/10/01 09:25:30.43 kernel Aggressive task stealing enabled 00:0000:00000:00000:2023/10/01 09:25:30.43 kernel Create Thread Pool 3, "syb_blocking_pool", type="Run To Completion", with 4 threads 00:0007:00000:00000:2023/10/01 09:25:30.46 kernel I/O controller 2 (NetController) is running as task 786438 on thread 7 (LWP 34). 00:0000:00000:00000:2023/10/01 09:25:30.46 kernel Kernel asynchronous I/O not initialized because it is not supported by this host. Install the appropriate asynchronous I/O libraries. 00:0000:00000:00000:2023/10/01 09:25:30.46 kernel Attempt to resize 'Disk Controller Manager' failed because a new controller could not be created. 00:0000:00000:00000:2023/10/01 09:25:30.46 kernel It was not possible to create the disk controllers for the server, the server will now shutdown. 00:0000:00000:00000:2023/10/01 09:25:30.46 kernel end of stack trace, kernel service process: kpid 0 00:0000:00000:00000:2023/10/01 09:25:30.46 kernel PCI(M0): PCI Bridge: Releasing PCA subsystem for engine 0.

Mustaphabns avatar Oct 01 '23 09:10 Mustaphabns

I don't have isql with me, would you mind share your isql interface file content for reference?

it's command line for connecting to sybase, you can find it in /opt/sybase/OCS-16_0/bin/ folder

Mustaphabns avatar Oct 01 '23 09:10 Mustaphabns

thank you everyone, my first problem was -T11889 tag, and second one is for macOs user, i find the solution here : https://github.com/nguoianphu/docker-sybase/issues/3

Thank you

Mustaphabns avatar Oct 01 '23 09:10 Mustaphabns

Do you know how can i automatize all this configuration in docker-compose.yml ?

Mustaphabns avatar Oct 01 '23 11:10 Mustaphabns

Sorry don't know how to user docker-compose but I've seen someone else do it and know it's possible. I can use bash and sudo docker to do this (as the sed script above) but that's it sorry

Also you don't need an external client to test, you use the client in the docker image itself to check it's ok

sudo docker exec --interactive --tty syb bash 

[root@1911757ee96f /]# source /opt/sybase/SYBASE.sh
[root@1911757ee96f /]# isql -S MYSYBASE -U sa -P myPassword
1> select @@servername
2> go
                                
 ------------------------------ 
 MYSYBASE                       

(1 row affected)
1> quit
[root@1911757ee96f /]#

doresome avatar Oct 01 '23 12:10 doresome

It looks like we need a separate image to run correctly on Mac M1...

tjlee avatar Dec 07 '23 10:12 tjlee

It looks like we need a separate image to run correctly on Mac M1...

Try mine https://github.com/iambearman/docker-sybase

iambearman avatar Dec 07 '23 11:12 iambearman

I hope I've fixed the issue at least for Sybase ASE 16.0 by adding -T11889 flag.

Many thanks to @doresome

P.S.: Sybase 15.7 needs some more investigation...

tjlee avatar Jan 11 '24 14:01 tjlee