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

Build nouveau package #125

Merged
merged 4 commits into from
Jul 4, 2024
Merged

Build nouveau package #125

merged 4 commits into from
Jul 4, 2024

Conversation

rnewson
Copy link
Member

@rnewson rnewson commented Dec 11, 2023

No description provided.

debian/conf/nouveau.yaml Outdated Show resolved Hide resolved
debian/conf/nouveau.yaml Outdated Show resolved Hide resolved
debian/conf/nouveau.yaml Outdated Show resolved Hide resolved
lsb-base,
procps,
${misc:Depends}
Description: Nouveau is a modern replacement for dreyfus/clouseau
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe something high-level front, along the lines of ~“Nouveau adds Lucene-style indexing and searching to Apache CouchDB. …” then the rest?

Template: couchdb-nouveau/postrm_remove_indexes
Type: boolean
Default: false
_Description: Remove all CouchDB Nouveau indexes?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_Description: Remove all CouchDB Nouveau indexes?
_Description: Remove all CouchDB Nouveau indexe data?

maybe this makes it more clear that this is something one cares about?

Type: boolean
Default: false
_Description: Remove all CouchDB Nouveau indexes?
The /var/opt/couchdb-nouveau/ directory containing all CouchDB databases will
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The /var/opt/couchdb-nouveau/ directory containing all CouchDB databases will
The /var/opt/couchdb-nouveau/ directory containing all Nouveau indexes will

copypasta mistake?

@rnewson rnewson force-pushed the nouveau branch 3 times, most recently from 10999e5 to 18dfa12 Compare December 12, 2023 16:04
debian/conf/nouveau.yaml Outdated Show resolved Hide resolved
@rnewson rnewson force-pushed the nouveau branch 5 times, most recently from 92d11ec to ea538d5 Compare December 12, 2023 18:50
@rnewson rnewson marked this pull request as ready for review December 12, 2023 18:51
@rnewson rnewson requested review from janl and nickva December 12, 2023 19:43
@rnewson rnewson force-pushed the nouveau branch 7 times, most recently from 9ad1f62 to 415ccd8 Compare December 14, 2023 15:41
@rnewson rnewson force-pushed the nouveau branch 7 times, most recently from e7669df to afdd218 Compare February 23, 2024 15:17
Copy link
Contributor

@nickva nickva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I built the package for debian buster and ubuntu bionic

(pr/125)$ tree pkgs
pkgs
├── couch
│   ├── debian-buster
│   │   ├── couchdb-dbgsym_3.3.3-b964a84~buster_amd64.deb
│   │   ├── couchdb-nouveau_3.3.3-b964a84~buster_amd64.deb
│   │   ├── couchdb_3.3.3-b964a84~buster_amd64.buildinfo
│   │   ├── couchdb_3.3.3-b964a84~buster_amd64.changes
│   │   └── couchdb_3.3.3-b964a84~buster_amd64.deb
│   └── ubuntu-bionic
│       ├── couchdb-dbgsym_3.3.3-b964a84~bionic_amd64.ddeb
│       ├── couchdb-nouveau_3.3.3-b964a84~bionic_amd64.deb
│       ├── couchdb_3.3.3-b964a84~bionic_amd64.buildinfo
│       ├── couchdb_3.3.3-b964a84~bionic_amd64.changes
│       └── couchdb_3.3.3-b964a84~bionic_amd64.deb

On buster I first installed the base package. I noticed that it enabled nouveau even though the nouveau package wasn't installed yet.

[nouveau]
enable = true
url = http://127.0.0.1:5987

Should that disabled until we install the nouveau package? If it's tricky to do it, it's probably fine as is.

Then installed nouveau package. Noticed java package complained about installing certificate for some reason:

Unpacking openjdk-11-jre-headless:amd64 (11.0.22+7-1~deb10u1) ...
Selecting previously unselected package default-jre-headless.
Preparing to unpack .../default-jre-headless_2%3a1.11-71_amd64.deb ...
Unpacking default-jre-headless (2:1.11-71) ...
Setting up java-common (0.71) ...
Setting up ca-certificates-java (20190405) ...
head: cannot open '/etc/ssl/certs/java/cacerts' for reading: No such file or directory
Exception in thread "main" java.lang.InternalError: Error loading java.security file
	at java.base/java.security.Security.initialize(Security.java:94)
	at java.base/java.security.Security$1.run(Security.java:79)
	at java.base/java.security.Security$1.run(Security.java:77)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.Security.<clinit>(Security.java:77)
	at java.base/sun.security.jca.ProviderList.<init>(ProviderList.java:176)
	at java.base/sun.security.jca.ProviderList$2.run(ProviderList.java:94)
	at java.base/sun.security.jca.ProviderList$2.run(ProviderList.java:92)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/sun.security.jca.ProviderList.fromSecurityProperties(ProviderList.java:91)
	at java.base/sun.security.jca.Providers.<clinit>(Providers.java:54)
	at java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:156)
	at java.base/java.security.cert.CertificateFactory.getInstance(CertificateFactory.java:193)
	at org.debian.security.KeyStoreHandler.<init>(KeyStoreHandler.java:50)
	at org.debian.security.UpdateCertificates.<init>(UpdateCertificates.java:65)
	at org.debian.security.UpdateCertificates.main(UpdateCertificates.java:51)
