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

Platform independent PowerShell: unable to resolve the correct dataLocalDir #8

Closed
WordlessEcho opened this issue Jul 14, 2021 · 13 comments
Labels
bug Something isn't working

Comments

@WordlessEcho
Copy link

WordlessEcho commented Jul 14, 2021

$ pacmc init
Exception in thread "main" java.lang.ExceptionInInitializerError
        at net.axay.pacmc.commands.Init$run$1.invokeSuspend(Init.kt:25)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
Caused by: org.kodein.db.leveldb.LevelDBException: NotFound: D:\files\app\games\Minecraft\.minecraft\null\axay\pacmc\data\db1/LOCK: ?????????
        at org.kodein.db.leveldb.jni.Native.dbOpen(Native Method)
        at org.kodein.db.leveldb.jni.LevelDBJNI$Factory.open(LevelDBJNI.kt:29)
        at org.kodein.db.leveldb.jvm.LevelDBJvm.open(LevelDBJvm.kt)
        at org.kodein.db.impl.kv.AbstractKeyValueDBFactory.open(AbstractKeyValueDBFactory.kt:20)
        at org.kodein.db.impl.kv.AbstractKeyValueDBFactory.open(AbstractKeyValueDBFactory.kt:12)
        at org.kodein.db.impl.data.AbstractDataDBFactory.open(AbstractDataDBFactory.kt:20)
        at org.kodein.db.impl.data.AbstractDataDBFactory.open(AbstractDataDBFactory.kt:12)
        at org.kodein.db.impl.model.AbstractModelDBFactory.open(AbstractModelDBFactory.kt:29)
        at org.kodein.db.impl.model.AbstractModelDBFactory.open(AbstractModelDBFactory.kt:9)
        at org.kodein.db.impl.AbstractDBFactory.open(AbstractDBFactory.kt:25)
        at org.kodein.db.impl.AbstractDBFactory.open(AbstractDBFactory.kt:10)
        at org.kodein.db.impl.DefaultKt.open(default.kt:7)
        at net.axay.pacmc.storage.DatabaseKt.<clinit>(Database.kt:14)
        ... 7 more

Pacmc version:

$ scoop update pacmc
pacmc: 0.2.1 (latest version)

JDK version:

$ java --version
openjdk 16.0.1 2021-04-20
OpenJDK Runtime Environment (build 16.0.1+9-24)
OpenJDK 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)
@WordlessEcho
Copy link
Author

WordlessEcho commented Jul 14, 2021

Here is Values.projectDirectories and Values.projectDirectories.dataLocalDir I got (on Windows 11 and Windows 10 version 19043.1083, run with PowerShell 7.1.3):

ProjectDirectories (Windows 10):
  projectPath   = 'axay\pacmc'
  cacheDir      = 'null\axay\pacmc\cache'
  configDir     = 'PowerShell 7.1.3\axay\pacmc\config'
  dataDir       = 'PowerShell 7.1.3\axay\pacmc\data'
  dataLocalDir  = 'null\axay\pacmc\data'
  preferenceDir = 'PowerShell 7.1.3\axay\pacmc\config'
  runtimeDir    = 'null'
null\axay\pacmc\data

@WordlessEcho
Copy link
Author

WordlessEcho commented Jul 14, 2021

I got same exception with system integrated PowerShell and cmd.exe but Values.projectDirectories and Values.projectDirectories.dataLocalDir is fine. Seems like that this exception not about the path.

ProjectDirectories (Windows 10):
  projectPath   = 'axay\pacmc'
  cacheDir      = 'C:\Users\echo\AppData\Local\axay\pacmc\cache'
  configDir     = 'C:\Users\echo\AppData\Roaming\axay\pacmc\config'
  dataDir       = 'C:\Users\echo\AppData\Roaming\axay\pacmc\data'
  dataLocalDir  = 'C:\Users\echo\AppData\Local\axay\pacmc\data'
  preferenceDir = 'C:\Users\echo\AppData\Roaming\axay\pacmc\config'
  runtimeDir    = 'null'
C:\Users\echo\AppData\Local\axay\pacmc\data

@WordlessEcho
Copy link
Author

WordlessEcho commented Jul 14, 2021

Workaround: create floaders .\axay\pacmc\data on C:\Users\<YOUR USERNAME>\AppData\Local.

@jakobkmar jakobkmar changed the title Kodein DB: LOCK Not Found Windows: Kodein DB - LOCK Not Found Jul 14, 2021
@jakobkmar jakobkmar added the bug Something isn't working label Jul 14, 2021
@jakobkmar
Copy link
Owner

Thank you for your report, I will boot into Windows and test it by myself - if that does not give me the same result as you got, I will have a look into the code which resolves the dataLocalDir.

