inotia00 / rvx-builder

A NodeJS ReVanced Extended builder
GNU General Public License v3.0
531 stars 48 forks source link

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

Closed Spacellary closed 1 year ago

Spacellary commented 1 year ago

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:

https://user-images.githubusercontent.com/39604793/198880408-95b6f341-6aec-44a3-9ca4-6758c46e22a3.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):

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 commented 1 year ago

Could be related to https://github.com/reisxd/revanced-builder/issues/502#issue-1401820035 I'll keep trying what I can

Spacellary commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

I am getting this error with updated everything an hour ago and trying to patch the latest recommended version.Screenshot_2022-10-30-19-34-19-422_org.mozilla.firefox.jpg

Spacellary commented 1 year ago

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 commented 1 year ago

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: https://github.com/inotia00/rvx-builder/issues/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 commented 1 year ago

[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 commented 1 year ago

@meetaditya Added a bit more context to https://github.com/inotia00/rvx-builder/issues/7#issuecomment-1296274651 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.

meetaditya commented 1 year ago

@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 commented 1 year ago

17.36.15

Don't we need Node.js to build?

Spacellary commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

Spacellary commented 1 year ago

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 commented 1 year ago

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]

Impulse666 commented 1 year ago

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 commented 12 months ago

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

Unpin the issue

Spacellary commented 12 months ago

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