dpkg: error processing package ca-certificates-java (--configure):
 installed ca-certificates-java package post-installation script subprocess returned error exit status 1

I tried reinstalling nouveau and the same error happened:

$ sudo apt install ./couchdb-nouveau_3.3.3-b964a84~buster_amd64.deb 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'couchdb-nouveau' instead of './couchdb-nouveau_3.3.3-b964a84~buster_amd64.deb'
couchdb-nouveau is already the newest version (3.3.3-b964a84~buster).
0 upgraded, 0 newly installed, 0 to remove and 288 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up ca-certificates-java (20190405) ...
head: cannot open '/etc/ssl/certs/java/cacerts' for reading: No such file or directory
Exception in thread "main" java.lang.InternalError: Error loading java.security file
	at java.base/java.security.Security.initialize(Security.java:94)
	at java.base/java.security.Security$1.run(Security.java:79)
	at java.base/java.security.Security$1.run(Security.java:77)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.Security.<clinit>(Security.java:77)
	at java.base/sun.security.jca.ProviderList.<init>(ProviderList.java:176)
	at java.base/sun.security.jca.ProviderList$2.run(ProviderList.java:94)
	at java.base/sun.security.jca.ProviderList$2.run(ProviderList.java:92)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/sun.security.jca.ProviderList.fromSecurityProperties(ProviderList.java:91)
	at java.base/sun.security.jca.Providers.<clinit>(Providers.java:54)
	at java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:156)
	at java.base/java.security.cert.CertificateFactory.getInstance(CertificateFactory.java:193)
	at org.debian.security.KeyStoreHandler.<init>(KeyStoreHandler.java:50)
	at org.debian.security.UpdateCertificates.<init>(UpdateCertificates.java:65)
	at org.debian.security.UpdateCertificates.main(UpdateCertificates.java:51)
dpkg: error processing package ca-certificates-java (--configure):
 installed ca-certificates-java package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of openjdk-11-jre-headless:amd64:
 openjdk-11-jre-headless:amd64 depends on ca-certificates-java (>= 20190405~); however:
  Package ca-certificates-java is not configured yet.

dpkg: error processing package openjdk-11-jre-headless:amd64 (--configure):
 dependency problems - leaving unconfigured
Processing triggers for ca-certificates (20200601~deb10u2) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...

Exception in thread "main" java.lang.InternalError: Error loading java.security file
	at java.base/java.security.Security.initialize(Security.java:94)
	at java.base/java.security.Security$1.run(Security.java:79)
	at java.base/java.security.Security$1.run(Security.java:77)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.Security.<clinit>(Security.java:77)
	at java.base/sun.security.jca.ProviderList.<init>(ProviderList.java:176)
	at java.base/sun.security.jca.ProviderList$2.run(ProviderList.java:94)
	at java.base/sun.security.jca.ProviderList$2.run(ProviderList.java:92)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/sun.security.jca.ProviderList.fromSecurityProperties(ProviderList.java:91)
	at java.base/sun.security.jca.Providers.<clinit>(Providers.java:54)
	at java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:156)
	at java.base/java.security.cert.CertificateFactory.getInstance(CertificateFactory.java:193)
	at org.debian.security.KeyStoreHandler.<init>(KeyStoreHandler.java:50)
	at org.debian.security.UpdateCertificates.<init>(UpdateCertificates.java:65)
	at org.debian.security.UpdateCertificates.main(UpdateCertificates.java:51)
E: /etc/ca-certificates/update.d/jks-keystore exited with code 1.
done.
Errors were encountered while processing:
 ca-certificates-java
 openjdk-11-jre-headless:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

I purged all the java packages, re-installed then installed couchdb-nouveau and it seemed to have worked.

The service came up automatically, which was very nice!, and I could make a simple query.

I purged couchdb-nouveau and it promoted if I wanted the data removed, responded "yes" and it succeeded.

After purging couchdb-nouveau, I noticed nouveau remained enabled and the server after restart was writing lots indicating it was looking for the nouveau service and returning a 503 "Service not available" if still made the query.

[warning] 2024-03-23T05:32:05.656090Z couchdb@127.0.0.1 <0.563.0> 86d88c9d84 search unavailable, retrying (11 of 20)
[warning] 2024-03-23T05:32:06.158340Z couchdb@127.0.0.1 <0.563.0> 86d88c9d84 search unavailable, retrying (12 of 20)
[warning] 2024-03-23T05:32:06.663945Z couchdb@127.0.0.1 <0.563.0> 86d88c9d84 search unavailable, retrying (13 of 20)
[warning] 2024-03-23T05:32:07.169055Z couchdb@127.0.0.1 <0.563.0> 86d88c9d84 search unavailable, retrying (14 of 20)
[warning] 2024-03-23T05:32:07.673765Z couchdb@127.0.0.1 <0.563.0> 86d88c9d84 search unavailable, retrying (15 of 20)

