none
SQL Server 2019 Linux - Issue with SQL Agent Startup RRS feed

  • Question

  • Hi All,

    Hoping someone can help me

    I followed the instructions on installing SQL 2019 on Linux here - > docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup?view=sql-server-ver15

    I have tried this on multiple distributions

    Redhat, AWS Linux 2, Ubuntu, etc

    The installation goes smoothly, and the SQL instance works fine however in every case i can't get the SQL Agent started properly.

    I have followed the instructions here to enable the agent, after doing

    sudo /opt/mssql/bin/mssql-conf set sqlagent.enabled true 
    sudo systemctl restart mssql-server

    The sqlagentstartup.log shows the following

    Microsoft (R) SQLServerAgent 15.0.1900.25
    Copyright (C) 2019 Microsoft Corporation. All rights reserved.
    
    SQL Agent was not able to connect to SQL Server instance [(local),1433]. Attempt 1 of 15. Will retry again in 1000ms.
    SQL Agent was not able to connect to SQL Server instance [(local),1433]. Attempt 2 of 15. Will retry again in 1000ms.
    SQL Agent was not able to connect to SQL Server instance [(local),1433]. Attempt 3 of 15. Will retry again in 1000ms.
    SQL Agent was not able to connect to SQL Server instance [(local),1433]. Attempt 4 of 15. Will retry again in 1000ms.
    SQL Agent was not able to connect to SQL Server instance [(local),1433]. Attempt 5 of 15. Will retry again in 1000ms.
    SQL Agent was not able to connect to SQL Server instance [(local),1433]. Attempt 6 of 15. Will retry again in 1000ms.
    SQL Agent was not able to connect to SQL Server instance [(local),1433]. Attempt 7 of 15. Will retry again in 1000ms.
    SQL Agent was not able to connect to SQL Server instance [(local),1433]. Attempt 8 of 15. Will retry again in 1000ms.
    SQL Agent was not able to connect to SQL Server instance [(local),1433]. Attempt 9 of 15. Will retry again in 1000ms.
    SQL Agent was not able to connect to SQL Server instance [(local),1433]. Attempt 10 of 15. Will retry again in 1000ms.
    SQL Agent was not able to connect to SQL Server instance [(local),1433]. Attempt 11 of 15. Will retry again in 1000ms.
    SQL Agent was not able to connect to SQL Server instance [(local),1433]. Attempt 12 of 15. Will retry again in 1000ms.
    SQL Agent was not able to connect to SQL Server instance [(local),1433]. Attempt 13 of 15. Will retry again in 1000ms.
    SQL Agent was not able to connect to SQL Server instance [(local),1433]. Attempt 14 of 15. Will retry again in 1000ms.
    SQLAgent is exiting

    This is the output of sqlagent.out

    2 0 1 9 - 1 1 - 1 0   1 4 : 0 7 : 4 7   -   ?   [ 5 0 8 ]   L o g g i n g   S Q L   S e r v e r   A g e n t   m e s s a   e s   i n   f i l e   ' / v a r / o p t / m s s q l / l o g / s q l a g e n t . o u t ' .
     2 0 1 9 - 1 1 - 1 0   1 4 : 0 7 : 4 7   -   ?   [ 1 0 1 ]   S Q L S e r v e r A g e n t   s e r v i c e   s u c c e s    u l l y   s t a r t e d
     2 0 1 9 - 1 1 - 1 0   1 4 : 0 7 : 4 7   -   ?   [ 3 5 0 ]   W a i t i n g   f o r   S Q L   S e r v e r   t o   s t a    . . .
     2 0 1 9 - 1 1 - 1 0   1 4 : 0 7 : 4 9   -   ?   [ 0 0 0 ]   E v e n t   G l o b a l \ s q l s e r v e r R e c C o m p    t e   o p e n e d
     2 0 1 9 - 1 1 - 1 0   1 4 : 0 7 : 4 9   -   ?   [ 5 0 0 ]   W a i t i n g   f o r   S Q L   S e r v e r   t o   r e c    e r   a l l   d a t a b a s e s . . .
     2 0 1 9 - 1 1 - 1 0   1 4 : 0 8 : 1 0   -   ?   [ 1 0 0 ]   M i c r o s o f t   S Q L S e r v e r A g e n t   v e r s    n   1 5 . 0 . 1 9 0 0 . 2 5   ( X 6 4   u n i c o d e   r e t a i l   b u i l d )   :   P r o c e s s   I D   2 8
     2 0 1 9 - 1 1 - 1 0   1 4 : 0 8 : 1 0   -   ?   [ 4 9 5 ]   T h e   S Q L   S e r v e r   A g e n t   s t a r t u p      r v i c e   a c c o u n t   i s   i p - 1 7 2 - 3 1 - 2 - 3 8 \ i p - 1 0 - 1 0 - 1 4 5 - 1 3 $ .
     2 0 1 9 - 1 1 - 1 0   1 4 : 0 8 : 1 0   -   ?   [ 1 5 1 ]   R u n n i n g   S Q L   S e r v e r   A g e n t   c r o s    p l a t f o r m
     2 0 1 9 - 1 1 - 1 0   1 4 : 0 8 : 4 0   -   !   [ 1 5 0 ]   S Q L   S e r v e r   d o e s   n o t   a c c e p t   t h    c o n n e c t i o n   ( e r r o r :   1 1 0 0 1 ) .   W a i t i n g   f o r   S q l   S e r v e r   t o   a l l o w   c o n n e c t i o n s .   O p e r a t i o n   a t t e m p t e d   w a s :   V e r i f y   C o n n e c t i o n   O n   S   a r t .
     2 0 1 9 - 1 1 - 1 0   1 4 : 0 9 : 1 1   -   !   [ 1 5 0 ]   S Q L   S e r v e r   d o e s   n o t   a c c e p t   t h    c o n n e c t i o n   ( e r r o r :   1 1 0 0 1 ) .   W a i t i n g   f o r   S q l   S e r v e r   t o   a l l o w   c o n n e c t i o n s .   O p e r a t i o n   a t t e m p t e d   w a s :   V e r i f y   C o n n e c t i o n   O n   S   a r t .
     2 0 1 9 - 1 1 - 1 0   1 4 : 0 9 : 4 2   -   !   [ 1 5 0 ]   S Q L   S e r v e r   d o e s   n o t   a c c e p t   t h    c o n n e c t i o n   ( e r r o r :   1 1 0 0 1 ) .   W a i t i n g   f o r   S q l   S e r v e r   t o   a l l o w   c o n n e c t i o n s .   O p e r a t i o n   a t t e m p t e d   w a s :   V e r i f y   C o n n e c t i o n   O n   S   a r t .
     2 0 1 9 - 1 1 - 1 0   1 4 : 1 0 : 1 3   -   !   [ 1 5 0 ]   S Q L   S e r v e r   d o e s   n o t   a c c e p t   t h    c o n n e c t i o n   ( e r r o r :   1 1 0 0 1 ) .   W a i t i n g   f o r   S q l   S e r v e r   t o   a l l o w   c o n n e c t i o n s .   O p e r a t i o n   a t t e m p t e d   w a s :   V e r i f y   C o n n e c t i o n   O n   S   a r t .
     2 0 1 9 - 1 1 - 1 0   1 4 : 1 0 : 4 4   -   !   [ 1 5 0 ]   S Q L   S e r v e r   d o e s   n o t   a c c e p t   t h    c o n n e c t i o n   ( e r r o r :   1 1 0 0 1 ) .   W a i t i n g   f o r   S q l   S e r v e r   t o   a l l o w   c o n n e c t i o n s .   O p e r a t i o n   a t t e m p t e d   w a s :   V e r i f y   C o n n e c t i o n   O n   S   a r t .
     2 0 1 9 - 1 1 - 1 0   1 4 : 1 1 : 1 5   -   !   [ 1 5 0 ]   S Q L   S e r v e r   d o e s   n o t   a c c e p t   t h    c o n n e c t i o n   ( e r r o r :   1 1 0 0 1 ) .   W a i t i n g   f o r   S q l   S e r v e r   t o   a l l o w   c o n n e c t i o n s .   O p e r a t i o n   a t t e m p t e d   w a s :   V e r i f y   C o n n e c t i o n   O n   S   a r t .
     2 0 1 9 - 1 1 - 1 0   1 4 : 1 1 : 4 6   -   !   [ 1 5 0 ]   S Q L   S e r v e r   d o e s   n o t   a c c e p t   t h    c o n n e c t i o n   ( e r r o r :   1 1 0 0 1 ) .   W a i t i n g   f o r   S q l   S e r v e r   t o   a l l o w   c o n n e c t i o n s .   O p e r a t i o n   a t t e m p t e d   w a s :   V e r i f y   C o n n e c t i o n   O n   S   a r t .
     2 0 1 9 - 1 1 - 1 0   1 4 : 1 2 : 1 7   -   !   [ 1 5 0 ]   S Q L   S e r v e r   d o e s   n o t   a c c e p t   t h    c o n n e c t i o n   ( e r r o r :   1 1 0 0 1 ) .   W a i t i n g   f o r   S q l   S e r v e r   t o   a l l o w   c o n n e c t i o n s .   O p e r a t i o n   a t t e m p t e d   w a s :   V e r i f y   C o n n e c t i o n   O n   S   a r t .
     2 0 1 9 - 1 1 - 1 0   1 4 : 1 2 : 4 8   -   !   [ 1 5 0 ]   S Q L   S e r v e r   d o e s   n o t   a c c e p t   t h    c o n n e c t i o n   ( e r r o r :   1 1 0 0 1 ) .   W a i t i n g   f o r   S q l   S e r v e r   t o   a l l o w   c o n n e c t i o n s .   O p e r a t i o n   a t t e m p t e d   w a s :   V e r i f y   C o n n e c t i o n   O n   S   a r t .
     2 0 1 9 - 1 1 - 1 0   1 4 : 1 3 : 1 9   -   !   [ 1 5 0 ]   S Q L   S e r v e r   d o e s   n o t   a c c e p t   t h    c o n n e c t i o n   ( e r r o r :   1 1 0 0 1 ) .   W a i t i n g   f o r   S q l   S e r v e r   t o   a l l o w   c o n n e c t i o n s .   O p e r a t i o n   a t t e m p t e d   w a s :   V e r i f y   C o n n e c t i o n   O n   S   a r t .
     2 0 1 9 - 1 1 - 1 0   1 4 : 1 3 : 5 0   -   !   [ 1 5 0 ]   S Q L   S e r v e r   d o e s   n o t   a c c e p t   t h    c o n n e c t i o n   ( e r r o r :   1 1 0 0 1 ) .   W a i t i n g   f o r   S q l   S e r v e r   t o   a l l o w   c o n n e c t i o n s .   O p e r a t i o n   a t t e m p t e d   w a s :   V e r i f y   C o n n e c t i o n   O n   S   a r t .
     2 0 1 9 - 1 1 - 1 0   1 4 : 1 4 : 2 1   -   !   [ 1 5 0 ]   S Q L   S e r v e r   d o e s   n o t   a c c e p t   t h    c o n n e c t i o n   ( e r r o r :   1 1 0 0 1 ) .   W a i t i n g   f o r   S q l   S e r v e r   t o   a l l o w   c o n n e c t i o n s .   O p e r a t i o n   a t t e m p t e d   w a s :   V e r i f y   C o n n e c t i o n   O n   S   a r t .
     2 0 1 9 - 1 1 - 1 0   1 4 : 1 4 : 5 2   -   !   [ 1 5 0 ]   S Q L   S e r v e r   d o e s   n o t   a c c e p t   t h    c o n n e c t i o n   ( e r r o r :   1 1 0 0 1 ) .   W a i t i n g   f o r   S q l   S e r v e r   t o   a l l o w   c o n n e c t i o n s .   O p e r a t i o n   a t t e m p t e d   w a s :   V e r i f y   C o n n e c t i o n   O n   S   a r t .
     2 0 1 9 - 1 1 - 1 0   1 4 : 1 5 : 2 3   -   !   [ 1 5 0 ]   S Q L   S e r v e r   d o e s   n o t   a c c e p t   t h    c o n n e c t i o n   ( e r r o r :   1 1 0 0 1 ) .   W a i t i n g   f o r   S q l   S e r v e r   t o   a l l o w   c o n n e c t i o n s .   O p e r a t i o n   a t t e m p t e d   w a s :   V e r i f y   C o n n e c t i o n   O n   S   a r t .
     2 0 1 9 - 1 1 - 1 0   1 4 : 1 5 : 5 4   -   !   [ 1 5 0 ]   S Q L   S e r v e r   d o e s   n o t   a c c e p t   t h    c o n n e c t i o n   ( e r r o r :   1 1 0 0 1 ) .   W a i t i n g   f o r   S q l   S e r v e r   t o   a l l o w   c o n n e c t i o n s .   O p e r a t i o n   a t t e m p t e d   w a s :   V e r i f y   C o n n e c t i o n   O n   S   a r t .
     2 0 1 9 - 1 1 - 1 0   1 4 : 1 5 : 5 4   -   !   [ 0 0 0 ]   U n a b l e   t o   c o n n e c t   t o   s e r v e r   '    o c a l ) , 1 4 3 3 ' ;   S Q L S e r v e r A g e n t   c a n n o t   s t a r t
     2 0 1 9 - 1 1 - 1 0   1 4 : 1 5 : 5 4   -   !   [ 1 0 3 ]   S Q L S e r v e r A g e n t   c o u l d   n o t   b e   s  a r t e d   ( r e a s o n :   U n a b l e   t o   c o n n e c t   t o   s e r v e r   ' ( l o c a l ) , 1 4 3 3 ' ;   S   L S e r v e r A g e n t   c a n n o t   s t a r t )
     2 0 1 9 - 1 1 - 1 0   1 4 : 1 5 : 5 9   -   !   [ 2 9 8 ]   S Q L S e r v e r   E r r o r :   1 1 0 0 1 ,   T C P   P    v i d e r :   N o   s u c h   h o s t   i s   k n o w n .   [ S Q L S T A T E   0 8 0 0 1 ]
     2 0 1 9 - 1 1 - 1 0   1 4 : 1 5 : 5 9   -   !   [ 1 6 5 ]   O D B C   E r r o r :   0 ,   L o g i n   t i m e o u t      p i r e d   [ S Q L S T A T E   H Y T 0 0 ]
     2 0 1 9 - 1 1 - 1 0   1 4 : 1 5 : 5 9   -   !   [ 2 9 8 ]   S Q L S e r v e r   E r r o r :   1 1 0 0 1 ,   A   n e t  o r k - r e l a t e d   o r   i n s t a n c e - s p e c i f i c   e r r o r   h a s   o c c u r r e d   w h i l e   e s t a b l i s h i n g   a   c o n n e c t i o n   t o   S Q L   S e r v e r .   S e r v e r   i s   n o t   f o u n d   o r   n o t   a c c e s s i b l e .   C h e c k   i f   i n s t a n c e   n a m e   i s   c o r r e c t   a n d   i f   S Q L   S e r v e r   i s   c o n f i g u r e d   t o   a l l o w   r e m o t e   c o n n e c t i o n s .   F o r   m o r     i n f o r m a t i o n   s e e   S Q L   S e r v e r   B o o k s   O n l i n e .   [ S Q L S T A T E   0 8 0 0 1 ]
     2 0 1 9 - 1 1 - 1 0   1 4 : 1 5 : 5 9   -   !   [ 3 8 2 ]   L o g o n   t o   s e r v e r   ' ( l o c a l ) , 1 4 3 3    f a i l e d   ( D i s a b l e A g e n t X P s )
     2 0 1 9 - 1 1 - 1 0   1 4 : 1 5 : 5 9   -   ?   [ 1 0 2 ]   S Q L S e r v e r A g e n t   s e r v i c e   s u c c e s    u l l y   s t o p p e d
     2 0 1 9 - 1 1 - 1 0   1 4 : 1 5 : 5 9   -   ?   [ 0 9 8 ]   S Q L S e r v e r A g e n t   t e r m i n a t e d   ( n o    a l l y )

    could anyone please help point me in the right direction here ? is there an issue with the hostname its trying to resolve as (local) ? Am i missing something obvious ?

    Cheers

    Niro


    • Edited by niro.am1 Monday, November 11, 2019 10:42 AM
    Monday, November 11, 2019 10:40 AM

