Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Error: EBUSY: resource busy or locked" and "Finished downloading files" but no files get downloaded, "revanced" folder is empty... ERROR #7

Closed
Spacellary opened this issue Oct 30, 2022 · 19 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@Spacellary
Copy link
Collaborator

Spacellary commented Oct 30, 2022

Update: Solved in the replies bellow.


Still getting Error: EBUSY: resource busy or locked, also tried doing again from a different folder and I get a [builder] Finished downloading files. but no files get downloaded, revanced folder is empty... or when it downloads them I get the Error: EBUSY when patching...
Tried ReisXD builder and it is working fine.

Full Patching Process:

msedge_g0FLoBmTxV.mp4
Error: EBUSY: resource busy or locked, unlink '\\?\D:\Ferramentas\revanced\inotia00-rvx-builder\revanced-cache\1.apk'
    at unlinkSync (node:fs:1780:3)
    at _unlinkSync (node:internal/fs/rimraf:214:14)
    at rimrafSync (node:internal/fs/rimraf:195:7)
    at node:internal/fs/rimraf:253:9
    at Array.forEach (<anonymous>)
    at _rmdirSync (node:internal/fs/rimraf:250:7)
    at rimrafSync (node:internal/fs/rimraf:193:7)
    at rmSync (node:fs:1274:10)
    at afterBuild (C:\snapshot\rvx-builder-build3\wsEvents\patchApp.js:38:3)
    at Socket.<anonymous> (C:\snapshot\rvx-builder-build3\wsEvents\patchApp.js:219:53)
[builder] Please report this bug here: https://github.com/inotia00/rvx-builder/issues.

Tried rvx-builder-v3.4.15 and rvx-builder-v3.4.16 and same thing happens on both.


Describe the bug

Builder fails to patch, using the versions and rvx-resources bellow:
revanced-integrations-v0.63.0
revanced-patches-v2.99.0
revanced-cli-v2.14.0

Steps To Reproduce

  1. Try to build latest recommended (Youtube v17.42.35).
  2. Failure.

Screenshots

msedge_8S7C0AgL7i


revanced-builder Version: rvx-builder v3.4.16

Desktop (please complete the following information):

  • OS: Windows
  • Version: 11

Additional context: Crash Report

[builder] An error occured.
Error: EBUSY: resource busy or locked, unlink '\\?\D:\Edge Downloads 2022.4\revanced-cache\1.apk'
    at unlinkSync (node:fs:1780:3)
    at _unlinkSync (node:internal/fs/rimraf:214:14)
    at rimrafSync (node:internal/fs/rimraf:195:7)
    at node:internal/fs/rimraf:253:9
    at Array.forEach (<anonymous>)
    at _rmdirSync (node:internal/fs/rimraf:250:7)
    at rimrafSync (node:internal/fs/rimraf:193:7)
    at rmSync (node:fs:1274:10)
    at afterBuild (C:\snapshot\rvx-builder-build3\wsEvents\patchApp.js:38:3)
    at Socket.<anonymous> (C:\snapshot\rvx-builder-build3\wsEvents\patchApp.js:219:53)
[builder] Please report this bug here: https://github.com/inotia00/rvx-builder/issues.
[builder] An error occured.
Error: EISDIR: illegal operation on a directory, read
    at Object.readSync (node:fs:747:3)
    at Object.readSync (pkg/prelude/bootstrap.js:947:32)
    at tryReadSync (node:fs:447:20)
    at Object.readFileSync (node:fs:493:19)
    at readFileSync (pkg/prelude/bootstrap.js:1082:36)
    at parsePatch (C:\snapshot\rvx-builder-build3\utils\PatchesParser.js:9:5)
    at getPatches (C:\snapshot\rvx-builder-build3\wsEvents\getPatches.js:28:24)
    at WebSocket.<anonymous> (C:\snapshot\rvx-builder-build3\index.js:175:15)
    at WebSocket.emit (node:events:537:28)
    at Receiver.receiverOnMessage (C:\snapshot\rvx-builder-build3\node_modules\ws\lib\websocket.js:1178:20)
[builder] Please report this bug here: https://github.com/inotia00/rvx-builder/issues.

@Spacellary Spacellary changed the title "Failure" bulding version "Failure" building Youtube v17.42.35 - patches-v2.99.0 Oct 30, 2022
@Spacellary Spacellary changed the title "Failure" building Youtube v17.42.35 - patches-v2.99.0 [rvx-builder v3.4.16] "Finished downloading files" but no files get downloaded, "revanced" folder is empty... Oct 30, 2022
@Spacellary Spacellary changed the title [rvx-builder v3.4.16] "Finished downloading files" but no files get downloaded, "revanced" folder is empty... [rvx-builder v3.4.16] "Finished downloading files" but no files get downloaded, "revanced" folder is empty... ERROR Oct 30, 2022
@Spacellary Spacellary changed the title [rvx-builder v3.4.16] "Finished downloading files" but no files get downloaded, "revanced" folder is empty... ERROR [rvx-builder v3.4.16] "Error: EBUSY: resource busy or locked" and "Finished downloading files" but no files get downloaded, "revanced" folder is empty... ERROR Oct 30, 2022
@Spacellary
Copy link
Collaborator Author