@rnewson
Copy link
Member Author

rnewson commented May 30, 2024

I can't repro the java cert issue but https://bugs.launchpad.net/ubuntu/+source/ca-certificates-java/+bug/1998065 sounds related. it's not a bug in the nouveau package, at least.

@rnewson rnewson force-pushed the nouveau branch 2 times, most recently from 04bd3c6 to b17642e Compare June 5, 2024 09:12
@nickva
Copy link
Contributor

nickva commented Jun 11, 2024

I tried rebasing on the latest main using Erlang 25 as the default and noticed a spotlessJava error when building packages:

Digest: sha256:c1f482c8ce061b766244d41dbbbb7084a1ffdf12c1028954f1f035d659587635
Status: Downloaded newer image for apache/couchdbci-debian:bullseye-erlang-25.3.2.12
mkdir -p ../couchdb
cp apache-couchdb-3.3.3-4c52700.tar.gz ../couchdb
cd ../couchdb && tar xfz *.tar.gz
sed 's/%SPIDERMONKEY%/libmozjs-78-0/g;s/%SPIDERMONKEY_DEV%/libmozjs-78-dev/g' \
debian/control.in > debian/control
echo 'SM_VER = 78' > debian/sm_ver.mk
rm -rf /home/jenkins/couchdb/apache-couchdb-3.3.3-4c52700/debian
cp -R debian /home/jenkins/couchdb/apache-couchdb-3.3.3-4c52700
cd /home/jenkins/couchdb/apache-couchdb-3.3.3-4c52700 && dch -v 3.3.3-4c52700~bullseye "Automatically generated package from upstream."
cd /home/jenkins/couchdb/apache-couchdb-3.3.3-4c52700 && dpkg-buildpackage -b -us -uc
dpkg-buildpackage: info: source package couchdb
dpkg-buildpackage: info: source version 3.3.3-4c52700~bullseye
dpkg-buildpackage: info: source distribution UNRELEASED
dpkg-buildpackage: info: source changed by "CouchDB Developers" <"dev@couchdb.apache.org">
 dpkg-source --before-build .
dpkg-buildpackage: info: host architecture ppc64el
dpkg-source: info: using options from apache-couchdb-3.3.3-4c52700/debian/source/options: --compression=bzip2 --compression-level=9
 debian/rules clean
make[1]: Entering directory '/home/jenkins/couchdb/apache-couchdb-3.3.3-4c52700'
dh clean --with=systemd
dh: warning: Compatibility levels before 10 are deprecated (level 9 in use)
   debian/rules override_dh_auto_clean
make[2]: Entering directory '/home/jenkins/couchdb/apache-couchdb-3.3.3-4c52700'
dh_auto_clean
dh_auto_clean: warning: Compatibility levels before 10 are deprecated (level 9 in use)
	make -j1 distclean
make[3]: Entering directory '/home/jenkins/couchdb/apache-couchdb-3.3.3-4c52700'

...

Downloading https://services.gradle.org/distributions/gradle-8.6-bin.zip
............10%.............20%............30%.............40%.............50%............60%.............70%.............80%............90%.............100%

Welcome to Gradle 8.6!

Here are the highlights of this release:
 - Configurable encryption key for configuration cache
 - Build init improvements
 - Build authoring improvements