All replies

  • Hi Niro,

    For some reason the sql server agent is not recognizing the sql server service. did you check the sql configurations using this command?

    cat /var/opt/mssql/mssql.conf

    Or also you can follow this link -> https://www.sqlshack.com/configure-sql-server-2017-linux-mssql-conf-available-tools/

    Also did you try reinstalling the agent -> https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-sql-agent?view=sql-server-ver15 ?

    regards!

    Monday, November 11, 2019 2:56 PM
  • Hi Niro,

    >>SQL Server Error:11001, A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible.  Check if instance name is correct and if SQL Server is configured to allow remote connections.

    Please make sure SQL Server browser is running if you have multiple instances running on the same server and make sure TCP/IP protocol is enabled.

    And please check network connectivity using the methods in the links below:

    https://www.dummies.com/computers/operating-systems/linux/checking-out-tcpip-networks-on-a-linux-system/

    Hope this could help you.

    Best Regards,

    Amelia Gu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, November 12, 2019 6:54 AM
  • Hi Gonzalo,

    the SQL configuration is pretty basic, just has the flag to enable the agent

    [sqlagent]
    enabled = true
    
    [EULA]
    accepteula = Y

    I cant see any config params documented that changes the behaviour of the agent connecting to the server ... 

    As far as i know you can't re install the agent anymore, the seperated package mentioned in the link above is for an older version of 2017 only ?


    Tuesday, November 12, 2019 9:41 AM

  • Hi Amelia,

    aprreciate you help, some questions 

    Please make sure SQL Server browser is running 
    Does linux have SQL Server browser ? I wasnt aware of being able to run it explicitely, if you could point me at the appropriate doco would be much appreciated

    make sure TCP/IP protocol is enabled.
    Again, is it possible to choose this in the Linux version of SQL Server ? I was assuming linux is always TCP/IP as named pipes wouldnt be aviaalble ? 

    please check network connectivity using the methods in the links below:
    as far as i know networking is fine, i can connect to the instance from both sqlcmd on the box it self and also using SSMS from a remote location

    What it looks like is the agent trying to connect to "(local)" as the host name which may not be resolving, is it possible to change this in the config somewhere ?

    Cheers
    Niro


    Tuesday, November 12, 2019 9:48 AM