MSSQL2019 for Linux, The SQLServerAgent is not currently running, so it cannot be notified of this action. error:22022

中杰 郭 101 Reputation points
2020-09-16T03:19:24.147+00:00

My database has been installed successfully, but my service agent has been reporting errors,

The service agent in my Windows database management tool is green, meaning it's on, but when I create the job, it reports an error and I've already run the command:

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

I found it in the official documents:

  1. Add the hostname (with and without domains) to the /etc/hosts file.The following lines show the format of these entries
    "IP Address" "hostname"
    "IP Address" "hostname.domain.com"

I don't understand this operation, so I skipped this step, is that the reason?

And,I've already used these SQL scripts:
EXEC sp_configure 'show advanced', 1;
RECONFIGURE;
EXEC sp_configure 'allow updates', 0;
RECONFIGURE;
EXEC sp_configure 'Agent XPs', 1;
RECONFIGURE;
GO

24999-16002330461.jpg

This is my first time to ask for help. Who can help me

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,639 questions
SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,790 questions
0 comments No comments
{count} votes

Accepted answer
  1. 中杰 郭 101 Reputation points
    2020-09-17T03:44:02.577+00:00

    Hi @AmeliaGu-MSFT

    I think I've found the source of this error because my server name is too long and the service agent hasn't captured it completely. After I changed /ect/homename then shutdown -r now, my agent log has changed.

    I don't know if adding {IP} {servername} to /ect/hosts will work, but I did, and after changing the servername and restarting the hosts, my agent is ready to use.

    If there is anything unclear, you can contact me at gzj950421@163.com

    My English is not very good, so I am not active in the forum, I see that you are a helpful person, I hope I can impart my experience to you, so that you can help with many people, you are a good man

    thanks,well,Wish you happy

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. AmeliaGu-MSFT 13,961 Reputation points Microsoft Vendor
    2020-09-16T07:29:33.977+00:00

    Hi @中杰 郭 ,

    To add your hostname in the /etc/hosts files, please refer to this article for more details.
    Then you can try to enable SQL Server Agent again.
    If this does not work, you can check SQLAGENT.OUT in the LOG directory to see if there are any error message.

    Best Regards,
    Amelia


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.