For more details see https://docs.gradle.org/8.6/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)
> Task :spotlessInternalRegisterDependencies
> Task :spotlessJava
Step 'removeUnusedImports' found problem in 'src/main/java/org/apache/couchdb/nouveau/lucene9/Lucene9Index.java':
2:7: error: class, interface, or enum expected
com.google.googlejavaformat.java.FormatterException: 2:7: error: class, interface, or enum expected
	at com.google.googlejavaformat.java.FormatterException.fromJavacDiagnostics(FormatterException.java:51)
	at com.google.googlejavaformat.java.RemoveUnusedImports.parse(RemoveUnusedImports.java:264)
	at com.google.googlejavaformat.java.RemoveUnusedImports.removeUnusedImports(RemoveUnusedImports.java:218)
	at com.diffplug.spotless.glue.java.GoogleJavaFormatRemoveUnusedImporterFormatterFunc.apply(GoogleJavaFormatRemoveUnusedImporterFormatterFunc.java:38)
	at com.diffplug.spotless.FormatterFunc.apply(FormatterFunc.java:32)
	at com.diffplug.spotless.FormatterStepImpl$Standard.format(FormatterStepImpl.java:82)
	at com.diffplug.spotless.FormatterStep$Strict.format(FormatterStep.java:103)
	at com.diffplug.spotless.Formatter.compute(Formatter.java:246)
	at com.diffplug.spotless.PaddedCell.calculateDirtyState(PaddedCell.java:214)
	at com.diffplug.spotless.PaddedCell.calculateDirtyState(PaddedCell.java:190)
	at com.diffplug.gradle.spotless.SpotlessTaskImpl.processInputFile(SpotlessTaskImpl.java:105)
	at com.diffplug.gradle.spotless.SpotlessTaskImpl.performAction(SpotlessTaskImpl.java:89)
	at java.base@11.0.23/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base@11.0.23/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base@11.0.23/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base@11.0.23/java.lang.reflect.Method.invoke(Method.java:566)
	at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
	at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:45)
	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
	at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.execute(IncrementalTaskAction.java:26)
	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
	at org.gradle.api.internal.tasks.execution.TaskExecution$3.run(TaskExecution.java:247)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
	at org.gradle.api.internal.tasks.execution.TaskExecution.executeAction(TaskExecution.java:232)
	at org.gradle.api.internal.tasks.execution.TaskExecution.executeActions(TaskExecution.java:215)
	at org.gradle.api.internal.tasks.execution.TaskExecution.executeWithPreviousOutputFiles(TaskExecution.java:198)
	at org.gradle.api.internal.tasks.execution.TaskExecution.execute(TaskExecution.java:165)
	at org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:105)
	at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:44)
	at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:59)
	at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:56)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
	at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:56)
	at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:44)
	at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:41)
	at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:74)
	at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:55)
	at org.gradle.internal.execution.steps.PreCreateOutputParentsStep.execute(PreCreateOutputParentsStep.java:50)
	at org.gradle.internal.execution.steps.PreCreateOutputParentsStep.execute(PreCreateOutputParentsStep.java:28)
	at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:67)
	at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:37)
	at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:61)
	at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:26)
	at org.gradle.internal.execution.steps.CaptureOutputsAfterExecutionStep.execute(CaptureOutputsAfterExecutionStep.java:64)
	at org.gradle.internal.execution.steps.CaptureOutputsAfterExecutionStep.execute(CaptureOutputsAfterExecutionStep.java:42)
	at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:40)
	at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:29)
	at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:189)
	at org.gradle.internal.execution.steps.BuildCacheStep.lambda$execute$1(BuildCacheStep.java:75)
	at org.gradle.internal.Either$Right.fold(Either.java:175)
	at org.gradle.internal.execution.caching.CachingState.fold(CachingState.java:59)
	at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:73)
	at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:48)
	at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:44)
	at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:33)
	at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:76)
	at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$2(SkipUpToDateStep.java:54)
	at java.base@11.0.23/java.util.Optional.orElseGet(Optional.java:369)
	at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:54)
	at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:36)
	at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:65)
	at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:36)
	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
	at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:76)
	at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:37)
	at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:106)
	at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:55)
	at org.gradle.internal.execution.steps.AbstractCaptureStateBeforeExecutionStep.execute(AbstractCaptureStateBeforeExecutionStep.java:64)
	at org.gradle.internal.execution.steps.AbstractCaptureStateBeforeExecutionStep.execute(AbstractCaptureStateBeforeExecutionStep.java:43)
	at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.executeWithNonEmptySources(AbstractSkipEmptyWorkStep.java:125)
	at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.execute(AbstractSkipEmptyWorkStep.java:56)
	at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.execute(AbstractSkipEmptyWorkStep.java:36)
	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
	at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:36)
	at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:23)
	at org.gradle.internal.execution.steps.HandleStaleOutputsStep.execute(HandleStaleOutputsStep.java:75)
	at org.gradle.internal.execution.steps.HandleStaleOutputsStep.execute(HandleStaleOutputsStep.java:41)
	at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.lambda$execute$0(AssignMutableWorkspaceStep.java:35)
	at org.gradle.api.internal.tasks.execution.TaskExecution$4.withWorkspace(TaskExecution.java:292)
	at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.execute(AssignMutableWorkspaceStep.java:31)
	at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.execute(AssignMutableWorkspaceStep.java:22)
	at org.gradle.internal.execution.steps.ChoosePipelineStep.execute(ChoosePipelineStep.java:40)
	at org.gradle.internal.execution.steps.ChoosePipelineStep.execute(ChoosePipelineStep.java:23)
	at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.lambda$execute$2(ExecuteWorkBuildOperationFiringStep.java:66)
	at java.base@11.0.23/java.util.Optional.orElseGet(Optional.java:369)
	at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.execute(ExecuteWorkBuildOperationFiringStep.java:66)
	at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.execute(ExecuteWorkBuildOperationFiringStep.java:38)
	at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:36)
	at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:26)
	at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:47)
	at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:34)
	at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:61)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:145)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:134)
	at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
	at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74)
	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
	at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:331)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:318)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.lambda$execute$0(DefaultTaskExecutionGraph.java:314)
	at org.gradle.internal.operations.CurrentBuildOperationRef.with(CurrentBuildOperationRef.java:80)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:314)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:303)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
	at java.base@11.0.23/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base@11.0.23/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base@11.0.23/java.lang.Thread.run(Thread.java:829)

