DataGrip / docker-env

Docker environment for DataGrip testing
Apache License 2.0
83 stars 35 forks source link

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

Open veekay98 opened 3 years ago

veekay98 commented 3 years ago

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 commented 3 years ago

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 commented 2 years ago

Can someone please help out here? Thanks.

tjlee commented 2 years ago

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 commented 2 years ago

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

ConnorDouglasEmpire commented 2 years ago

@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! :)

djauregui76 commented 2 years ago

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

doresome commented 2 years ago

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 \

iambearman commented 1 year ago

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!

Mustaphabns commented 1 year ago

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

iambearman commented 1 year ago

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 ==========================
  3. 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"
  4. open another shell, and run command docker exec -it sybase bash to get inside the container
  5. inside container shell, run command cd /opt/sybase/ASE-16_0/install
  6. inside container shell, run command vi RUN_MYSYBASE
  7. 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>>>
  8. close the container shell
  9. open another shell and run command docker stop sybase to stop the Sybase container
  10. the first shell that has Sybase container running should now have exited the container
  11. run command docker start sybase to start Sybase container again
  12. wait for a good 5 minutes to let Sybase correctly setup
  13. use your tools/program to login with
    • username: tester
    • password: guest1234 or
    • username: sa
    • password: myPassword
  14. when you are done using the Sybase container, run command docker stop sybase to stop it
  15. 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.
Mustaphabns commented 1 year ago

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 commented 1 year ago

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

iambearman commented 1 year ago

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

iambearman commented 1 year ago

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

doresome commented 1 year ago

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 commented 1 year ago

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
Mustaphabns commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

doresome commented 1 year ago

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 /]#
tjlee commented 10 months ago

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

iambearman commented 10 months ago

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

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

tjlee commented 9 months ago

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...

jarlah commented 1 month ago

what if any of these images, for v16 and v15 is removed from docker hub? i was planning to use this in my own tests, but now i feel cold about it because a) old and outdated and never updated and b) we are just monkey patching start scripts to fix platform compability, not much more we can do?

jarlah commented 1 month ago

i mean it even looks like ifnazar doesnt even have a Dockerfile published