Could be related to reisxd#502 (comment)
I'll keep trying what I can

@Spacellary
Copy link
Collaborator Author

image
as expected java.exe is holding that file but I dunno if I can do anything about it when force stop it obv the builder just stops responding :/

@inotia00
Copy link
Owner

not reproduced at all
However, I can only vaguely guess that it is an issue of java.

If it is true that java is holding the file or directory, try the patch by moving rvx-builder-win.exe to another directory.

@sleepingiv

This comment was marked as spam.

@Spacellary
Copy link
Collaborator Author

Spacellary commented Oct 30, 2022

not reproduced at all
However, I can only vaguely guess that it is an issue of java.

If it is true that java is holding the file or directory, try the patch by moving rvx-builder-win.exe to another directory.

Rebooted my PC, moved file to a different directory in a different Disk, from D: to C:, same result. Weirdly enough it doesn't happen with ReisXD builder when building official Revanced.

@Spacellary
Copy link
Collaborator Author

Spacellary commented Oct 30, 2022

SOLVED - SOLUTION:

Perform a clean reinstallation of Zulu Open JDK 17/18/19 – Install the 32-bit version as recommend by @Impulse666 (thanks for your findings!) or use the alternative methods bellow...

What I would recommend the most is to use the Docker-Compose build method, as proposed for the Official Documentation here: #41. This has an absolute success rate and should work on all computers and operating systems.

Alternately you can use Windows Sandbox (available in W10/11 Pro+) and copy the files there to build in a clean environment.

Even more alternately you can use the Windows Subsystem for Linux (WSL2) to run a Linux terminal inside Windows and build using the instructions for Linux. That will require you to be a bit comfortable using the Linux/Bash terminal, but if even I managed to do it odds are if you're a bit of a technical user you can also manage.

Even even more alternately you can just use Linux, as a daily gamer and Adobe user this isn't an option for me.


Additional context:

@inotia00
I was able to now build normally after doing the following steps:

1) Uninstalled the Any/Zulu JDK 17 version that was installed.
2) Uninstalled standalone Node.js - if present.

3) Installed Zulu JDK again (Zulu JDK 17 v17.36.15 32-bit from Winget).
4) Build again, with success.

I used Geek Uninstaller to perform a clean removal (uninstall and remove residual files) of the software and I installed Zulu JDK 17 v17.36.15 using WingetUI/Winget. Probably any version of Zulu JDK 17/18/19+ will work. It's mostly just about doing a clean reinstallation.


rvx-builder-v3.4.16
revanced-cli-v2.14.1
revanced-integrations-v0.63.0
revanced-patches-v2.99.0
youtube-v17.42.35

[builder] ReVanced has been built! Please transfer over revanced/ReVanced-YouTube-v17.42.35-cli_v2.14.1-patches_v2.99.0.apk and if you are using YT/YTM, revanced/microg.apk and install them!

@inotia00
Copy link
Owner

[builder] ReVanced has been built! Please transfer over revanced/ReVanced-YouTube-v17.42.35-cli_v2.14.1-patches_v2.99.0.apk and if you are using YT/YTM, revanced/microg.apk and install them!

Thank you so much for sharing the method you solved
If anyone has the same issue, this method will be very helpful for them.

@Spacellary
Copy link
Collaborator Author

@meetaditya Added a bit more context to #7 (comment) as it seems to work for other people too, if you would still have the issue, please try again and remove all versions and related files related to Java as mentioned before and hopefully that will do it for you too.

@inotia00 inotia00 added documentation Improvements or additions to documentation good first issue Good for newcomers labels Nov 2, 2022
@inotia00 inotia00 pinned this issue Nov 2, 2022
@inotia00 inotia00 added bug Something isn't working and removed documentation Improvements or additions to documentation labels Nov 2, 2022
@meetaditya
Copy link

@Spacellary Thanks for your help!

"ReVanced has been built! Please transfer over revanced/ReVanced-YouTube-v17.42.35-cli_v2.14.1-patches_v2.99.0.apk and if you are using YT/YTM, revanced/microg.apk and install them!"

Uninstalled everything as you mentioned, I noticed that path variables still had the path set to previous installation folder so I removed that manually and then did a fresh install. That fixed it for me. :)

@Skrell
Copy link

Skrell commented Nov 8, 2022

17.36.15

Don't we need Node.js to build?

@Spacellary
Copy link
Collaborator Author

Spacellary commented Nov 8, 2022

That's just the version I used, probably reinstalling any other will work. Only installing Zulu Open JDK will have everything needed. Not necessary to install Node.js separately.

