Author Topic: (ABAP) MSSQL connection blocked by Avast  (Read 3360 times)

0 Members and 1 Guest are viewing this topic.

Offline Max312

  • Newbie
  • *
  • Posts: 6
(ABAP) MSSQL connection blocked by Avast
« on: November 25, 2019, 01:02:04 PM »
Hello everybody,

First of all, sorry for my English - not native - it may includes mistakes.
If this topic is not in the right forum, please tell me (I couldn't find a better place?).


At work, I am using Avast Business Antivirus Pro (actual version: 19.7.2573 (build: 19.7.4674.542)).
I am also using Microsoft SQL Server Management Studio 18 (on Windows 10 64b) to connect on a local instance (let's say PCserialnumber\instancename) It worked from May to the beginning of November - could connect to my databases etc.

Recently, I couldn't connect to the instance, getting the error #258 (Server can't be found or not accessible).

When I disable Avast (all shields), it works fine. When I enable back all shields, it stops working. It also works when I disable the Avast firewall only.

I have this issue also for Network Sharing Center to access my own shared files (PCserialnumber\sharedfileblabla).

I have checked a lot of topics about MSSQL before finding out it was Avast having trouble… ticking some boxes, removing others… but instead of breaking Avast, I prefer to ask you for this specific request - and it can then later help other people who could encounter this issue.

Thank you, hope you can help me asap.
Best regards.

Offline Infratech Solutions

  • Avast Reseller
  • Super Poster
  • *
  • Posts: 1968
  • www.infratech.es
    • La web de Avast para España
Re: (ABAP) MSSQL connection blocked by Avast
« Reply #1 on: November 25, 2019, 01:21:56 PM »
Try to open the TCP 1433 port on the firewall.
La web de Avast antivirus para España: www.avast-antivirus.es.
Hazte distribuidor de Avast: https://www.infratech.es/avast/distribuir-avast.html.

Offline Max312

  • Newbie
  • *
  • Posts: 6
Re: (ABAP) MSSQL connection blocked by Avast
« Reply #2 on: November 25, 2019, 01:32:29 PM »
Hi @InfratechSolutions,
I have created the new port 1433 (Firewall > Packet Rules) with the following parameters:
- Name: TCP 1433 SQL Test
- Action: Allow
- Protocol: TCP(6) (I also tried TCP/UDP)
- Direction: In/Out
- Address: none (empty)
- Local port: 1433
- Remote port: 1433
- ICMP Type: none (empty)
- Profile: All

Same error occurs (#258).
Are the parameters OK?

Best regards

Edit: I have check SQL Configuration, this is the correct TCP/IP port (1433) for the instance
« Last Edit: November 25, 2019, 01:35:41 PM by Max312 »

Offline Infratech Solutions

  • Avast Reseller
  • Super Poster
  • *
  • Posts: 1968
  • www.infratech.es
    • La web de Avast para España
Re: (ABAP) MSSQL connection blocked by Avast
« Reply #3 on: November 25, 2019, 01:47:45 PM »
Put "Local Port" as "none (empty)". You only need to use the remote port.
La web de Avast antivirus para España: www.avast-antivirus.es.
Hazte distribuidor de Avast: https://www.infratech.es/avast/distribuir-avast.html.

Offline Max312

  • Newbie
  • *
  • Posts: 6
Re: (ABAP) MSSQL connection blocked by Avast
« Reply #4 on: November 25, 2019, 01:57:03 PM »
Hello again,
Removed the local port, with same other parameters, still not working :'(

Edit: the error is still #258 ; if I go to SQL Server Configuration Manager, and put "port 1433" for the alias of the instance, the error will be #1225 (same message I think)
« Last Edit: November 25, 2019, 02:02:27 PM by Max312 »

Offline Infratech Solutions

  • Avast Reseller
  • Super Poster
  • *
  • Posts: 1968
  • www.infratech.es
    • La web de Avast para España
Re: (ABAP) MSSQL connection blocked by Avast
« Reply #5 on: November 25, 2019, 01:59:14 PM »
How is the firewall configured: Public or Private?

Must be set on Private.
La web de Avast antivirus para España: www.avast-antivirus.es.
Hazte distribuidor de Avast: https://www.infratech.es/avast/distribuir-avast.html.

Offline Max312

  • Newbie
  • *
  • Posts: 6
Re: (ABAP) MSSQL connection blocked by Avast
« Reply #6 on: November 25, 2019, 02:07:12 PM »
The firewall is on public, but I can not switch it to private (nor the network (LAN)) -- I have found somewhere the "geek:area" thing in search option, unticking "Enable automatic profile switching", but it still doesn't give me the right to go from public to private (if I only need to click on the button [Private Network (……… ==>) Public Network] ?).

Offline Max312

  • Newbie
  • *
  • Posts: 6
Re: (ABAP) MSSQL connection blocked by Avast [Solved]
« Reply #7 on: November 25, 2019, 02:30:58 PM »
OK, problem solved!

After successfull test:
- I can stay on public server without any issue
- I can connect to sql and do basic requests


SOLVING ISSUE:
What I have done:
1) I have connected without Avast (removed the firewall) to my SQL Instance
2) Went to Management > Logs > Actual logs (not the real English names but you should find them), click on "FILTER", and searched for "listening"
3) Found some messages "Server is listening on ['any' <ipv4> 49883]" -- My port was 49883 instead of the standard 1433! (Dynamic port)
4) Closed the connection
5) Put back the firewall on Avast for the test
6) Added to Avast the port 49883 as below:
- Name: TCP 49883 SQL Test
- Action: Allow
- Protocol: TCP(6) (I also tried TCP/UDP)
- Direction: In/Out
- Address: none (empty)
- Local port: none (empty)
- Remote port: 49883
- ICMP Type: none (empty)
- Profile: All
7) And then I could connect to MSSQL !
<< End of the solution >>

I figured out that I can see the dynamic port in SQL Configuration Manager ==> SQL Server Network Configuration ==> "blabla for your instance" (In french : "Protocoles pour INSTANCENAME" ==> clicked on TCP/IP (activated) ==> IP Address ==> Bottom : Dynamic TCP Ports : 49883

Every other things I have done during this post, have been "removed", and it is still working fine for now.

Thanks for the infos Infratech Solutions !
Hope this can help other people.
Cheers


Edit: I will just do some other tests like restarting the computer, restarting the instance, etc. to check if the port change a lot or not
« Last Edit: November 25, 2019, 02:34:28 PM by Max312 »