> Task :spotlessJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':spotlessJava'.
> Issue processing file: /home/jenkins/couchdb/apache-couchdb-3.3.3-4c52700/nouveau/src/main/java/org/apache/couchdb/nouveau/lucene9/Lucene9Index.java

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 3m 22s
2 actionable tasks: 2 executed
make[3]: *** [Makefile:556: nouveau] Error 1
make[3]: Leaving directory '/home/jenkins/couchdb/apache-couchdb-3.3.3-4c52700'
dh_auto_build: error: make -j1 release returned exit code 2
make[2]: *** [debian/rules:32: override_dh_auto_build] Error 25
make[2]: Leaving directory '/home/jenkins/couchdb/apache-couchdb-3.3.3-4c52700'
make[1]: *** [debian/rules:17: build] Error 2
make[1]: Leaving directory '/home/jenkins/couchdb/apache-couchdb-3.3.3-4c52700'
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
make: *** [Makefile:238: dpkg] Error 2

@rnewson
Copy link
Member Author

rnewson commented Jun 11, 2024

@nickva cannot reproduce that. I ran couchdb-pkg locally with a tarball of 4c52700, but it passes. the spotless error is a claim that Lucene9Index.java doesn't declare a class, which it clearly does, and it references line 2, which is a comment. So I suspect something else is going on, perhaps the file has some other content than expected (perhaps conflict markers?). Let's see if this is repeatable. if so, we'll need to tweak makefile to print this file to the build output

@nickva
Copy link
Contributor

nickva commented Jun 11, 2024

Thanks @rnewson, perhaps there is something flaky in my setup.

One step I forgot to mention is I rebased nouveau on main branch to make sure we're using OTP 25 in couchdb-pkg. If you get chance, could you rebase on main.

I try to re-run everything again. With a rebased nouveau branch, latest main commit 64bf1de, ./configure --without-proper && make && make dist to product the tarball, then ./build.sh couch-all ./...3.3.3-64bf1de.tar.gz. To eliminate the extra architecture issues (the above failure might have been the arm64), I'll build for x86_64 only for now.

UPDATE: x86_64 builds all worked when rebased on main (OTP 25)

src/couchdb-pkg (nouveau)$ tree pkgs
pkgs
├── couch
│   ├── centos-8
│   │   └── couchdb-3.3.3.64bf1de-1.el8.x86_64.rpm
│   ├── centos-9
│   │   └── couchdb-3.3.3.64bf1de-1.el9.x86_64.rpm
│   ├── debian-bookworm
│   │   ├── couchdb-dbgsym_3.3.3-64bf1de~bookworm_amd64.deb
│   │   ├── couchdb-nouveau_3.3.3-64bf1de~bookworm_amd64.deb
│   │   ├── couchdb_3.3.3-64bf1de~bookworm_amd64.buildinfo
│   │   ├── couchdb_3.3.3-64bf1de~bookworm_amd64.changes
│   │   └── couchdb_3.3.3-64bf1de~bookworm_amd64.deb
│   ├── debian-bullseye
│   │   ├── couchdb-dbgsym_3.3.3-64bf1de~bullseye_amd64.deb
│   │   ├── couchdb-nouveau_3.3.3-64bf1de~bullseye_amd64.deb
│   │   ├── couchdb_3.3.3-64bf1de~bullseye_amd64.buildinfo
│   │   ├── couchdb_3.3.3-64bf1de~bullseye_amd64.changes
│   │   └── couchdb_3.3.3-64bf1de~bullseye_amd64.deb
│   ├── ubuntu-focal
│   │   ├── couchdb-dbgsym_3.3.3-64bf1de~focal_amd64.ddeb
│   │   ├── couchdb-nouveau_3.3.3-64bf1de~focal_amd64.deb
│   │   ├── couchdb_3.3.3-64bf1de~focal_amd64.buildinfo
│   │   ├── couchdb_3.3.3-64bf1de~focal_amd64.changes
│   │   └── couchdb_3.3.3-64bf1de~focal_amd64.deb
│   └── ubuntu-jammy
│       ├── couchdb-dbgsym_3.3.3-64bf1de~jammy_amd64.ddeb
│       ├── couchdb-nouveau_3.3.3-64bf1de~jammy_amd64.deb
│       ├── couchdb_3.3.3-64bf1de~jammy_amd64.buildinfo
│       ├── couchdb_3.3.3-64bf1de~jammy_amd64.changes
│       └── couchdb_3.3.3-64bf1de~jammy_amd64.deb

@nickva
Copy link
Contributor

nickva commented Jun 11, 2024

I noticed the failure on ppc64el architecture. I'll try exclude it.

==> weatherreport (escriptize)
WARN:  'escriptize' command does not apply to directory /home/jenkins/couchdb/apache-couchdb-3.3.3-64bf1de/rel
WARN:  'escriptize' command does not apply to directory /home/jenkins/couchdb/apache-couchdb-3.3.3-64bf1de
Unknown privilege violation (03)
NIP 000000401a3da3b0   LR 0000004002add238 CTR 000000401a3da380 XER 0000000000000000 CPU#1
MSR 9000000102806901 HID0 0000000000000000  HF 02806105 iidx 0 didx 0
TB 00006518 27996706167885
GPR00 ffffffbffd038490 0000004002fc7970 0000004002c42d00 0000004002fc8b70
GPR04 0000000000000000 0000000000002000 0000000000000000 0000000000000000
GPR08 0000004002ca2d00 0000004002c6617c 0000000000000001 0000000000000000
GPR12 000000401a3da380 0000004002fd28f0 00000040018be468 0000000000000000
GPR16 0000004001872000 000000401a3da3a4 000000401a3da3ac 000000401a3da3d0
GPR20 000000401a3da3d8 0000004002c73f08 00000000000003d8 0000004004025ea0
GPR24 0000004004026278 0000004002fc79d0 0000004004025e90 0000004004025e50
GPR28 0000004002c66188 000000401a3da380 0000004002ca4c20 0000004002fc7970
CR 28004400  [ E  L  -  -  G  G  -  -  ]             RES 0000004002fc8b70
Downloading https://services.gradle.org/distributions/gradle-8.6-bin.zip
............10%.............20%............30%.............40%.............50%............60%.............70%.............80%............90%.............100%

Welcome to Gradle 8.6!

Here are the highlights of this release:
 - Configurable encryption key for configuration cache
 - Build init improvements
 - Build authoring improvements

For more details see https://docs.gradle.org/8.6/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)
> Task :spotlessInternalRegisterDependencies
> Task :spotlessJava
Step 'removeUnusedImports' found problem in 'src/main/java/org/apache/couchdb/nouveau/lucene9/Lucene9Index.java':
2:7: error: class, interface, or enum expected
com.google.googlejavaformat.java.FormatterException: 2:7: error: class, interface, or enum expected
	at com.google.googlejavaformat.java.FormatterException.fromJavacDiagnostics(FormatterException.java:51)
	at com.google.googlejavaformat.java.RemoveUnusedImports.parse(RemoveUnusedImports.java:264)
	at com.google.googlejavaformat.java.RemoveUnusedImports.removeUnusedImports(RemoveUnusedImports.java:218)
	at com.diffplug.spotless.glue.java.GoogleJavaFormatRemoveUnusedImporterFormatterFunc.apply(GoogleJavaFormatRemoveUnusedImporterFormatterFunc.java:38)
	at com.diffplug.spotless.FormatterFunc.apply(FormatterFunc.java:32)
	at com.diffplug.spotless.FormatterStepImpl$Standard.format(FormatterStepImpl.java:82)
	at com.diffplug.spotless.FormatterStep$Strict.format(FormatterStep.java:103)
	at com.diffplug.spotless.Formatter.compute(Formatter.java:246)
	at com.diffplug.spotless.PaddedCell.calculateDirtyState(PaddedCell.java:214)
	at com.diffplug.spotless.PaddedCell.calculateDirtyState(PaddedCell.java:190)

@nickva
Copy link
Contributor

nickva commented Jun 26, 2024

Thanks for updating the PR @rnewson. I gave it a try and rebuilt all the package with this PR (rebased on main)

$ tree pkgs/couch/
pkgs/couch/
├── centos-8
│   ├── couchdb-3.3.3.64bf1de-1.el8.s390x.rpm
│   └── couchdb-3.3.3.64bf1de-1.el8.x86_64.rpm
├── centos-9
│   ├── couchdb-3.3.3.64bf1de-1.el9.aarch64.rpm
│   ├── couchdb-3.3.3.64bf1de-1.el9.s390x.rpm
│   └── couchdb-3.3.3.64bf1de-1.el9.x86_64.rpm
├── debian-bookworm
│   ├── couchdb-dbgsym_3.3.3-64bf1de~bookworm_amd64.deb
│   ├── couchdb-dbgsym_3.3.3-64bf1de~bookworm_arm64.deb
│   ├── couchdb-dbgsym_3.3.3-64bf1de~bookworm_s390x.deb
│   ├── couchdb-nouveau_3.3.3-64bf1de~bookworm_amd64.deb
│   ├── couchdb-nouveau_3.3.3-64bf1de~bookworm_arm64.deb
│   ├── couchdb-nouveau_3.3.3-64bf1de~bookworm_s390x.deb
│   ├── couchdb_3.3.3-64bf1de~bookworm_amd64.buildinfo
│   ├── couchdb_3.3.3-64bf1de~bookworm_amd64.changes
│   ├── couchdb_3.3.3-64bf1de~bookworm_amd64.deb
│   ├── couchdb_3.3.3-64bf1de~bookworm_arm64.buildinfo
│   ├── couchdb_3.3.3-64bf1de~bookworm_arm64.changes
│   ├── couchdb_3.3.3-64bf1de~bookworm_arm64.deb
│   ├── couchdb_3.3.3-64bf1de~bookworm_s390x.buildinfo
│   ├── couchdb_3.3.3-64bf1de~bookworm_s390x.changes
│   └── couchdb_3.3.3-64bf1de~bookworm_s390x.deb
├── debian-bullseye
│   ├── couchdb-dbgsym_3.3.3-64bf1de~bullseye_amd64.deb
│   ├── couchdb-dbgsym_3.3.3-64bf1de~bullseye_arm64.deb
│   ├── couchdb-dbgsym_3.3.3-64bf1de~bullseye_s390x.deb
│   ├── couchdb-nouveau_3.3.3-64bf1de~bullseye_amd64.deb
│   ├── couchdb-nouveau_3.3.3-64bf1de~bullseye_arm64.deb
│   ├── couchdb-nouveau_3.3.3-64bf1de~bullseye_s390x.deb
│   ├── couchdb_3.3.3-64bf1de~bullseye_amd64.buildinfo
│   ├── couchdb_3.3.3-64bf1de~bullseye_amd64.changes
│   ├── couchdb_3.3.3-64bf1de~bullseye_amd64.deb
│   ├── couchdb_3.3.3-64bf1de~bullseye_arm64.buildinfo
│   ├── couchdb_3.3.3-64bf1de~bullseye_arm64.changes
│   ├── couchdb_3.3.3-64bf1de~bullseye_arm64.deb
│   ├── couchdb_3.3.3-64bf1de~bullseye_s390x.buildinfo
│   ├── couchdb_3.3.3-64bf1de~bullseye_s390x.changes
│   └── couchdb_3.3.3-64bf1de~bullseye_s390x.deb
├── ubuntu-focal
│   ├── couchdb-dbgsym_3.3.3-64bf1de~focal_amd64.ddeb
│   ├── couchdb-dbgsym_3.3.3-64bf1de~focal_arm64.ddeb
│   ├── couchdb-dbgsym_3.3.3-64bf1de~focal_s390x.ddeb
│   ├── couchdb-nouveau_3.3.3-64bf1de~focal_amd64.deb
│   ├── couchdb-nouveau_3.3.3-64bf1de~focal_arm64.deb
│   ├── couchdb-nouveau_3.3.3-64bf1de~focal_s390x.deb
│   ├── couchdb_3.3.3-64bf1de~focal_amd64.buildinfo
│   ├── couchdb_3.3.3-64bf1de~focal_amd64.changes
│   ├── couchdb_3.3.3-64bf1de~focal_amd64.deb
│   ├── couchdb_3.3.3-64bf1de~focal_arm64.buildinfo
│   ├── couchdb_3.3.3-64bf1de~focal_arm64.changes
│   ├── couchdb_3.3.3-64bf1de~focal_arm64.deb
│   ├── couchdb_3.3.3-64bf1de~focal_s390x.buildinfo
│   ├── couchdb_3.3.3-64bf1de~focal_s390x.changes
│   └── couchdb_3.3.3-64bf1de~focal_s390x.deb
└── ubuntu-jammy
    ├── couchdb-dbgsym_3.3.3-64bf1de~jammy_amd64.ddeb
    ├── couchdb-dbgsym_3.3.3-64bf1de~jammy_arm64.ddeb
    ├── couchdb-dbgsym_3.3.3-64bf1de~jammy_s390x.ddeb
    ├── couchdb-nouveau_3.3.3-64bf1de~jammy_amd64.deb
    ├── couchdb-nouveau_3.3.3-64bf1de~jammy_arm64.deb
    ├── couchdb-nouveau_3.3.3-64bf1de~jammy_s390x.deb
    ├── couchdb_3.3.3-64bf1de~jammy_amd64.buildinfo
    ├── couchdb_3.3.3-64bf1de~jammy_amd64.changes
    ├── couchdb_3.3.3-64bf1de~jammy_amd64.deb
    ├── couchdb_3.3.3-64bf1de~jammy_arm64.buildinfo
    ├── couchdb_3.3.3-64bf1de~jammy_arm64.changes
    ├── couchdb_3.3.3-64bf1de~jammy_arm64.deb
    ├── couchdb_3.3.3-64bf1de~jammy_s390x.buildinfo
    ├── couchdb_3.3.3-64bf1de~jammy_s390x.changes
    └── couchdb_3.3.3-64bf1de~jammy_s390x.deb

6 directories, 65 files

One of the arches, ppc64le failed. Made an issue: #140 so I disabled it. Taking the approach that given a choice, we'd rather have nouveau support vs ppc64le for now.

I tried installing just the couchdb package on a bullseye VM but still see the nouveau enabled despite only installing the base package:

root@debian11:/opt/couchdb/etc# grep -A3 nouveau default.ini 
[nouveau]
enable = true
url = http://127.0.0.1:5987

The dist tarball I used doesn't have it enabled, it's false so there is probably something the couchdb-pkg repo enabling it

@rnewson
Copy link
Member Author

rnewson commented Jun 26, 2024

can you read the postinst inside those files and check for this code?

        if [ "$RET" = "true" ] && [ -d "/opt/couchdb/etc/default.d" ]; then
            cat <<EOF > /opt/couchdb/etc/default.d/10-nouveau.ini                                                                                                                                                                                             
[nouveau]                                                                                                                                                                                                                                                     
enable = true                                                                                                                                                                                                                                                 
url = http://127.0.0.1:5987                                                                                                                                                                                                                                   
EOF                                                                                                                                                                                                                                                           
            chown couchdb:couchdb /opt/couchdb/etc/default.d/10-nouveau.ini
        fi
        ;;

@nickva
Copy link
Contributor