@Skrell
Copy link

Skrell commented Nov 8, 2022

Well the bad news is it didn't work....but the GOOD news is I got a different error message(s)!

[builder] INFO: Signing revanced_aligned.apk to revanced_signed.apk
[builder] Exception in thread "main"
[builder] java.lang.OutOfMemoryError: Unable to allocate 1048576 bytes
[builder] at java.base/jdk.internal.misc.Unsafe.allocateMemory(Unsafe.java:632)
[builder] at java.base/java.nio.DirectByteBuffer.(DirectByteBuffer.java:125) at java.base/java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:332) at com.android.apksig.internal.util.FileChannelDataSource.feed(FileChannelDataSource.java:102) at com.android.apksig.internal.zip.LocalFileRecord.outputUncompressedData(LocalFileRecord.java:384) at com.android.apksig.ApkSigner.fulfillInspectInputJarEntryRequest(ApkSigner.java:621) at com.android.apksig.ApkSigner.sign(ApkSigner.java:385) at com.android.apksig.ApkSigner.sign(ApkSigner.java:204) at app.revanced.utils.signing.Signer.signApk(Signer.kt:77) at app.revanced.cli.signing.Signing.sign(Signing.kt:10) at app.revanced.cli.command.MainCommand.run(MainCommand.kt:174) at picocli.CommandLine.executeUserObject(CommandLine.java:1939) at picocli.CommandLine.access$1300(CommandLine.java:145) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
[builder] at picocli.CommandLine$RunLast.handle(CommandLine.java:2352) at picocli.CommandLine$RunLast.handle(CommandLine.java:2314) at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179) at picocli.CommandLine$RunLast.execute(CommandLine.java:2316) at picocli.CommandLine.execute(CommandLine.java:2078) at app.revanced.cli.main.MainKt.main(Main.kt:7)

@Spacellary
Copy link
Collaborator Author

This is actually good news, I did get that error too after the previous one and eventually it worked out.

Things I tried, If you don't mind or haven't tried already:
Clean uninstall JDK again. Reboot. Install again.
Do a java --version in the Terminal, to make sure you got have anything left, and do again to see if everything is installed after you do install again, after the reboot...
Hopefully this helps somehow. I tried many things so can't hurt to try too.

@Skrell
Copy link

Skrell commented Nov 8, 2022

I selected ALL the patches and it worked this time!!!! IT WORKED!!! TYTYTYTYTYTY!!!!

@Spacellary
Copy link
Collaborator Author

I selected ALL the patches and it worked this time!!!! IT WORKED!!! TYTYTYTYTYTY!!!!

Haha, congratulations! I mean, it will probably work out fine now then. This bug does certainly feel random sometimes. I was getting "out of memory" with 10GB free, I was mad xD

@limico99
Copy link

limico99 commented Nov 18, 2022

I failed on Windows 11 (22621.608.51.6), but after installing zulu19.30.11 in a sandbox environment, I succeeded in patching with rvx-builder v3.4.16.

revanced-patches-v2.111.2.json
revanced.keystore
revanced-cli-v2.15.1.jar
revanced-patches-v2.111.2.jar
revanced-integrations-v0.71.0.apk
VancedMicroG-v0.2.25.224113-224113003.apk
youtube.apk(17.45.34)

success
[ReVanced-YouTube-v17.45.34-cli_v2.15.1-patches_v2.111.2.apk]

@inotia00 inotia00 mentioned this issue Nov 19, 2022
@Impulse666
Copy link

Impulse666 commented Dec 11, 2022

For anyone else experiencing similar issues Windows, make sure to uninstall your current Azul Zulu JDK installation and install the last Java 17 (LTS) x86 32-bit version from this page: https://www.azul.com/downloads/?version=java-17-lts&os=windows&architecture=x86-32-bit&package=jdk

Note: 64-bit version seems to cause some issues with both rvx-builder from inotia00 and revanced-builder from reisxd.

@inotia00 inotia00 changed the title [rvx-builder v3.4.16] "Error: EBUSY: resource busy or locked" and "Finished downloading files" but no files get downloaded, "revanced" folder is empty... ERROR "Error: EBUSY: resource busy or locked" and "Finished downloading files" but no files get downloaded, "revanced" folder is empty... ERROR Jan 5, 2023
@Spacellary Spacellary mentioned this issue Jan 11, 2023
@inotia00 inotia00 mentioned this issue Feb 8, 2023
Closed
@inotia00 inotia00 mentioned this issue Apr 15, 2023
@inotia00
Copy link
Owner

This bug, which I thought would last a forever, is no longer reproduced in the latest release

Unpin the issue

@inotia00 inotia00 unpinned this issue Jul 31, 2023
@Spacellary
Copy link
Collaborator Author

@inotia00 Gotta love Java on Windows... Glad it seems solved 👏🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

7 participants