@jakobkmar
Copy link
Owner

Did you test it on both Windows 11 and Windows 10?

@jakobkmar
Copy link
Owner

jakobkmar commented Jul 14, 2021

I have a hard time seeing where you executed the two examples you gave.

Where exactly did you get these results?

ProjectDirectories (Windows 10):
  projectPath   = 'axay\pacmc'
  cacheDir      = 'null\axay\pacmc\cache'
  configDir     = 'PowerShell 7.1.3\axay\pacmc\config'
  dataDir       = 'PowerShell 7.1.3\axay\pacmc\data'
  dataLocalDir  = 'null\axay\pacmc\data'
  preferenceDir = 'PowerShell 7.1.3\axay\pacmc\config'
  runtimeDir    = 'null'

And in which case did you get these correct results?

ProjectDirectories (Windows 10):
  projectPath   = 'axay\pacmc'
  cacheDir      = 'C:\Users\echo\AppData\Local\axay\pacmc\cache'
  configDir     = 'C:\Users\echo\AppData\Roaming\axay\pacmc\config'
  dataDir       = 'C:\Users\echo\AppData\Roaming\axay\pacmc\data'
  dataLocalDir  = 'C:\Users\echo\AppData\Local\axay\pacmc\data'
  preferenceDir = 'C:\Users\echo\AppData\Roaming\axay\pacmc\config'
  runtimeDir    = 'null'

@WordlessEcho
Copy link
Author

Did you test it on both Windows 11 and Windows 10?

Yes.

I have a hard time seeing where you executed the two examples you gave.

Where exactly did you get these results?

ProjectDirectories (Windows 10):
  projectPath   = 'axay\pacmc'
  cacheDir      = 'null\axay\pacmc\cache'
  configDir     = 'PowerShell 7.1.3\axay\pacmc\config'
  dataDir       = 'PowerShell 7.1.3\axay\pacmc\data'
  dataLocalDir  = 'null\axay\pacmc\data'
  preferenceDir = 'PowerShell 7.1.3\axay\pacmc\config'
  runtimeDir    = 'null'

And in which case did you get these correct results?

ProjectDirectories (Windows 10):
  projectPath   = 'axay\pacmc'
  cacheDir      = 'C:\Users\echo\AppData\Local\axay\pacmc\cache'
  configDir     = 'C:\Users\echo\AppData\Roaming\axay\pacmc\config'
  dataDir       = 'C:\Users\echo\AppData\Roaming\axay\pacmc\data'
  dataLocalDir  = 'C:\Users\echo\AppData\Local\axay\pacmc\data'
  preferenceDir = 'C:\Users\echo\AppData\Roaming\axay\pacmc\config'
  runtimeDir    = 'null'

First one I tested on PowerShell 7.1.3. Second one I tested on system integrated PowerShell.

@jakobkmar
Copy link
Owner

Ah I see, as I am not a Windows user, can you give me a hint how I can test it on the not system integrated PowerShell? I was only testing it in the PowerShell which is a default profile in Windows Terminal.

@WordlessEcho
Copy link
Author

WordlessEcho commented Jul 14, 2021

  1. Install PowerShell-7.1.3-win-x64.msi on your Windows (or x86 if you are using 32 bit).
  2. After installation finished, reopen Windows Terminal and click down arrow in tab bar. Windows PowerShell is your system integrated PowerShell. PowerShell is the PS 7.1.3 you just installed.
    image

@jakobkmar
Copy link
Owner

Thank you, I was able to reproduce the problem, will try to fix this now.

@jakobkmar jakobkmar changed the title Windows: Kodein DB - LOCK Not Found Platform independent PowerShell: unable to resolve the correct dataLocalDir Jul 14, 2021
@jakobkmar
Copy link
Owner

Fixed with 1f3d92b and 309028c

Also added a new command called pacmc info (967a06e), you can check if the paths are detected correctly using this command.

@jakobkmar
Copy link
Owner

The fix is available in version 0.2.2, you have to wait some hours until scoop picks up that update.

@WordlessEcho
Copy link
Author

I have deleted the C:\Users\<USERNAME>\AppData\Local\axay and test again. Works great for me, thx!

$ .\pacmc.bat info
pacmc version 0.2.2

dataLocalDir: C:\Users\echo\AppData\Local\axay\pacmc\data
databaseDir: C:\Users\echo\AppData\Local\axay\pacmc\data\db1
databaseDir (canonical): C:\Users\echo\AppData\Local\axay\pacmc\data\db1

Your OS: WINDOWS
Java version: 16.0.1+9-24

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

No branches or pull requests

2 participants