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

Docker Opengrok 1.13: Opengrok UI complains "Error You must select a project!" #4657

Open
subramaniam opened this issue Sep 8, 2024 · 4 comments

Comments

@subramaniam
Copy link

Describe the bug
I am trying to use the 1.13 version of Opengrok docker image. Irrespective of the git repo (or non-version controlled code base) I use, the container comes up, and prints the following message:

08-Sep-2024 03:30:40.124 INFO [main] org.opengrok.indexer.Metrics.<clinit> configuring PrometheusRegistry SLF4J(W): No SLF4J providers were found. SLF4J(W): Defaulting to no-operation (NOP) logger implementation SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details. SLF4J(W): Class path contains SLF4J bindings targeting slf4j-api versions 1.7.x or earlier. SLF4J(W): Ignoring binding found at [jar:file:/usr/local/tomcat/webapps/ROOT/WEB-INF/lib/slf4j-nop-1.7.30.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J(W): See https://www.slf4j.org/codes.html#ignoredBindings for an explanation. 08-Sep-2024 03:30:40.235 INFO [main] org.opengrok.web.WebappListener.contextInitialized Starting webapp with version 1.13.20 (ced8af1d5d9a145836a1ea4a0a7e9cbc07efa6ab) 08-Sep-2024 03:30:40.237 INFO [main] org.opengrok.indexer.configuration.Configuration.read Reading configuration from /opengrok/etc/configuration.xml 08-Sep-2024 03:30:40.308 INFO [main] org.opengrok.web.WebappListener.contextInitialized running inside Apache Tomcat/10.1.28 08-Sep-2024 03:30:40.312 WARNING [main] org.opengrok.indexer.framework.PluginFramework.reload Plugin directory '/opengrok/data/../plugins' not found or not readable: All requests allowed. 08-Sep-2024 03:30:40.316 INFO [main] org.opengrok.indexer.configuration.Configuration.read Reading configuration from /opengrok/etc/configuration.xml 08-Sep-2024 03:30:40.326 INFO [OpenGrok-index-check-16] org.opengrok.indexer.index.IndexCheck.checkDirWithLogging Checking index in '/opengrok/data/index/bin' (mode VERSION) 08-Sep-2024 03:30:40.347 WARNING [OpenGrok-index-check-16] org.opengrok.indexer.index.IndexCheck.checkVersion no index found in 'MMapDirectory@/opengrok/data/index/bin lockFactory=org.apache.lucene.store.NativeF SLockFactory@2e2b42a4' 08-Sep-2024 03:30:40.347 INFO [OpenGrok-index-check-16] org.opengrok.indexer.index.IndexCheck.checkDirWithLogging Index check for directory '/opengrok/data/index/bin' passed 08-Sep-2024 03:30:40.678 INFO [Thread-2] org.opengrok.suggest.Suggester.init No index directories found, exiting... 08-Sep-2024 03:30:40.694 INFO [Thread-2] org.opengrok.web.api.v1.suggester.provider.service.impl.SuggesterServiceImpl.scheduleRebuild Scheduling suggester rebuild in PT20H29M19.320962267S 08-Sep-2024 03:30:41.327 INFO [main] org.hibernate.validator.internal.util.Version.<clinit> HV000001: Hibernate Validator 8.0.1.Final 08-Sep-2024 03:30:41.590 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/local/tomcat/webapps/ROOT.war] has finished in [4,283] ms 08-Sep-2024 03:30:41.591 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/source] 08-Sep-2024 03:30:41.614 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs th at were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 08-Sep-2024 03:30:41.615 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/source] has finished in [24] ms 08-Sep-2024 03:30:41.618 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"] 08-Sep-202r 03:30:41.628 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [4386] milliseconds Tomcat is ready Adding project .vim 08-Sep-2024 03:30:42.137 INFO [http-nio-8080-exec-5] org.opengrok.web.api.v1.controller.ProjectsController.addProject adding project .vim

If you provide the exact version of OpenGrok, JDK used, OS(and its version) used and Tomcat(or your webapp server) used it can help figuring out an environment issue.
For performance problem OS and JDK tunables might be needed. For SCM problems also version of SCM is helpfull (e.g. some mercurial versions have issues, some not).
`]
root@0ed711246e71:/usr/local/tomcat# java -version
openjdk version "17.0.12" 2024-07-16
OpenJDK Runtime Environment Temurin-17.0.12+7 (build 17.0.12+7)
OpenJDK 64-Bit Server VM Temurin-17.0.12+7 (build 17.0.12+7, mixed mode, sharing)

root@0ed711246e71:/usr/local/tomcat# uname -ra
Linux 0ed711246e71 6.8.0-40-generic #40~22.04.3-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 30 17:30:19 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

root@0ed711246e71:/usr/local/tomcat# cat /proc/12/cmdline
/opt/java/openjdk/bin/java-Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager--add-exports=java.base/jdk.internal.ref=ALL-UNNAMED--add-exports=java.base/sun.nio.ch=ALL-UNNAMED--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED--add-opens=jdk.compiler/com.sun.tools.javac=ALL-UNNAMED--add-opens=java.base/java.lang=ALL-UNNAMED--add-opens=java.base/java.lang.reflect=ALL-UNNAMED--add-opens=java.base/java.io=ALL-UNNAMED--add-opens=java.base/java.util=ALL-UNNAMED-Djdk.tls.ephemeralDHKeySize=2048-Djava.protocol.handler.pkgs=org.apache.catalina.webresources-Dorg.apache.catalina.security.SecurityListener.UMASK=0027--add-opens=java.base/java.lang=ALL-UNNAMED--add-opens=java.base/java.io=ALL-UNNAMED--add-opens=java.base/java.util=ALL-UNNAMED--add-opens=java.base/java.util.concurrent=ALL-UNNAMED--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED-classpath/usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar-Dcatalina.base=/usr/local/tomcat-Dcatalina.home=/usr/local/tomcat-Djava.io.tmpdir=/opengrok/data/tomcat_temporg.apache.catalina.startup.Bootstrapstartroot@0ed711246e71:/usr/local/tomcat#
`

To Reproduce
Steps to reproduce the behavior:
Use 1.13 docker image and launch docker
Command used:
docker --config ~/.docker/no_proxy/ run -d -v /data/git/<gitrepo>/:/opengrok/src -p 8080:8080 opengrok/docker:1.13
Expected behavior
A clear and concise description of what you expected to happen.
Opengrok search should work as expected.

Screenshots
If applicable, add screenshots to help explain your problem.
image

Additional context
Add any other context about the problem here.

Full log

Directory contents of the git repo. Yes it doesn't have any source codes for now. I picked this to demonstrate the problem.
`
tree .
.
├── bin
│   ├── dev-setup-android-tc
│   ├── dev-setup-kernel
│   ├── dev-setup-uboot
│   ├── git_diff_wrapper
│   ├── sdcard-format.sh
│   └── setup-minicom
├── copy-files.sh
├── first-run.sh
└── README

1 directory, 9 files

`

@subramaniam
Copy link
Author

I tried in 3 different setups:

  1. ubuntu 22.04 host with opengrok 1.13 docker image.
  2. ubuntu 22.04 host with opengrok 1.13 docker image with proxy behind my work network.
  3. Windows 10 with WSL and docker host with opengrok 1.13 docker image.

Noticed that I see the issue only with the ubuntu 22.04 host. Not sure if that is any indication to why this is happening.
docker_windows-wsl.log
docker_linux_ubuntu_22.04.log

@subramaniam
Copy link
Author

Further, looking at the failing and working logs attached in the previous message, it looks like there was a failure executing one of the commands:
08-Sep-2024 21:25:15.582 WARNING [OpenGrok-index-db-107] org.opengrok.indexer.util.Executor.exec Non-zero exit status 1 from command

Unfortunately, it doesn't show the rest of the exception. Any thoughts on enabling more logging?

@subramaniam
Copy link
Author

Hello All,

I was able to get the indexer to run by explicitly invoking it from the container bash.

I used the following command and that worked (referred from here: https://github.com/oracle/opengrok/wiki/How-to-setup-OpenGrok#step3---indexing)
java \ -Djava.util.logging.config.file=/opengrok/doc/logging.properties \ -jar /opengrok/lib/opengrok.jar \ -c /usr/local/bin/ctags \ -s /opengrok/src -d /opengrok/data -H -P -S -G \ -W /opengrok/etc/configuration.xml -U http://localhost:8080/

I have a couple of questions:

  1. Is there a need to explicitly do this? Should I have a docker compose file that does this after it launches the container?
  2. Is there a workflow that illustrates the various steps that are needed? If there is a document that I can refer, I can put together a flowchart for everyone's benefit.
  3. Also, is the difference in behavior between the WSL host and ubuntu host expected?

Thank you in advance

@subramaniam
Copy link
Author

Hi There,

Any feedback on this issue?

Thank you in advance.

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

No branches or pull requests

1 participant