Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Network access is disabled - What are my options?

Network access is disabled - What are my options?

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 5 Posters 3.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alvein
    wrote on 4 Feb 2020, 17:53 last edited by
    #1

    I've not found anything useful about this error. Some old threads seem to treat it as something random or just pure bad luck. Others may point to an old bug which was apparently fixed long time ago.

    The program I'm creating runs on my machine, but it's intended to be installed on a Windows Server 2019 PC. There, this problem appears.

    My code basically looks like this. This is a synchronous sample. The URL "www.showmyip.com" could be anything:

        QString         sContents;
        QNetworkRequest nrqRequest;
        QNetworkReply   *nrpReply;
        nrqRequest.setUrl(QUrl("https://www.showmyip.com/"));
        // namManager is defined in the constructor as "new QNetworkAccessManager(this)"
        nrpReply=namManager->get(nrqRequest);
        while(!nrpReply->isFinished())
            QApplication::processEvents(QEventLoop::ProcessEventsFlag::ExcludeUserInputEvents);
        if(nrpReply->error()==QNetworkReply::NetworkError::NoError)
            if(200==nrpReply->attribute(QNetworkRequest::Attribute::HttpStatusCodeAttribute).toInt()) {
                sContents=nrpReply->readAll();
                // ...
            }
            else
                QMessageBox::critical(this,"Response Error","Invalid response code");
        else
            QMessageBox::critical(this,"Connection Error",nrpReply->errorString());
        nrpReply->~QNetworkReply();
    

    Well, when this code runs in the server, it shows the "Connection Error" message box, with "Network access is disabled".

    I created an installer for this program, using windeployqt.

    I don't know what more to do to track the source of this problem.

    Any ideas?

    P 1 Reply Last reply 4 Feb 2020, 18:41
    0
    • A Alvein
      4 Feb 2020, 17:53

      I've not found anything useful about this error. Some old threads seem to treat it as something random or just pure bad luck. Others may point to an old bug which was apparently fixed long time ago.

      The program I'm creating runs on my machine, but it's intended to be installed on a Windows Server 2019 PC. There, this problem appears.

      My code basically looks like this. This is a synchronous sample. The URL "www.showmyip.com" could be anything:

          QString         sContents;
          QNetworkRequest nrqRequest;
          QNetworkReply   *nrpReply;
          nrqRequest.setUrl(QUrl("https://www.showmyip.com/"));
          // namManager is defined in the constructor as "new QNetworkAccessManager(this)"
          nrpReply=namManager->get(nrqRequest);
          while(!nrpReply->isFinished())
              QApplication::processEvents(QEventLoop::ProcessEventsFlag::ExcludeUserInputEvents);
          if(nrpReply->error()==QNetworkReply::NetworkError::NoError)
              if(200==nrpReply->attribute(QNetworkRequest::Attribute::HttpStatusCodeAttribute).toInt()) {
                  sContents=nrpReply->readAll();
                  // ...
              }
              else
                  QMessageBox::critical(this,"Response Error","Invalid response code");
          else
              QMessageBox::critical(this,"Connection Error",nrpReply->errorString());
          nrpReply->~QNetworkReply();
      

      Well, when this code runs in the server, it shows the "Connection Error" message box, with "Network access is disabled".

      I created an installer for this program, using windeployqt.

      I don't know what more to do to track the source of this problem.

      Any ideas?

      P Offline
      P Offline
      Pablo J. Rogina
      wrote on 4 Feb 2020, 18:41 last edited by
      #2

      @Alvein said in Network access is disabled - What are my options?:

      "Network access is disabled".

      Have you check that you actually has access (i.e. ping, traceroute, telnet, etc. may help) to the destination URL/IP from the PC you're deploying?

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      A 2 Replies Last reply 4 Feb 2020, 19:13
      1
      • P Pablo J. Rogina
        4 Feb 2020, 18:41

        @Alvein said in Network access is disabled - What are my options?:

        "Network access is disabled".

        Have you check that you actually has access (i.e. ping, traceroute, telnet, etc. may help) to the destination URL/IP from the PC you're deploying?

        A Offline
        A Offline
        Alvein
        wrote on 4 Feb 2020, 19:13 last edited by
        #3

        @Pablo-J-Rogina Well, the real URL gives the same error in the program. That's two failing URLs.

        I'll try and confirm anyway. It's my client the one who has to do those tests since I don't have access to that server.

        I couldn't grasp the fact that there's actually a connection problem in the server. I.e., how does it work with the rest of stuff it's supposed to do daily...

        I'll ask my client to try those tests and be back here.

        Thanks for your advice.

        1 Reply Last reply
        0
        • P Pablo J. Rogina
          4 Feb 2020, 18:41

          @Alvein said in Network access is disabled - What are my options?:

          "Network access is disabled".

          Have you check that you actually has access (i.e. ping, traceroute, telnet, etc. may help) to the destination URL/IP from the PC you're deploying?

          A Offline
          A Offline
          Alvein
          wrote on 5 Feb 2020, 18:36 last edited by
          #4

          @Pablo-J-Rogina Hello.

          Ping, tracert and telnet tests were successful.

          Now pay attention to this.

          My program has two ways of accessing the network. One, is like the sample code I posted before. And the other is by using QWebEngineView to actually browse some pages.

          • Currently, QWebEngineView browses with no problems, but QNetworkReply gets the "Network access is disabled" error.

          • On my development machine, If I disable the network by hand, I get the "Network access is disabled" error, AND QWebEngineView shows "No internet".

          • I checked, and there's no firewall-related problem involved. In fact, I tried to block the program on my machine and the error I get is distinct: "Permission denied". And that also blocks QWebEngineView.

          • I used a non-secure HTTP address to verify it's not something about SSL or port 443. Same problem.

          • Tried another sample app (simple HTTP get using sockets) that I made years ago, coded in Visual Basic. Worked flawlessly in the server.

          • Installed a virtual machine with Windows Server 2019 in my machine. Everything works with no problems there.

          • I've built the "HTTP Example" which comes with Qt (https://code.qt.io/cgit/qt/qtbase.git/tree/examples/network/http?h=5.14), and guess what...it fails with "Network access is disabled" as well.

          Remember: this server does have Internet access, it can ping, tracert, telnet, browse to the sample locations. It can even connect to those locations through a 3rd-party app coded in something different to Qt.

          Why is QNetworkReply failing on that computer? How can I figure out a reason? It's a mystery.
          Somebody help.

          1 Reply Last reply
          0
          • H Offline
            H Offline
            hskoglund
            wrote on 5 Feb 2020, 19:10 last edited by
            #5

            Hi, just guessing my perhaps something's screwed up with Qt's bearer management
            Perhaps try creating a QNetworkSession and check its configuration...

            A 1 Reply Last reply 5 Feb 2020, 19:41
            2
            • H hskoglund
              5 Feb 2020, 19:10

              Hi, just guessing my perhaps something's screwed up with Qt's bearer management
              Perhaps try creating a QNetworkSession and check its configuration...

              A Offline
              A Offline
              Alvein
              wrote on 5 Feb 2020, 19:41 last edited by
              #6

              @hskoglund Long read ahead. I don't know any of those concepts.

              I'll give it a look and be back. Thanks. :)

              H 1 Reply Last reply 5 Feb 2020, 19:59
              0
              • A Alvein
                5 Feb 2020, 19:41

                @hskoglund Long read ahead. I don't know any of those concepts.

                I'll give it a look and be back. Thanks. :)

                H Offline
                H Offline
                hskoglund
                wrote on 5 Feb 2020, 19:59 last edited by
                #7

                @Alvein Yeah, don't know so much either, but I've seen that topic "bearer management" coming up before.
                Also there's a plugin at C:\Qt..\plugins\bearer\qgenericbearer.dll. I've written/deployed several networking programs but never had to copy that .dll, but you might need to.

                A 1 Reply Last reply 5 Feb 2020, 20:41
                1
                • H hskoglund
                  5 Feb 2020, 19:59

                  @Alvein Yeah, don't know so much either, but I've seen that topic "bearer management" coming up before.
                  Also there's a plugin at C:\Qt..\plugins\bearer\qgenericbearer.dll. I've written/deployed several networking programs but never had to copy that .dll, but you might need to.

                  A Offline
                  A Offline
                  Alvein
                  wrote on 5 Feb 2020, 20:41 last edited by
                  #8

                  @hskoglund I have a client who's not exactly amused because of the amount of tests I've tried so far to locate the issue. He's already suggesting me to use anything but Qt.

                  I wish I could do all those tests myself...

                  I'll take your suggestions into consideration, if I have a chance.

                  H 1 Reply Last reply 5 Feb 2020, 20:51
                  0
                  • A Alvein
                    5 Feb 2020, 20:41

                    @hskoglund I have a client who's not exactly amused because of the amount of tests I've tried so far to locate the issue. He's already suggesting me to use anything but Qt.

                    I wish I could do all those tests myself...

                    I'll take your suggestions into consideration, if I have a chance.

                    H Offline
                    H Offline
                    hskoglund
                    wrote on 5 Feb 2020, 20:51 last edited by
                    #9

                    @Alvein One more suggestion: if there's some antivirus software installed on that server, try disabling it.

                    (As I said, I've deployed Qt network programs without problems (for example for automatic posting of appointment reminders SMS) to WIndows server 2003, 2012 and 2016. But not to Server 2019, but it shouldn't matter)

                    1 Reply Last reply
                    1
                    • C Offline
                      C Offline
                      Christian Andersson
                      wrote on 22 Apr 2020, 14:11 last edited by Christian Andersson
                      #10

                      Hi,
                      I get "Network access is disabled" when I have a static IP set on my computers (no DHCP) when I try to communicate using https and Qt 5.14
                      It works fine with Qt 5.11 in any case.
                      It works fine with Qt 5.14 if I use a DHCP-assigned IP-Addresses on my computers.

                      All computers runs 64bit Windows 10.

                      S 1 Reply Last reply 8 Jul 2020, 15:54
                      1
                      • C Christian Andersson
                        22 Apr 2020, 14:11

                        Hi,
                        I get "Network access is disabled" when I have a static IP set on my computers (no DHCP) when I try to communicate using https and Qt 5.14
                        It works fine with Qt 5.11 in any case.
                        It works fine with Qt 5.14 if I use a DHCP-assigned IP-Addresses on my computers.

                        All computers runs 64bit Windows 10.

                        S Offline
                        S Offline
                        SamH
                        wrote on 8 Jul 2020, 15:54 last edited by
                        #11

                        @Christian-Andersson Same here too, doesnt work in 5.14. Did anyone find a fix?

                        1 Reply Last reply
                        1
                        • A Offline
                          A Offline
                          Alvein
                          wrote on 8 Jul 2020, 17:16 last edited by
                          #12

                          Because of time constraints, my solution to this was using the cURL library.
                          I find the network support in Qt a little untrustworthy.

                          TBH, the target website had its own quirks. I had to use HTTP/1.0 for some calls. Go figure...

                          1 Reply Last reply
                          1

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved