Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-252456

Failed to delete file, Download server resource pack

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 1.18.2
    • None
    • Windows 10
    • Unconfirmed
    • (Unassigned)

      File C:\Users\Chase\AppData\Roaming\.minecraft\server-resource-packs\3f265194a5bcf8f460b645ec2119c558116a3904 had wrong hash (expected a91e0a8565ccfa536b571dee396ad3983d03520b, found bae89146b7174bcbef676cea0bc499ed722cf2f6).

      Pack application failed: java.lang.RuntimeException: Hash check failure for file C:\Users\Chase\AppData\Roaming\.minecraft\server-resource-packs\3f265194a5bcf8f460b645ec2119c558116a3904, see log, deleting file C:\Users\Chase\AppData\Roaming\.minecraft\server-resource-packs\3f265194a5bcf8f460b645ec2119c558116a3904

      Failed to delete file C:\Users\Chase\AppData\Roaming\.minecraft\server-resource-packs\3f265194a5bcf8f460b645ec2119c558116a3904: C:\Users\Chase\AppData\Roaming\.minecraft\server-resource-packs\3f265194a5bcf8f460b645ec2119c558116a3904: The process cannot access the file because it is being used by another process.

      When a player has already downloaded a resource pack from a link, it will have trouble downloading a different resource pack from the same link. As it needs to delete the file with the same file name before placing the file with different contents. Resulting in the error above.

      There is a loophole around this though, the server can request the player to request for the resource pack twice in a row. Note that Spigot is used to request it, but the issue is directly from the client.

      1. setResourcePack() is done on player
      2. Since File deletion failed, PlayerResourcePackStatusEvent triggers
      3. On event, setResourcePack() again
      4. File is deleted successfully without error, resulting in the below message without the file deletion error

      File C:\Users\Chase\AppData\Roaming\.minecraft\server-resource-packs\3f265194a5bcf8f460b645ec2119c558116a3904 had wrong hash (expected a91e0a8565ccfa536b571dee396ad3983d03520b, found bae89146b7174bcbef676cea0bc499ed722cf2f6).

      Pack application failed: java.lang.RuntimeException: Hash check failure for file C:\Users\Chase\AppData\Roaming\.minecraft\server-resource-packs\3f265194a5bcf8f460b645ec2119c558116a3904, see log, deleting file C:\Users\Chase\AppData\Roaming\.minecraft\server-resource-packs\3f265194a5bcf8f460b645ec2119c558116a3904

      5. setResourcePack() a few milliseconds later will download and apply the file

      Assumption might be bad management of file processing while file deletion is occurring. Even though there is a loophole, the setResourcePack() method needs to be used three times in succession to properly apply the server resourcepack, the client error message which warns that the server resource pack is not applied properly will appear. That is due to the file deletion error. The first two setResourcePack() must be done in quick succession and the third should be done slightly later than the first two. 
       

            Unassigned Unassigned
            Dymax Dymax
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: