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

Elog - Log Entry Calender and Table exceptions #3198

Open
sifriede opened this issue Nov 22, 2024 · 15 comments
Open

Elog - Log Entry Calender and Table exceptions #3198

sifriede opened this issue Nov 22, 2024 · 15 comments

Comments

@sifriede
Copy link

Dear Phoebus team and developer,

Short description

I get exceptions, when I try to use the Log Entry Calender and Table with elog.

My environment

Phoebus version

I used the latest release version:
https://github.com/ControlSystemStudio/phoebus/releases/download/v4.7.3/Phoebus-4.7.3-linux.tar.gz

OS

OS=Debian 12 (bookworm)
JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
CS STUDIO Version=4.7.3
JAVA VERSION=Oracle Corporation 17.0.13+11-Debian-2deb12u1
JAVA FX Version = 19+11

settings.ini

org.phoebus.logbook.ui/logbook_factory=elog
org.phoebus.logbook/logbook_factory=elog
org.phoebus.elog.api/elog_url=http://elog.mesa.kph/mesa/
org.phoebus.elog.api/categories=
org.phoebus.elog.api/types=
org.phoebus.elog.api/username=mesa
org.phoebus.elog.api/password=<actually_hashed_password_read_from_elog_passwordfile>

elog logbook config

Based on Florian Feldbauers example

Attributes = Author, Type, Category, Subject
Options Type = Routine, Software Installation, Problem Fixed, Configuration, Other
Options Category = General, Hardware, Software, Network, Other, TODO, STEAM
Extendable Options = Category
Required Attributes = Author, Type
Page Title = ELOG - $subject

Problem description

Using "Send to Logbook" I can successfully add entries to the elog. If I click on logbooks or tags I retrieve the corresponding types and categories defined in elog automatically. I see these entries in the elog web view.

But if I use the Log Entry Calender or Table, I retrieve the following exceptions and don't see any log entries:

Log Entry Calender

org.phoebus.logbook.LogbookException: java.lang.UnsupportedOperationException
	at org.phoebus.logbook.LogClient.search(LogClient.java:494)
	at org.phoebus.logbook.olog.ui.LogbookSearchJob.lambda$getRunnable$0(LogbookSearchJob.java:63)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.UnsupportedOperationException

Log Entry Table

Exception in thread "JavaFX Application Thread" java.lang.NullPointerException: Cannot invoke "java.lang.Exception.getMessage()" because "exception" is null
	at org.phoebus.ui.dialog.ExceptionDetailsErrorDialog.doOpenError(ExceptionDetailsErrorDialog.java:96)
	at org.phoebus.ui.dialog.ExceptionDetailsErrorDialog.lambda$openError$1(ExceptionDetailsErrorDialog.java:62)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:316)
	at java.base/java.lang.Thread.run(Thread.java:840)

Thanks in advance.
Best regards
Simon

@georgweiss
Copy link
Collaborator

georgweiss commented Nov 22, 2024

In both applications the UI invokes a search based on the default query, e.g. search for log entries for the past 12 hours.
However, the elog LogClient does not implement the search method, and the default implementation throws an UnsupportedException.

I think you would need to reach out to @ffeldbauer who I think is the original contributor of the elog module.

@kasemir
Copy link
Collaborator

kasemir commented Nov 22, 2024

Aside from the logbook error, the ExceptionDetailsErrorDialog should be fixed.
You ought to see the error dialog, in this case then showing that there's an UnsupportedOperationException.

Not sure how the ExceptionDetailsErrorDialog is called in this case, maybe the exception needs to be passed on.
As a fallback, doOpenError should check if the exception is null and not crash.
https://github.com/ControlSystemStudio/phoebus/blob/master/core/ui/src/main/java/org/phoebus/ui/dialog/ExceptionDetailsErrorDialog.java

@sifriede
Copy link
Author

sifriede commented Nov 22, 2024 via email

@georgweiss
Copy link
Collaborator

OK.
Though I have not confirmed it, I think this could be a mismatch between the build and your settings. While the tar ball you reference includes the newer Olog UI, the elog module depends on the older UI as implemented in app-logbook-ui. In other words, you need to build a product that includes that module and excludes app-logbook-olog

@sifriede
Copy link
Author

