projectnessie / nessie

Nessie: Transactional Catalog for Data Lakes with Git-like semantics
https://projectnessie.org
Apache License 2.0
1.04k stars 129 forks source link

Setting up development environment fails with `gradle quarkusDev` #9656

Closed Koenkk closed 2 weeks ago

Koenkk commented 1 month ago

Issue description

I'm trying to setup a local development environment for Nessie.

The first problem I ran into is after executing ./gradlew quarkusDev the UI is not accessible on http://localhost:19120. It looks to me that :nessie-quarkus does not start when running ./gradlew quarkusDev. This is solved by executing ./gradlew :nessie-quarkus:quarkusDev, am I doing something wrong or is the information in the README.md outdated?

Now that the UI is accessible, I run into a second problem. Whenever I open the UI I get the following error (in the terminal running ./gradlew :nessie-quarkus:quarkusDev):

     2024-09-27 16:08:36,125 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-4) HTTP Request to /api/v1/trees/tree failed, error id: c9627606-91f0-47d4-976a-6af0365bcab2-6: java.lang.NoClassDefFoundError: org/projectnessie/nessie/relocated/protobuf/UnsafeByteOperations
        at org.projectnessie.versioned.storage.common.indexes.StoreIndexImpl.serialize(StoreIndexImpl.java:522)
        at org.projectnessie.versioned.storage.common.logic.CommitLogicImpl.buildCommitObj(CommitLogicImpl.java:718)
        at org.projectnessie.versioned.storage.common.logic.CommitLogic.buildCommitObj(CommitLogic.java:186)
        at org.projectnessie.versioned.storage.common.logic.CommitLogicImpl.doCommit(CommitLogicImpl.java:277)
        at org.projectnessie.versioned.storage.common.logic.RepositoryLogicImpl.initializeInternalRef(RepositoryLogicImpl.java:261)
        at org.projectnessie.versioned.storage.common.logic.RepositoryLogicImpl.initialize(RepositoryLogicImpl.java:81)
        at org.projectnessie.versioned.storage.common.logic.RepositoryLogicImpl.initialize(RepositoryLogicImpl.java:73)
        at org.projectnessie.quarkus.providers.storage.PersistProvider.produceWithInitializedRepository(PersistProvider.java:104)
        at org.projectnessie.quarkus.providers.storage.PersistProvider_ProducerMethod_produceWithInitializedRepository_sL325iqwi3y6FdhYHbfY

I found a possible fix here: https://github.com/projectnessie/nessie/pull/8483#issuecomment-2120639357 (./gradlew :nessie-protobuf-relocated:build) but this unfortunately does not help. How can I solve this?

dimas-b commented 1 month ago

@Koenkk thanks for reporting inconsistencies in README.

To unlock your local development, would it work for you to do ./gradlew :nessie-quarkus:assemble and then run java -jar servers/quarkus-server/build/quarkus-app/quarkus-run.jar from the command line?

Koenkk commented 1 month ago

@dimas-b thanks for your reply, I forgot to mention it in my post but this worked indeed (ran ./gradlew :nessie-quarkus:build and then java -jar quarkus-run.jar). However I would like to run it with qaurkusDev so I can quickly test out code changes and debug easily.

Once the UnsafeByteOperations error is fixed I can make a PR to update the README.md.

snazy commented 1 month ago

This is an issue in the Quarkus-Gradle plugin, that requires quite a lot of refactoring of the Quarkus-Gradle plugin.

Koenkk commented 1 month ago

That's a bit of a bummer, so if I understand correctly, there is no way to develop nessie-quarkus through quarkusDev? Doesn't that lead to a slow development cycle? Debugging becomes harder and the feedback cycle is slow (you need to rebuild it with ./gradlew :nessie-quarkus:assemble and restart it every time).

snazy commented 1 month ago

You can still debug tests in the IDE - and connecting to a running Quarkus instance w/ a debugger is also still possible.

Koenkk commented 1 month ago

Thanks, I've created a PR to update the README.md: https://github.com/projectnessie/nessie/pull/9668

snazy commented 2 weeks ago

Going to close this as a not "our" bug :(