ControlSystemStudio / phoebus

A framework and set of tools to monitor and operate large scale control systems, such as the ones in the accelerator community.
http://phoebus.org/
Eclipse Public License 1.0
92 stars 89 forks source link

Elog - Log Entry Calender and Table exceptions #3198

Open sifriede opened 19 hours ago

sifriede commented 19 hours ago

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 commented 18 hours ago

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 commented 17 hours ago

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 commented 17 hours ago

Dear George,

In a talk by Florian he showed,that it did work in 2020 with the search string. https://indico.fhi-berlin.mpg.de/event/52/contributions/564/attachments/222/683/phoebus-elog-client.pdf

As far as I know, Florian is not actively maintaining the elog app anymore.

Do you have any idea what could have changed this behavior? Elog was fixed for newer versions of Phoebus in the codeathon 2023, right?

Best regards


Von: Georg Weiss Gesendet: Fri Nov 22 18:41:38 GMT+01:00 2024 An: ControlSystemStudio/phoebus Cc: "Friederich, Dr. Simon" , Author Betreff: Re: [ControlSystemStudio/phoebus] Elog - Log Entry Calender and Table exceptions (Issue #3198)

In both applications the UI invokes a search based on the default query, e.g. search for log entries for the latest 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 @ffeldbauerhttps://github.com/ffeldbauer who I think is the original contributor of the elog module.

— Reply to this email directly, view it on GitHubhttps://github.com/ControlSystemStudio/phoebus/issues/3198#issuecomment-2494400417, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHDLLDPGQVQB44VUJKY6NBT2B5UFBAVCNFSM6AAAAABSJUOPBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJUGQYDANBRG4. You are receiving this because you authored the thread.Message ID: @.***>

georgweiss commented 16 hours ago

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 commented 14 hours ago

Dear Georg,

I have now downloaded the Source file and I have compiled phoebus-product as is:

...     [INFO] app-logbook ........................................ SUCCESS [  0.004 s]     [INFO] app-logbook-inmemory ............................... SUCCESS [  1.245 s]     [INFO] app-logbook-ui ..................................... SUCCESS [  3.257 s]     [INFO] app-logbook-olog ................................... SUCCESS [  0.003 s]     [INFO] app-logbook-olog-client ............................ SUCCESS [  1.114 s]     [INFO] app-logbook-olog-client-es ......................... SUCCESS [  1.661 s]     [INFO] app-logbook-olog-ui ................................ SUCCESS [  4.162 s]     [INFO] app-logbook-elog ................................... SUCCESS [  0.862 s] ...

I guess, I have now all apps included. Unfortunately, the error remains.

Best regards

Am 22.11.2024 um 20:13 schrieb Georg Weiss:

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|

— Reply to this email directly, view it on GitHub https://github.com/ControlSystemStudio/phoebus/issues/3198#issuecomment-2494607006, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHDLLDP2GZT7CZF2QK235BD2B565LAVCNFSM6AAAAABSJUOPBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJUGYYDOMBQGY. You are receiving this because you authored the thread.Message ID: @.***>

--------------xaZjcIhMX4F2J6nFbnOrUo5K Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: 8bit

<!DOCTYPE html>

Dear Georg,

I have now downloaded the Source file and I have compiled phoebus-product as is:

...
    [INFO] app-logbook ........................................ SUCCESS [  0.004 s]
    [INFO] app-logbook-inmemory ............................... SUCCESS [  1.245 s]
    [INFO] app-logbook-ui ..................................... SUCCESS [  3.257 s]
    [INFO] app-logbook-olog ................................... SUCCESS [  0.003 s]
    [INFO] app-logbook-olog-client ............................ SUCCESS [  1.114 s]
    [INFO] app-logbook-olog-client-es ......................... SUCCESS [  1.661 s]
    [INFO] app-logbook-olog-ui ................................ SUCCESS [  4.162 s]
    [INFO] app-logbook-elog ................................... SUCCESS [  0.862 s]
...

I guess, I have now all apps included. Unfortunately, the error remains.

Best regards

Am 22.11.2024 um 20:13 schrieb Georg Weiss:

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


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: <ControlSystemStudio/phoebus/issues/3198/2494607006@github.com>

--------------xaZjcIhMX4F2J6nFbnOrUo5K--

georgweiss commented 3 hours ago

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