sifriede commented Nov 22, 2024 via email

@georgweiss
Copy link
Collaborator

georgweiss commented Nov 23, 2024

I think your build still contains a bit too much... With the dependencies and exclusions I have defined in a build for your use case I have the following app-logbook related jars in the lib directory:

app-logbook-elog-4.7.4-SNAPSHOT.jar
app-logbook-ui-4.7.4-SNAPSHOT.jar

This configuration will launch the proper UI and query the elog supported endpoint when launched, i.e. call findLogs rather than search in the LogClient implementation.

@sifriede
Copy link
Author

sifriede commented Nov 25, 2024 via email

@georgweiss
Copy link
Collaborator

georgweiss commented Nov 26, 2024

Please make sure you have the following in your settings file for Phoebus:
org.phoebus.logbook.ui/default_logbook_query=search*

@sifriede
Copy link
Author

sifriede commented Nov 27, 2024 via email

@georgweiss
Copy link
Collaborator

Hi,

We do not have an elog service running, so I have no possibility debugging your issues.
I need more information, e.g. a stack trace triggered by a search from the client.

@sifriede
Copy link
Author

sifriede commented Dec 2, 2024

Dear George,
Does this log entry from elogd help (it runs with the "debug" flag -d)?

GET /mesaelog/?mode=summary&search=*&reverse=1&npp=20 HTTP/1.1
Returned 9171 bytes
GET /mesaelog/11 HTTP/1.1
Returned 3968 bytes
GET /mesaelog/11?cmd=download HTTP/1.1
Returned 442 bytes
GET /mesaelog/10 HTTP/1.1
Returned 4100 bytes
GET /mesaelog/10?cmd=download HTTP/1.1
Returned 508 bytes
GET /mesaelog/9 HTTP/1.1
Returned 3964 bytes
GET /mesaelog/9?cmd=download HTTP/1.1
Returned 445 bytes
GET /mesaelog/8 HTTP/1.1
Returned 3984 bytes
GET /mesaelog/8?cmd=download HTTP/1.1
Returned 469 bytes
GET /mesaelog/7 HTTP/1.1
Returned 3967 bytes
GET /mesaelog/7?cmd=download HTTP/1.1
Returned 456 bytes
GET /mesaelog/6 HTTP/1.1
Returned 4054 bytes
GET /mesaelog/6?cmd=download HTTP/1.1
Returned 490 bytes
GET /mesaelog/5 HTTP/1.1
Returned 3948 bytes
GET /mesaelog/5?cmd=download HTTP/1.1
Returned 445 bytes
GET /mesaelog/3 HTTP/1.1
Returned 3933 bytes
GET /mesaelog/3?cmd=download HTTP/1.1
Returned 463 bytes
GET /mesaelog/2 HTTP/1.1
Returned 3939 bytes
GET /mesaelog/2?cmd=download HTTP/1.1
Returned 441 bytes
GET /mesaelog/1 HTTP/1.1
Returned 3966 bytes
GET /mesaelog/1?cmd=download HTTP/1.1
Returned 446 bytes

@georgweiss
Copy link
Collaborator

Hi,
So it seems the server accepts a search request from the client (first line), indicating that the client has sent it correctly.
The other lines indicate that the client is requesting log entries identified by id.
Based on this is looks as client is sending correct requests, but how these are handled by the client I cannot determine from the above.
Is there any stack trace or error log message on the client side?

@sifriede
Copy link
Author

sifriede commented Dec 3, 2024

Dear George,
Do you mean client = phoebus instance?
The error messages are (both appear for Calender and Table:
2024-12-03 11:11:08 INFO [org.phoebus.framework.jobs] Job 'searching logbook for : {search*=*}': Finished - Cancelled

  • I get a lot of the javafx-error messages, like shown above.

Can I somehow increase the error log level or did you mean something different?

@georgweiss
Copy link
Collaborator

Actually that message says that search is done in the background and then terminates. It's not an error message.
Maybe we could setup a Zoom or Teams meeting to make this conversation a bit more efficient?

@sifriede
Copy link
Author

sifriede commented Dec 3, 2024

Yes indeed, that would be great. Unfortunately today and tomorrow I am not available anymore but please feel free to write me [email protected] so that we can find a suitable appointment.

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

3 participants