Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Maintenance tool error: "Cannot open file "" for writing: No error"

Maintenance tool error: "Cannot open file "" for writing: No error"

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
39 Posts 9 Posters 7.2k 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.
  • M Offline
    M Offline
    mcleary
    wrote on 9 Feb 2020, 20:13 last edited by
    #1

    I am trying to install Qt on my machine but the installer keeps showing this message. What can I do to check if there is something wrong with my system?

    K R 2 Replies Last reply 10 Feb 2020, 09:13
    0
    • M Offline
      M Offline
      mcleary
      wrote on 18 Feb 2020, 00:39 last edited by mcleary
      #32

      So a little explanation of what the h.. was happening

      After my last post, I realised that the Qt Installer wasn't generating a new temporary file resulting in name conflicts as I reported in one earlier post.

      This leads me to take a look into QTemporaryFile implementation since I was pretty sure that the installer was using this class to generate new temporary files.

      Looking into the source code for QTemporaryFile I found the loop where the random string was being generated. QTemporaryFile can generate unique file names based on a name template defined with X's in a string.

      I adapted that piece of code to print the generated name:

      int main(int argc, char *argv[])
      {
          // qsrand(uint(std::time(0)));
          QString s(6);
          s.resize(6);
          for(int i = 0; i < 6; ++i)
          {
              char ch = char((rand() & 0xffff) % (26 + 26));
              if (ch < 26)
                  s[i] = Latin1Char(ch + 'A');
              else
                  s[i] = Latin1Char(ch - 26 + 'a');
          }
          qDebug() << s;
      
          return 0;
      }
      

      Note that the call to srand() is commented out. Running this program will produce the exact same result each time since the seed wasn't initialised properly. But that is expected. What is not expected was the following message being printed when running my simple program:

      WARNING: CPU random generator seem to be failing, disable hardware random number generation
      WARNING: RDRND generated: 0xffffffff 0xffffffff 0xffffffff 0xffffffff

      It turns out that I have an AMD Ryzen CPU, and this warning was being emitted because of a faulty BIOS, as reported in this forum.

      So I updated my BIOS to the latest version and voila, the warning is gone and the installer works again.

      The reason I couldn't get it working on my second machine was because I was using a virtual machine in the same CPU. The laptop is an Intel Core CPU.

      I never thought I would see a BIOS update fix some apparently unrelated program. It was a fun investigation. I would like to say thanks to @hskoglund for the patience and all the tips.

      Solution:

      If you have an AMD Ryzen CPU, update the BIOS.

      K 1 Reply Last reply 18 Feb 2020, 09:34
      6
      • M mcleary
        9 Feb 2020, 20:13

        I am trying to install Qt on my machine but the installer keeps showing this message. What can I do to check if there is something wrong with my system?

        K Offline
        K Offline
        koahnig
        wrote on 10 Feb 2020, 09:13 last edited by
        #2

        @mcleary

        What is the OS?

        When does the error occur? Immediately at startup or later?
        Is that a fresh install or are you updating an existing install?

        Vote the answer(s) that helped you to solve your issue(s)

        M 1 Reply Last reply 10 Feb 2020, 16:51
        1
        • K koahnig
          10 Feb 2020, 09:13

          @mcleary

          What is the OS?

          When does the error occur? Immediately at startup or later?
          Is that a fresh install or are you updating an existing install?

          M Offline
          M Offline
          mcleary
          wrote on 10 Feb 2020, 16:51 last edited by
          #3

          @koahnig I am running Windows 10. The error occur with when I was trying to update my Qt installation. I then tried to run the installer again but it also fails with the same error after downloading the repositories.

          K 1 Reply Last reply 10 Feb 2020, 17:03
          0
          • M mcleary
            10 Feb 2020, 16:51

            @koahnig I am running Windows 10. The error occur with when I was trying to update my Qt installation. I then tried to run the installer again but it also fails with the same error after downloading the repositories.

            K Offline
            K Offline
            koahnig
            wrote on 10 Feb 2020, 17:03 last edited by
            #4

            @mcleary

            Possibly your installation with the book-keeping is messed up.
            A radical measure would be a complete reinstall. At least that is all popping up in my mind.

            Typically I am bit reluctant to throw away my installs since there is a chain of things to do to get back to work. So maybe you wait if you can afford. Possibly someone else has a better idea.

            Vote the answer(s) that helped you to solve your issue(s)

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

              Hi, check your TEMP and TMP environment variables, if they point to non-existing directories on your PC, then Maintenance Tool gives this error.

              If that's the case also for you: one quick solution:

              set temp=
              set tmp=
              c:\qt\maintenancetool.exe
              
              M 2 Replies Last reply 11 Feb 2020, 10:12
              3
              • H hskoglund
                10 Feb 2020, 18:34

                Hi, check your TEMP and TMP environment variables, if they point to non-existing directories on your PC, then Maintenance Tool gives this error.

                If that's the case also for you: one quick solution:

                set temp=
                set tmp=
                c:\qt\maintenancetool.exe
                
                M Offline
                M Offline
                mcleary
                wrote on 11 Feb 2020, 10:12 last edited by
                #6

                @hskoglund I'll try again this evening and report back. Thanks for the tip

                1 Reply Last reply
                0
                • H hskoglund
                  10 Feb 2020, 18:34

                  Hi, check your TEMP and TMP environment variables, if they point to non-existing directories on your PC, then Maintenance Tool gives this error.

                  If that's the case also for you: one quick solution:

                  set temp=
                  set tmp=
                  c:\qt\maintenancetool.exe
                  
                  M Offline
                  M Offline
                  mcleary
                  wrote on 16 Feb 2020, 18:33 last edited by
                  #7

                  @hskoglund No luck with this solution. Same error. I even tried the offline installer but I get the following message.
                  alt text

                  Any tips?

                  1 Reply Last reply
                  0
                  • H Offline
                    H Offline
                    hskoglund
                    wrote on 16 Feb 2020, 18:42 last edited by
                    #8

                    Hi, just guessing, but if you copy the offline installer .exe file to somewhere on your C: drive (instead of E:) and invoke it from there (and using the same incantations, set temp= and set tmp=

                    M 1 Reply Last reply 16 Feb 2020, 19:04
                    1
                    • H hskoglund
                      16 Feb 2020, 18:42

                      Hi, just guessing, but if you copy the offline installer .exe file to somewhere on your C: drive (instead of E:) and invoke it from there (and using the same incantations, set temp= and set tmp=

                      M Offline
                      M Offline
                      mcleary
                      wrote on 16 Feb 2020, 19:04 last edited by
                      #9

                      @hskoglund Unfortunately same error. When running "Writing maintenance tool." it gives me the same error dialog.
                      alt text

                      Unfortunately I have no clues on what could be wrong with my system.

                      aha_1980A 1 Reply Last reply 16 Feb 2020, 19:09
                      0
                      • M mcleary
                        16 Feb 2020, 19:04

                        @hskoglund Unfortunately same error. When running "Writing maintenance tool." it gives me the same error dialog.
                        alt text

                        Unfortunately I have no clues on what could be wrong with my system.

                        aha_1980A Offline
                        aha_1980A Offline
                        aha_1980
                        Lifetime Qt Champion
                        wrote on 16 Feb 2020, 19:09 last edited by
                        #10

                        Hi@mcleary,

                        did you run the tool as normal user or as administrator?

                        If you have run it as admin before, you will probably need to do so again.

                        Also, ave you checked there is enough free space on your drives?

                        Regards.

                        Qt has to stay free or it will die.

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

                          Also, to add to @aha_1980, if you have an antivirus program running (other than the one built in with Windows 10) try disable it

                          1 Reply Last reply
                          1
                          • M Offline
                            M Offline
                            mcleary
                            wrote on 16 Feb 2020, 19:22 last edited by
                            #12

                            I tried running as admin but the same message keeps popping.

                            I do have plenty of space (more than 100GB free) and I don't have any antivirus software installed.

                            I am trying to run some debug tools like process monitor to see if I can figure it out without reinstalling everything.

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

                              Ok, more one guess :-) try installing Qt to some other place/directory than what you've done so far, e.g. instead of C:\Qt try C:\Qt2

                              1 Reply Last reply
                              0
                              • M Offline
                                M Offline
                                mcleary
                                wrote on 16 Feb 2020, 19:36 last edited by mcleary
                                #14

                                No luck, same error. There is something wrong with the Maintenance tool path

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

                                  Yeah, as a last ditch, you could try one more setting:

                                  set path=
                                  qt-opensource-windows-x86-5.14.1.exe
                                  

                                  (if there's some bad stuff in your path setting)

                                  M 2 Replies Last reply 16 Feb 2020, 19:53
                                  0
                                  • H hskoglund
                                    16 Feb 2020, 19:49

                                    Yeah, as a last ditch, you could try one more setting:

                                    set path=
                                    qt-opensource-windows-x86-5.14.1.exe
                                    

                                    (if there's some bad stuff in your path setting)

                                    M Offline
                                    M Offline
                                    mcleary
                                    wrote on 16 Feb 2020, 19:53 last edited by
                                    #16

                                    @hskoglund Does this hangs any bells?

                                    alt text

                                    1 Reply Last reply
                                    0
                                    • H hskoglund
                                      16 Feb 2020, 19:49

                                      Yeah, as a last ditch, you could try one more setting:

                                      set path=
                                      qt-opensource-windows-x86-5.14.1.exe
                                      

                                      (if there's some bad stuff in your path setting)

                                      M Offline
                                      M Offline
                                      mcleary
                                      wrote on 16 Feb 2020, 19:56 last edited by
                                      #17

                                      @hskoglund No luck clearing the path.

                                      1 Reply Last reply
                                      0
                                      • H Offline
                                        H Offline
                                        hskoglund
                                        wrote on 16 Feb 2020, 20:01 last edited by
                                        #18

                                        Hmm name collision, interesting...
                                        Ok try to set another, explicit TEMP path, first create a directory (say C:\Temp that's guaranteed to be empty), then try:

                                        set temp=C:\Temp
                                        set tmp=C:\Temp
                                        qt-opensource-windows-x86-5.14.1.exe
                                        
                                        1 Reply Last reply
                                        0
                                        • M Offline
                                          M Offline
                                          mcleary
                                          wrote on 16 Feb 2020, 20:29 last edited by
                                          #19

                                          Same problem. Fortunately if I kill the installer process while this dialog is being displayed I can keep the installation, I just don't have the maintenance tool. This is enough for me to keep working for now.

                                          Thanks for the help

                                          1 Reply Last reply
                                          0
                                          • M Offline
                                            M Offline
                                            mcleary
                                            wrote on 16 Feb 2020, 23:54 last edited by
                                            #20

                                            Right, so now I can say for sure that there is something wrong with the installer.

                                            I just tried the installer in a brand new machine and I get the same message:

                                            alt text

                                            Right after it finishes downloading the repositories.

                                            Now I am pretty sure it is not just my machine anymore.

                                            1 Reply Last reply
                                            0

                                            • Login

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