- Remove From My Forums
-
Question
-
In what circumstances do we get the below error. Shouldn’t it be a little more descriptive?
The statement has been terminated. [SQLSTATE 01000]
This is for an SQL SERVER 2005 SP2. I am running a rebuild index using a TSQL job. The rebuild runs fine for a while giving this error later.
Answers
-
-
Marked as answer by
HumayunM
Monday, December 28, 2009 9:49 AM -
Edited by
Kalman Toth
Friday, September 28, 2012 7:28 PM
-
Marked as answer by
All replies
-
This is a generic message as you have already figured out and should be preceeded by a more detailed error which should be displayed in the SQL Agent job history log. If you have a profiler trace from that time, an additional error should also be present.
This error message can also pop up when you have some inconsistencies in the database. Could you run a dbcc checktable on the table whose index you were rebuilding and ensure that there are no inconsistencies reported.
HTH
This posting is provided «AS IS» with no warranties, and confers no rights.
My Blog: Troubleshooting SQL -
The job history log is not complete either. The errorlog also doesn’t state anything
«. …contact your system administrator. [SQLSTATE 01000] (Message 2528) DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528) DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528) DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528) DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528) DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528) DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528) DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528) DBCC execu… The step failed.»And the good part is, when I ran the proc manually it ran fine. i.e. from sql management studio
Very perplexing behaviour
-
When you create a maintenance plan you have the option to logging the details.
Can you check your maintenance plan and take the logging path, go to that path and open the last executuion log file to get the error. Else go the maintenance plan and right click on the plan to view the history.
Vidhya Sagar. Mark as Answer if it helps!
-
Hi VidhyaSagar,
I am not using maintenance plan. I am using a TSQL proc.Thanks
-
Hi,
To troubleshoot the issue, could you provide us the error messages logged in the SQL Server error log files. By default, the error log is located at Program FilesMicrosoft SQL ServerMSSQL.nMSSQLLOGERRORLOG and ERRORLOG.n files.
If there are any more questions, please let me know.
Thanks and Merry Christmas.
***Xiao Min Tan***Microsoft Online Community***
-
You mention «job history log» so I infer that this is a scheduled job from SQL Agent.
If so, you can edit the Advanced Properties of the Job Step. There you will see options for retaining more log information. For instance, you can select «Log to table» which will log information from running the job into a table in msdb.
This may provide details missing from the logs that you are examining.
After the job runs, you can come back to the Advanced Properties tab and click the View button to see what details were recorded. Or you can select it out as:
SELECT j.Name, s.Step_Name, s.Step_id, l.log_size, RIGHT(l.log, 50000) AS recent_log
FROM msdb.dbo.sysjobs j JOIN msdb.dbo.sysjobsteps s
ON j.job_id = s.job_id
JOIN msdb.dbo.sysjobstepslogs l
ON s.step_uid = l.step_uidThe RIGHT(l.log, 50000) is just to limit the output, since if you use «Append output to existing entry…» this row can grow to two gigabytes.
RLF
-
Edited by
SQLWork
Friday, December 25, 2009 2:59 PM
Corrected last line
-
Edited by
-
Hi Russel,
I have done that part i.e select Advanced option and log to table and log to a file also. But the error is the same
like tail of the file is:
DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
The statement has been terminated. [SQLSTATE 01000]Hi Xiao-Min,
There is nothing of importance in errorlog.———-
But the thing is, I can run the rebuild index proc as a query but it is only giving this error from sql agent.Thanks all for contributing your valuable time.
-
-
Edited by
Kalman Toth
Friday, September 28, 2012 7:28 PM
-
Edited by
-
Hi Kalman,
I am not using print. I am writing below the code that is used as the TSQL PROC.
CREATE procedure [dbo].[Usp_osdeDBReIndex_2k5]
as
DECLARE @TableName varchar(255)DECLARE TableCursor CURSOR FOR
SELECT table_name FROM information_schema.tables
WHERE table_type = ‘base table’OPEN TableCursor
FETCH NEXT FROM TableCursor INTO @TableName
WHILE @@FETCH_STATUS = 0
BEGIN
DBCC DBREINDEX(@TableName,’ ‘,90)
FETCH NEXT FROM TableCursor INTO @TableName
ENDCLOSE TableCursor
DEALLOCATE TableCursor
-
I was able to recreate it in SQL Server 2008 using your modified sproc.
DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528)
As some of the links above stated, it can just be ignored.
You can also open a bug report at Connect:
https://connect.microsoft.com/SQLServer?wa=wsignin1.0Sproc:
CREATE procedure uspDBreindex as DECLARE @TableSchema varchar(127), @TableName varchar(255) DECLARE TableCursor CURSOR FOR SELECT table_schema,table_name FROM information_schema.tables WHERE table_type = 'base table' OPEN TableCursor FETCH NEXT FROM TableCursor INTO @TableSchema, @TableName WHILE @@FETCH_STATUS = 0 BEGIN SET @TableName=@TableSchema+'.'+@TableName DBCC DBREINDEX(@TableName,' ',90) FETCH NEXT FROM TableCursor INTO @TableSchema,@TableName END CLOSE TableCursor DEALLOCATE TableCursor GO
Kalman Toth SQL SERVER 2012 & BI TRAINING
New Book: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2012-
Edited by
Kalman Toth
Friday, September 28, 2012 7:29 PM
-
Edited by
-
Hi Kalman,
I can ignore it but the job fails and sends a notification. Isn’t there a way to avoid the failure of job?Thanks
-
70 and then I get «The statement has been terminated». Previously I was able to run the proc fine as a query at-least but now I am getting after 70 or so [SQLSTATE 01000] msg This error message «Msg 0, Level 11, State 0, Line 0 A severe error occurred on the current command. The results, if any, should be discarded.»
I found one KB article http://support.microsoft.com/kb/938102. It kind of qualifies. I am indeed on SP2.
But the errorlog doesn’t have anything2009-12-27 21:25:45.90 Server The time stamp counter of CPU on scheduler id 12 is not synchronized with other CPUs.
2009-12-27 21:33:46.00 Server The time stamp counter of CPU on scheduler id 2 is not synchronized with other CPUs.
2009-12-27 21:57:46.03 Server The time stamp counter of CPU on scheduler id 13 is not synchronized with other CPUs.
2009-12-27 22:05:46.04 Server The time stamp counter of CPU on scheduler id 14 is not synchronized with other CPUs.
2009-12-27 22:33:46.05 Server The time stamp counter of CPU on scheduler id 11 is not synchronized with other CPUs.
2009-12-27 22:41:46.05 Server The time stamp counter of CPU on scheduler id 12 is not synchronized with other CPUs.
2009-12-27 22:57:46.06 Server The time stamp counter of CPU on scheduler id 4 is not synchronized with other CPUs.
2009-12-27 23:09:46.06 Server The time stamp counter of CPU on scheduler id 14 is not synchronized with other CPUs.
2009-12-27 23:13:46.06 Server The time stamp counter of CPU on scheduler id 2 is not synchronized with other CPUs.
2009-12-27 23:29:46.07 Server The time stamp counter of CPU on scheduler id 13 is not synchronized with other CPUs.
2009-12-28 00:00:08.94 spid20s This instance of SQL Server has been using a process ID of 2824 since 12/10/2009 9:29:36 PM (local) 12/11/2009 2:29:36 AM (UTC). This is an informational message only; no user action is required.
2009-12-28 00:05:46.08 Server The time stamp counter of CPU on scheduler id 4 is not synchronized with other CPUs.
2009-12-28 00:09:46.08 Server The time stamp counter of CPU on scheduler id 12 is not synchronized with other CPUs.
2009-12-28 00:21:46.09 Server The time stamp counter of CPU on scheduler id 2 is not synchronized with other CPUs.
2009-12-28 00:49:46.10 Server The time stamp counter of CPU on scheduler id 13 is not synchronized with other CPUs.
2009-12-28 01:13:46.11 Server The time stamp counter of CPU on scheduler id 4 is not synchronized with other CPUs.
2009-12-28 01:17:46.11 Server The time stamp counter of CPU on scheduler id 14 is not synchronized with other CPUs.
2009-12-28 01:29:46.11 Server The time stamp counter of CPU on scheduler id 12 is not synchronized with other CPUs.
2009-12-28 01:41:46.12 Server The time stamp counter of CPU on scheduler id 2 is not synchronized with other CPUs.
2009-12-28 01:53:46.12 Server The time stamp counter of CPU on scheduler id 13 is not synchronized with other CPUs.
2009-12-28 02:41:46.14 Server The time stamp counter of CPU on scheduler id 4 is not synchronized with other CPUs.So I am not sure if this is the bug I am hitting for this rebuild index job. How to find out?
-
I get the below error.
————————————-
The statement has been terminated.
Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded. -
-
Marked as answer by
HumayunM
Monday, December 28, 2009 9:49 AM -
Edited by
Kalman Toth
Friday, September 28, 2012 7:28 PM
-
Marked as answer by
-
Thanks Kalman. I will work on that.
I’m trying to connect my access front-end to the SQL Server backend.
It was working when SQL Server was on my computer but now i’m trying to connect to a server
So when I create the DSN file with access
- I chose SQL-Server driver ( I have also tried with SQL-Server native 10.0 )
- I enter the server name that I copied from SQL Management Studio so there’s no typo there
- I chose the NT authentication
Then I have this error
In the properties, I tried with TCP/IP
with the default port 1433 and I also tried with the name pipes
I made sure that the checkbox to allow remote connection is checked
If I try to connect with management studio I got this error
I can see the server when I browse on the network
I’m trying this troubleshotting but i’m stuck with the telnet command. It says Could not open connection to host on 1433
I also tried with no port and i got the same error on port 23
Any ideas?
Thank you
asked Nov 21, 2012 at 20:24
MarcMarc
16.1k20 gold badges73 silver badges118 bronze badges
5
To create a new Data source to SQL Server, do the following steps:
-
In host computer/server go to Sql server management studio —> open Security Section on left hand —> right click on Login, select New Login and then create a new account for your database which you want to connect to.
-
Check the TCP/IP Protocol is Enable. go to All programs —> Microsoft SQL server 2008 —> Configuration Tools —> open Sql server configuration manager. On the left hand select client protocols (based on your operating system 32/64 bit). On the right hand, check TCP/IP Protocol be Enabled.
-
In Remote computer/server, open Data source administrator. Control panel —> Administrative tools —> Data sources (ODBC).
-
In User DSN or System DSN , click Add button and select Sql Server driver and then press Finish.
-
Enter Name.
-
Enter Server, note that: if you want to enter host computer address, you should enter that`s IP address without «\». eg. 192.168.1.5 and press Next.
-
Select With SQL Server authentication using a login ID and password entered by the user.
-
At the bellow enter your login ID and password which you created on first step. and then click Next.
-
If shown Database is your database, click Next and then Finish.
answered May 25, 2016 at 7:45
VahidVahid
912 silver badges3 bronze badges
- Windows firewall blocks the sql server. Even if you open the 1433 port from exceptions, in the client machine it sets the connection point to dynamic port. Add also the sql server to the exceptions.
«C:Program FilesMicrosoft SQL ServerMSSQL11.MSSQLSERVERMSSQLBinnSqlservr.exe»
More info
- This page helped me to solve the problem. Especially
or if you feel brave, locate the alias in the registry and delete it
there.HKEY_LOCAL_MACHINESOFTWAREMicrosoftMSSQLServerClientConnectTo
answered Jul 8, 2017 at 8:05
HysenHysen
113 bronze badges
I had the same error which was coming and dont need to worry about this error, just restart the server and restart the SQL services. This issue comes when there is low disk space issue and system will go into hung state and then the sql services will stop automatically.
answered Jun 26, 2014 at 6:56
Received SQLSTATE 01000 in the following error message below:
SQL Agent — Jobs Failed: The SQL Agent Job «LiteSpeed Backup Full» has failed with the message «The job failed. The Job was invoked by User X. The last step to run was step 1 (Step1). NOTE: Failed to notify via email. — Executed as user: X. LiteSpeed(R) for SQL Server Version 6.5.0.1460 Copyright 2011 Quest Software, Inc. [SQLSTATE 01000] (Message 1) LiteSpeed for SQL Server could not open backup file: (N:BACKUP2filename.BAK). The previous system message is the reason for the failure. [SQLSTATE 42000] (Error 60405). The step failed.»
In my case this was related to permission on drive N following an SQL Server failover on an Active/Passive SQL cluster.
All SQL resources where failed over to the seconary resouce and back to the preferred node following maintenance. When the Quest LiteSpeed job then executed on the preferred node it was clear the previous permissions for SQL server user X had been lost on drive N and SQLSTATE 10100 was reported.
Simply added the permissions again to the backup destination drive and the issue was resolved.
Hope that helps someone.
Windows 2008 Enterprise
SQL Server 2008 Active/Passive cluster.
answered May 26, 2015 at 7:41
scott_lotusscott_lotus
3,15322 gold badges51 silver badges69 bronze badges
If the server name and credentials are correct, maybe you were using the wrong driver?…
In my case I used the wrong odbcad32.exe
to connect to a MySQL server via a 32-bit driver. The confusing thing is, that the 64-bit odbcad32.exe
shows other 32-bit MySQL datasources. After I clicked ‘Add’, two SQL driver entries showed up (I have two MySQL driver versions installed) and it took me a minute to realize that these are just preinstalled MS SQL drivers after it returned the error in the question.
If you need a 32-bit ODBC connection, make sure to use C:windowsSysWoW64odbcad32.exe
— another everlasting source of confusion, if you don’t know that on a 64-bit Windows the 32-bit binaries are located in SysWoW64 and the 64-bit ones are in System32.
After the ODBC Administration Tool is no longer available from the Computer Management GUI in Windows 10/11, I suspect that this problem might have become more common in recent years, when people fall for the 64-bit version, using Windows key + ‘R’ and just type odbcad32.exe
even if they want to establish a 32-bit driver connection for a legacy ODBC-using application.
hello, today I bring this new error, produced on a server with SO Debian 9.2 php7.1 in the function of connections to SQL SERVER on WINDOWS USING THE BOOKSTORES
«extension = sqlsrv.so» >> /etc/php/7.1/apache2/php.ini
, but at the beginning the connection to the sql server I receive the following error:
Error information:
SQLSTATE: 01000
Código: 0
Mensaje: [unixODBC] [Driver Manager] No se puede abrir lib ‘Controlador ODBC 13 para SQL Server’: archivo no encontrado
mauricio0015
changed the title
SQLSTATE: 01000 Código: 0 Mensaje: [unixODBC] [Driver Manager] No se puede abrir lib ‘Controlador ODBC 13 para SQL Server’: archivo no encontrado
Error information: SQLSTATE: 01000 Code: 0 Message: [unixODBC][Driver Manager]Can’t open lib ‘ODBC Driver 13 for SQL Server’ : file not found
Jan 27, 2018
hi @mauricio0015,
Looks like the ODBC driver was not installed properly. The error message is from the Driver Manager, complaining that it can’t find the ODBC driver. Can you please check your odbc.ini and odbcinst.ini to make sure the ODBC driver entries are there? You should see the path of the ODBC driver in odbcinst.ini. Please make sure the path is valid and then verify your connection using isql first before attempting to connect with PHP. If isql succeeds and you’re still having connection issues, please list the entries you have in your config files and we can debug further. Thanks.
I got same problem
I use mssql on ubuntu 16.04
I removed package mssql-tools
and not can’t install
I got error
mssql-tools : Depends: msodbcsql (< 13.2.0.0) but 17.0.1.1-1 is to be installed
also php cant connect to mssql
@nicdnepr your problem looks completely different than the one above. Are you trying to install mssql-tools? If you are using msodbcsql 17 preview then you will need to manually install the mssql-tools 17 preview which is also available in the preview folder
If you have further problems with this can you please open a new issue so we can look into this further and not hijack this one.
Thanks..
To me, odbcinst.ini has the following:
[ODBC Driver 17 for SQL Server]
Description=Microsoft ODBC Driver 17 for SQL Server
Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-17.0.so.1.1
UsageCount=1
But I’m getting exactly the same issue on openSUSE, running PHP CLI commands.
@neoacevedo Could you provide a repro script and the output you are getting?
good, I am just using yii migrate with the following configuration:
'db' => [
'class' => 'yiidbConnection',
'dsn' => "sqlsrv:Server=external-or-local-server,1433;Database=mydatabase",
'username' => 'SA',
'password' => 'the-password',
'charset' => 'utf8',
'enableQueryCache' => false
],
On Server I use localhost with exactly the same results as if it were Amazon or Azure RDS.
The output is just like
$ php yii migrate
PHP Fatal error: Uncaught PDOException: SQLSTATE[01000]: [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 13 for SQL Server' : file not found in /home/nestor/public_html/myproject/vendor/yiisoft/yii2/db/Connection.php:660
Although in local I can’t connect via sqlcmd, on remote I can do it without problems.
@neoacevedo The latest version of the pdo_sqlsrv driver defaults to ODBC driver 17, so if you are seeing an error message saying that ‘ODBC Driver 13 for SQL Server’ is not found, you are probably using an older version of the pdo_sqlsrv driver. Please try the latest preview by running pecl install pdo_sqlsrv-5.2.0RC1
or getting the binary from the release page and let us know if the problem is fixed. Thanks!
Following this comment I uninstalled the latest pdo_sqlsrv and sqlsrv drivers and installed the 5.2.0RC1 and now the error changes to SSL Provider: [error:140A90A1:SSL routines:SSL_CTX_new:library has no ciphers]’ so I will check for any issue related to this.
Hi, I’ve been having the same problems on this using Leap 42.3. In my case I reverted back to to the previous versions of the driver and tools in zypper. ie msodbcsql.13.1.9.2-1 and mssql-tools.14.0.6.0-1 and that at least allows me to keep working. In the meantime, I’ve disabled the ms repo so that I don’t get any further updates.
I had this issue too, as the file libmsodbcsql did exist, I looked at its dependencies
root@Mespilus:/opt/microsoft/msodbcsql/lib64# readelf -d libmsodbcsql-13.1.so.9.2 | grep NEEDED
0x0000000000000001 (NEEDED) Shared library: [libdl.so.2]
0x0000000000000001 (NEEDED) Shared library: [libodbcinst.so.2]
0x0000000000000001 (NEEDED) Shared library: [libcrypto.so.1.0.0]
0x0000000000000001 (NEEDED) Shared library: [libkrb5.so.3]
0x0000000000000001 (NEEDED) Shared library: [libgssapi_krb5.so.2]
0x0000000000000001 (NEEDED) Shared library: [libcurl.so.4]
0x0000000000000001 (NEEDED) Shared library: [libssl.so.1.0.0]
0x0000000000000001 (NEEDED) Shared library: [libuuid.so.1]
0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]
0x0000000000000001 (NEEDED) Shared library: [libm.so.6]
0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x0000000000000001 (NEEDED) Shared library: [libpthread.so.0]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
And checking if each library was present on the system. This one was missing
0x0000000000000001 (NEEDED) Shared library: [libssl.so.1.0.0]
The package build by microsoft doesn’t seem to reference/require/install the proper libssl.
It references libssl1.0.0 while debian 9 seems to have >1.0.0 installed.
Installing libssl1.0.0 from debian jessie fixed it. for me
@AnnoyingTechnology Where could I find the libssl.so.1.0.0 for Ubuntu?
I installed it via wget and dpkg. Is there a better way of doing this?
Many thanks for the fix!
I leave this scripts that worked for me.
My problem was pretty similar yours and I tested all the options such as changing the driver location, making a symbolic link, modify /etc/*.ini files, etc… nothing worked.
My problem, running python 3.6, pyodbc package in a docker container from alpine was the library libssl1.0.0
Here you will find my installation script for pyodbc Debian 8 (alpine) docker image using the driver v13
DRIVER={ODBC Driver 13 for SQL Server}
The command I run for database connection was:
import pyodbc
connection_string = 'DRIVER={ODBC Driver 13 for SQL Server};'
connection_string += 'SERVER={0};DATABASE={1};UID={2};PWD={3};'.format(host,dbname,user,pwd)
connection = pyodbc.connect(connection_string)
Hello, I have the same issue running a Debian 8 docker container with PHP7.2 and Nginx. I’ve installed the MSSQL ODBC 13.1 drivers but I still get the
SQLSTATE [01000, 0]: [unixODBC][Driver Manager]Can't open lib '/opt/microsoft/msodbcsql/lib64/libmsodbcsql-13.1.so.9.2' : file not found
As others have suggested, I ran readelf -d libmsodbcsql-13.1.so.9.2 | grep NEEDED
and then ldconfig -p | grep libraryname
for each of the libraries, but to my surprise, all the needed libraries are available.
My odbcinst.ini contains the right path for the libmsodbcsql file, which also has the right permissions.
My Dockerfile looks like:
FROM php:fpm
RUN apt-get update
&& apt-get install -y --no-install-recommends vim curl libssl libc6 debconf subversion git apt-transport-https apt-utils
build-essential locales acl mailutils wget zip unzip
gnupg gnupg1 gnupg2
ENV ACCEPT_EULA=Y
# Microsoft SQL Server Prerequisites
RUN apt-get update
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
&& curl https://packages.microsoft.com/config/debian/8/prod.list
> /etc/apt/sources.list.d/mssql-release.list
&& apt-get install -y --no-install-recommends
locales
apt-transport-https
&& echo "en_GB.UTF-8 UTF-8" > /etc/locale.gen
&& locale-gen
&& apt-get update
&& apt-get -y --no-install-recommends install
msodbcsql
unixodbc-dev
RUN docker-php-ext-install mbstring pdo pdo_mysql
&& pecl install sqlsrv pdo_sqlsrv xdebug
&& docker-php-ext-enable sqlsrv pdo_sqlsrv xdebug
COPY php.ini /etc/php/latest/php.ini
COPY php-fpm-pool.conf /etc/php/latest/pool.d/www.conf
RUN curl -sSk https://getcomposer.org/installer | php -- --disable-tls &&
mv composer.phar /usr/local/bin/composer
RUN groupadd dev -g 999
RUN useradd dev -g dev -d /home/dev -m
RUN rm -rf /var/lib/apt/lists/*
WORKDIR /var/www/symfony
EXPOSE 9000
CMD ["php-fpm"]
What could be the problem if the libraries exist and the path is correct?
Hey!
Did you try this line?
RUN DEBIAN_FRONTEND=noninteractive apt-get install libssl1.0.0
I think this a key problem when installing MSSql Drivers
Take a look and let me know, please
@J4VMC Anywhere after apt-get update? Just add it to after your RUN command for MSQL:
# Microsoft SQL Server Prerequisites
…
RUN DEBIAN_FRONTEND=noninteractive apt-get install libssl1.0.0
@nenetto this is what I get when I run docker-compose up -d
:
E: Package 'libssl1.0.0' has no installation candidate
And my Dockerfile looks like:
FROM php:fpm
RUN apt-get update
&& apt-get install -y --no-install-recommends vim curl libc6 debconf subversion git apt-transport-https apt-utils
build-essential locales acl mailutils wget zip unzip
gnupg gnupg1 gnupg2
ENV ACCEPT_EULA=Y
# Microsoft SQL Server Prerequisites
RUN apt-get update
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
&& curl https://packages.microsoft.com/config/debian/8/prod.list
> /etc/apt/sources.list.d/mssql-release.list
&& apt-get install -y --no-install-recommends
locales
apt-transport-https
&& echo "en_GB.UTF-8 UTF-8" > /etc/locale.gen
&& locale-gen
&& apt-get update
&& apt-get -y --no-install-recommends install
msodbcsql
unixodbc-dev
RUN DEBIAN_FRONTEND=noninteractive apt-get install libssl1.0.0
RUN docker-php-ext-install mbstring pdo pdo_mysql
&& pecl install sqlsrv pdo_sqlsrv xdebug
&& docker-php-ext-enable sqlsrv pdo_sqlsrv xdebug
COPY php.ini /etc/php/latest/php.ini
COPY php-fpm-pool.conf /etc/php/latest/pool.d/www.conf
RUN curl -sSk https://getcomposer.org/installer | php -- --disable-tls &&
mv composer.phar /usr/local/bin/composer
RUN groupadd dev -g 999
RUN useradd dev -g dev -d /home/dev -m
RUN rm -rf /var/lib/apt/lists/*
WORKDIR /var/www/symfony
EXPOSE 9000
CMD ["php-fpm"]
@J4VMC ,
I check your docker image and you built it from php:fpm
link here. This image is built from debian:stretch-slim
link here.
This means that your image is debian based on the version 9.4
link here.
In summary, you should install following the instructions for Debian 9. However, you are installing drivers for debian 8
curl https://packages.microsoft.com/config/debian/8/prod.list
-> From your Dockerfile.
So, my suggestion is the following Dockerfile for your problem
FROM php:fpm
RUN apt-get update
&& apt-get install -y --no-install-recommends vim curl libssl libc6 debconf subversion git apt-transport-https apt-utils
build-essential locales acl mailutils wget zip unzip
gnupg gnupg1 gnupg2
ENV ACCEPT_EULA=Y
# Microsoft SQL Server Prerequisites
RUN apt-get update
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
&& curl https://packages.microsoft.com/config/debian/9/prod.list
> /etc/apt/sources.list.d/mssql-release.list
&& apt-get install -y --no-install-recommends
locales
apt-transport-https
&& echo "en_GB.UTF-8 UTF-8" > /etc/locale.gen
&& locale-gen
&& apt-get update
&& apt-get -y --no-install-recommends install
msodbcsql
unixodbc-dev
RUN echo "deb http://security.debian.org/debian-security jessie/updates main" >> /etc/apt/sources.list && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install libssl1.0.0
RUN docker-php-ext-install mbstring pdo pdo_mysql
&& pecl install sqlsrv pdo_sqlsrv xdebug
&& docker-php-ext-enable sqlsrv pdo_sqlsrv xdebug
COPY php.ini /etc/php/latest/php.ini
COPY php-fpm-pool.conf /etc/php/latest/pool.d/www.conf
RUN curl -sSk https://getcomposer.org/installer | php -- --disable-tls &&
mv composer.phar /usr/local/bin/composer
RUN groupadd dev -g 999
RUN useradd dev -g dev -d /home/dev -m
RUN rm -rf /var/lib/apt/lists/*
WORKDIR /var/www/symfony
EXPOSE 9000
CMD ["php-fpm"]
@nenetto what php-fpm image can I use that is based on Debian 8? I think that will help with the issue.
I have no idea right now, take a look at dockerhub — php.
Anyway, in my last response I changed the debian repositories already. Test that image first and cross the fingers.
@nenetto still throws the E: Unable to locate package libssl
error. I’ll try and build a custom image based on Ubuntu 16.04. Thanks for your help
@sprankle the name change applies to ODBC 17+
For those who want ODBC 13.1 the name remains the same
Aug
01
2019
We are running Windows SQL Server 2016 Enterprise on Windows Server 2016. The server has an instance with databases in Always On High Availability group. People connect to the instance mostly from MS Access and MS Excel applications and from time to time they experience the following error:
—————————
Microsoft SQL Server Login
—————————
Connection failed:
SQLState: ‘01000’
SQL Server Error: 67
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()).
Connection failed:
SQLState: ‘08001’
SQL Server Error: 17
[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.
There can be a few reasons that cause this error. If you connect SQL Server from MS Office applications and you databases are in Always On availability group:
Make sure you use “MSOLEDBSQL.1” or “ODBC Driver 13 for SQL Server” driver instead of “SQL Server” driver
Instead of connection string like “DRIVER=SQL Server;SERVER=AlwaysOn Availability Group NameInstance Name;UID=User;PWD=Password;APP=Microsoft Office 2016;WSID=Host;DATABASE=DBName;”
you should have the string like
“DRIVER=ODBC Driver 13 for SQL Server;SERVER=AlwaysOn Availability Group NameInstance Name;UID=User;PWD=Password;APP=Microsoft Office 2016;DATABASE=DBName;TrustServerCertificate=Yes;MultiSubnetFailover=Yes”
or
“Provider=MSOLEDBSQL.1;Password=Password;Persist Security Info=True;User ID=User;Initial Catalog=DBName;Data Source=AlwaysOn Availability Group NameInstance Name;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=Host;Initial File Name=””;Use Encryption for Data=False;Tag with column collation when possible=False;MARS Connection=False;DataTypeCompatibility=0;Trust Server Certificate=False;Application Intent=READWRITE;MultisubnetFailover=True;Use FMTONLY=False”
In this case the error SQL Server does not exist or access denied occurs because “SQL Server” driver cannot work properly with Always On groups. When connection to an instance is initiated AlwaysOn group’s FQDN is resolved to IP addresses of each instance and the driver picks random IP address. If IP of passive instance was chosen then we get the error.
Make sure TCP/IP protocol on SQL server is turned on and SQL Server Browser service on SQL server is running
To assign a TCP/IP port number to the SQL Server Database Engine
- In SQL Server Configuration Manager, in the console pane, expand SQL Server Network Configuration, expand Protocols for <instance name>, and then double-click TCP/IP.
- In the TCP/IP Properties dialog box, on the IP Addresses tab, several IP addresses appear in the format IP1, IP2, up to IPAll. One of these is for the IP address of the loopback adapter, 127.0.0.1. Additional IP addresses appear for each IP Address on the computer. (You will probably see both IP version 4 and IP version 6 addresses.) Right-click each address, and then click Properties to identify the IP address that you want to configure.
- If the TCP Dynamic Ports dialog box contains 0, indicating the Database Engine is listening on dynamic ports, delete the 0.
- In the IPn Properties area box, in the TCP Port box, type the port number you want this IP address to listen on, and then click OK. Multiple ports may be specified by separating them with a comma.
Note
If the Listen All setting on the Protocol tab is set to “Yes”, then only TCP Port and TCP Dynamic Port values under the IPAll section will be used and individual IPn sections will be ignored in their entirety. If the Listen All setting is set to “No”, then the TCP Port and TCP Dynamic Port settings under the IPAll section will be ignored and the TCP Port, TCP Dynamic Port, and Enabled settings on the individual IPn sections will be used instead. Each IPn section has an Enabled setting with a default value of “No” which causes SQL Server to ignore this IP address even if it has a port defined.
- In the console pane, click SQL Server Services.
- In the details pane, right-click SQL Server (<instance name>) and then click Restart, to stop and restart SQL Server.
Connecting
After you have configured SQL Server to listen on a specific port, there are three ways to connect to a specific port with a client application:
- Run the SQL Server Browser service on the server to connect to the Database Engine instance by name.
- Create an alias on the client, specifying the port number.
- Program the client to connect using a custom connection string.
Make sure firewall on SQL Server allows incoming connections
Try to ping the instance from a client computer. Open firewall settings on SQL Server and make sure incoming connections to instance’s TCP port (see above) are allowed.
Want me to do this for you? Drop me a line: itgalaxyzzz {at} gmail [dot] com