nickva commented Jun 26, 2024

The couchdb-nouveau package has it in the postinst script. Extracted the bits with ar to see. The package itself isn't installed.

@nickva
Copy link
Contributor

nickva commented Jun 26, 2024

It's probably this that's doing it:

couchdb-pkg/debian/rules

Lines 24 to 29 in 365d07c

override_dh_auto_configure:
if [ -d "./nouveau" ]; then \
./configure --spidermonkey-version $(SM_VER) --enable-nouveau; \
else \
./configure --spidermonkey-version $(SM_VER); \
fi

@nickva
Copy link
Contributor

nickva commented Jun 26, 2024

I am thinking of reverting that commit or fixing it such that we build all the artifacts (make release completes and produces all the nouveau bits) but we keep the configuration disabled by default so users get clean message about not having nouveau enabled, then nouveau deb package enables it with the .d ini file.

Maybe another approach is that it's "enabled" as it is currently but we have an runtime availability state, which pings with nouveau service and keeps a runtime state of up/not_up...

@rnewson rnewson force-pushed the nouveau branch 2 times, most recently from 0d9415a to aadcf31 Compare June 28, 2024 11:19
@rnewson
Copy link
Member Author

rnewson commented Jul 1, 2024

updated in light of apache/couchdb#5105 so that default.ini never gets the enabled = true setting.

@nickva
Copy link
Contributor

nickva commented Jul 1, 2024

thank you, I'll re-build the dist tarball from the latest main, rebuild the packages and re-test

@nickva
Copy link
Contributor

nickva commented Jul 3, 2024

I created the base CouchDB and Nouveau packages for Bullseye with the latest changes.

couchdb_3.3.3-95310c3~bullseye_amd64.deb 
couchdb-nouveau_3.3.3-95310c3~bullseye_amd64.deb 

Main package installed fine. Nouveau feature was disabled as expected.

With the running CouchDB server, installed the Nouveau package. Install went well, it asked for an option to enable it. I check it as "yes". I noticed the new .ini file was created in the right place and had the expected content.

Enabling Nouveau didn't take effect though after POST-ing to _node/_local/_config/_reload. That seems to be an issue with the config system. It doesn't know how to auto-detect a new .ini file during reload. Would we expect that to work? It might be nice to allow dynamic enablement via a config reload. But that's a minor issue I think.

Then I tried running a simple script which uses the _nouveau_analyze endpoint and runs a small query:
(The client is httpie: apt install httpie)

#!/bin/bash

set -x

http -b post $DB/_nouveau_analyze analyzer=standard text=for@bar@baz

http -b delete $DB/ndb
http -b put $DB/ndb

http  post $DB/ndb/_bulk_docs docs:='[{"_id":"1","a":"xxx"},{"_id":"2","a":"xxx"},{"_id":"3","a":"zzz"},{"_id":"4","a":"xxx"}]'
http -b put $DB/ndb/_design/nd1 nouveau:='{"idx1": {"index":"function(doc){index(\"string\",\"a\",doc.a,{\"store\":true})}"}}'
http -b post $DB/ndb/_design/nd1/_nouveau/idx1 q="a:xxx" limit:='2'

$DB is the server URL

DB=http://admin:pass@localhost:5984

Everything ran ok until the last query post $DB/ndb/_design/nd1/_nouveau/idx1, there it froze and the request didn't return.

Looking in CouchDB logs I noticed it was full of:

OS Process Error <0.20191.2> :: {os_process_error,{exit_status,1}}

Debugging further indicated that the base CouchDB deb package didn't install the server .js files. It was trying to run:

/bin/couchjs ./share/server/main.js`

But the installed files for base CouchDB package doesn't have that path.

debian11@debian11:/opt/couchdb$ ls share/
docs  www

Not sure why the file is not there, will have to debug further, later. So far it's as far as I got tonight.

@big-r81
Copy link
Contributor

big-r81 commented Jul 3, 2024

Enabling Nouveau didn't take effect though after POST-ing to _node/_local/_config/_reload. That seems to be an issue with the config system. It doesn't know how to auto-detect a new .ini file during reload. Would we expect that to work? It might be nice to allow dynamic enablement via a config reload. But that's a minor issue I think.

I think that’s because the list of ini files is loaded during the start of CouchDB and is “static” afterwards. Maybe we have to re-read those files on reload?

@big-r81
Copy link
Contributor

big-r81 commented Jul 3, 2024

Not sure why the file is not there, will have to debug further, later. So far it's as far as I got tonight.

Iirc I had something similar on Windows but I hadn’t time to dive in. My guess is some configure stuff with SM/Quickjs …

@rnewson
Copy link
Member Author

rnewson commented Jul 3, 2024

oh that's icky, that we don't notice new .ini files except at startup.

Copy link
Contributor

@nickva nickva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Nicely done!

I have fixes for the two issues noticed during the review, they are general issues and not related to this PR:

@rnewson rnewson merged commit aa9f9c2 into main Jul 4, 2024
@rnewson rnewson deleted the nouveau branch July 4, 2024 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants