EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <20242025  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <20242025 
<== Date ==> <== Thread ==>

Subject: Re: Phoebus Olog and Web Client
From: "Wang, Lin via Tech-talk" <tech-talk at aps.anl.gov>
To: "Dr. Simon Friederich" <s.friederich at uni-mainz.de>
Cc: tech-talk at aps.anl.gov
Date: Thu, 3 Oct 2024 18:53:01 +0800 (GMT+08:00)
Hello Simon,

Since my network connection to Docker Hub and NPM are very slow, I cannot do enough test regarding why your docker deployment does not work. 

But typically, the "Search Error, Could not reach the logbook service" error is because the configuration of REACT_APP_BASE_URL (which points to the Olog service) in phoebus-olog-web-client is incorrect or does not take effect.

I think there are several ways to configure REACT_APP_BASE_URL:
1. Set the OS environment variable REACT_APP_BASE_URL.
2. Create a .env file that includes the definition of REACT_APP_BASE_URL, which you already did.
3. Directly modify the following line in phoebus-olog-web-client/src/config/customization.js:
   APP_BASE_URL: process.env.REACT_APP_BASE_URL, // e.g. https://urldefense.us/v3/__http://localhost:8080/Olog__;!!G_uCfscf7eWS!fKSB5ntdYapdGFnt6RPEuKCY16cnJCLYSLmDWmiv1rZFgypEgfJ2gogZlNw07NzWaPni1nyGVlT72rpdqzAGmGE$ 
   for example to
   APP_BASE_URL: 'https://urldefense.us/v3/__http://olog-service-ip-address:8080/Olog__;!!G_uCfscf7eWS!fKSB5ntdYapdGFnt6RPEuKCY16cnJCLYSLmDWmiv1rZFgypEgfJ2gogZlNw07NzWaPni1nyGVlT72rpd-4JIKHk$ ', // e.g. https://urldefense.us/v3/__http://localhost:8080/Olog__;!!G_uCfscf7eWS!fKSB5ntdYapdGFnt6RPEuKCY16cnJCLYSLmDWmiv1rZFgypEgfJ2gogZlNw07NzWaPni1nyGVlT72rpdqzAGmGE$ 

One debug method can be used to check whether the REACT_APP_BASE_URL is configured successfully, that is, 
press the F12 key on the web browser to open debug mode and navigate to "Network" tab, then check which URL has actually been sent. 
Attached is a screenshot in my environment.


Regards,
Lin


> -----原始邮件-----
> 发件人: "Dr. Simon Friederich via Tech-talk" <tech-talk at aps.anl.gov>
> 发送时间:2024-10-03 03:59:21 (星期四)
> 收件人: tech-talk at aps.anl.gov
> 主题: [SPAM] Phoebus Olog and Web Client
> 
> Dear Kunal,
> Dear George,
> Dear Phoebus-Olog-Team,
> 
> Phoebus Olog:
> I am currently testing olog as your modern alternative for elog.
> Thanks to your example from the repository [1], I have now a running 
> elasticsearch, mongo and olog service.
> I can access it via Phoebus with the settings.ini:
> 
>      ################################
>      # Package org.phoebus.olog.es.api
>      #################################
>      org.phoebus.logbook/logbook_factory=olog-es
>      org.phoebus.olog.es.api/olog_url=https://urldefense.us/v3/__http://testmesaolog:8080/Olog__;!!G_uCfscf7eWS!dso4dmkrF-LWpZlpdNz3MRexqz8vRrLcyJnfweqt58VzNYt-zlwPQTyYVFpwEeDeXJQs8xSu-UMk4ZV4BLuBn_nBCHrJ8zzX$ 
>      org.phoebus.olog.es.api/username=user
>      org.phoebus.olog.es.api/password=userPass
> 
> But I have some further questions I was not able to figure out for myself:
> - If I run the olog-docker I am in a demo mode with a user admin and user?
> - How do I customize my olog? I have found a cuple of files in 
> phoebus-olog/src/main/resources. You mention a special github repository 
> where only application.properties is used for this [2].
> - Can I change these properties any time? (e.g. I need more logbooks, 
> different users or tags?)
> - How do I add/remove users and/or groups? I do not quite understand the 
> correct syntax in application.properties. Could you provide an example?
>    E.g. I want admin, operator, rfeng, cryoeng. If it's not mandatory, I 
> don't want to use the LDAP service, unless it makes everything easier.
> - Where are the logbooks stored and how would you backup them?
> - I have these two docker-managed volumes esdata and mongodata in the 
> docker-compose.yml file. Are these important to backup?
> - Can I use a mongo-GUI like mongodb compass to manage the logbook or is 
> mongo only a backend? (Sorry for such questions, but I am not familiar 
> with this yet)
> 
> Web client:
> Then I need to access the logbooks via webbrowser. Hence, I've looked at 
> your phoebus-olog-web-client [3].
> Based on your Dockerfile I've set up a docker container in the same 
> network "olognet" where elastic, monogo and olog reside (though the 
> ports are published on localhost) with a docker-compose file:
> Dockerfile:
> 
>      # Node 18
>      FROM node:22-alpine
>      # FROM node:18-alpine
>      RUN apk update && apk add curl bash
>      WORKDIR /app
>      ENV PATH=/app/node_modules/.bin:$PATH
>      COPY . ./
>      RUN npm ci --silent \
>          && npx update-browserslist-db@latest
>          #  \
>          # && npm run build \
>          # && npm install -g serve
> 
>      # start app
>      CMD ["npm", "start"]
>      # CMD ["serve", "-s", "build"]
> 
> docker-compose.yml
> 
>      networks:
>        olognet:
>          external: true
> 
>      services:
>        olog-web:
>          container_name: "olog-web"
>          build: .
>          ports:
>            - "3000:3000"
>            # - "6006:6006" # storybook for testing
>          environment:
>            TZ: Europe/Berlin
>            # REACT_APP_BASE_URL: https://urldefense.us/v3/__http://olog:8080/Olog__;!!G_uCfscf7eWS!dso4dmkrF-LWpZlpdNz3MRexqz8vRrLcyJnfweqt58VzNYt-zlwPQTyYVFpwEeDeXJQs8xSu-UMk4ZV4BLuBn_nBCK794Uuc$  # specified in 
> .env file
>          stdin_open: true # docker run -i, debug
>          tty: true        # docker run -t, debug
>          networks:
>            - olognet
>          # command: ["/bin/bash"] # debug
> 
> 
> I've also copied .env.example to .env and adopted to 
> REACT_APP_BASE_URL=https://urldefense.us/v3/__http://olog:8080/Olog__;!!G_uCfscf7eWS!dso4dmkrF-LWpZlpdNz3MRexqz8vRrLcyJnfweqt58VzNYt-zlwPQTyYVFpwEeDeXJQs8xSu-UMk4ZV4BLuBn_nBCK794Uuc$ .
>  From within the olog-web-container I can ping the olog container and 
> see the expected answer when running curl:
>      21e0630b20ba:/app# curl https://urldefense.us/v3/__http://olog:8080/Olog__;!!G_uCfscf7eWS!dso4dmkrF-LWpZlpdNz3MRexqz8vRrLcyJnfweqt58VzNYt-zlwPQTyYVFpwEeDeXJQs8xSu-UMk4ZV4BLuBn_nBCK794Uuc$ 
>      {
>        "name" : "Olog Service",
>        "version" : "5.0.0-SNAPSHOT",
>        "elastic" : {
>          "status" : "Connected",
>          "clusterName" : "elasticsearch",
>          "clusterUuid" : "h-dKVMuFTJSlXb0gxeFn2w",
>          "version" : 
> "co.elastic.clients.elasticsearch._types.ElasticsearchVersionInfo@78b8c4e7",
>          "elasticHost" : "elastic",
>          "elasticPort" : "9200"
>        },
>        "mongoDB" : "{type=STANDALONE, servers=[{address=mongo:27017, 
> type=STANDALONE, roundTripTime=0.5 ms, state=CONNECTED}]",
>        "serverConfig" : {
>          "maxFileSize" : 50.0,
>          "maxRequestSize" : 100.0
>        }
> 
> Yet, if I access the web view on port 3000 it show the error message:
>      Search Error
>      Could not reach the logbook service
> 
> So my question is do you see my mistake or can you tell me how to debug 
> my issue?
> 
> Thank you very much in advance
> Best regards
> Simon
> 
> [1] https://urldefense.us/v3/__https://github.com/Olog/phoebus-olog__;!!G_uCfscf7eWS!dso4dmkrF-LWpZlpdNz3MRexqz8vRrLcyJnfweqt58VzNYt-zlwPQTyYVFpwEeDeXJQs8xSu-UMk4ZV4BLuBn_nBCAMBxssS$ 
> [2] https://urldefense.us/v3/__https://github.com/willrogers/olog-es-docker__;!!G_uCfscf7eWS!dso4dmkrF-LWpZlpdNz3MRexqz8vRrLcyJnfweqt58VzNYt-zlwPQTyYVFpwEeDeXJQs8xSu-UMk4ZV4BLuBn_nBCAEkg_SM$ 
> [3] https://urldefense.us/v3/__https://github.com/Olog/phoebus-olog-web-client__;!!G_uCfscf7eWS!dso4dmkrF-LWpZlpdNz3MRexqz8vRrLcyJnfweqt58VzNYt-zlwPQTyYVFpwEeDeXJQs8xSu-UMk4ZV4BLuBn_nBCDdGhnsq$ 
> 
> 
> -- 
> Dr. Simon Friederich
> Institute of Nuclear Physics
> Collaboration B | MESA
> Johannes Gutenberg-Universität Mainz
> Johann-Joachim-Becherweg 45
> 55128 Mainz, Germany
> 
> phone: +49 (0)6131 39-23160
> E-Mail: s.friederich at uni-mainz.de

Attachment: olog_service_address_check.png
Description: PNG image


Replies:
Re: Phoebus Olog and Web Client Dr. Simon Friederich via Tech-talk
References:
Phoebus Olog and Web Client Dr. Simon Friederich via Tech-talk

Navigate by Date:
Prev: Re: [EXTERNAL] Phoebus toolbar_entries Kasemir, Kay via Tech-talk
Next: Re: OPCUA SSL problem Ralph Lange via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <20242025 
Navigate by Thread:
Prev: Phoebus Olog and Web Client Dr. Simon Friederich via Tech-talk
Next: Re: Phoebus Olog and Web Client Dr. Simon Friederich via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <20242025 
ANJ, 08 Oct 2024 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions ·
· Download · Search · IRMIS · Talk · Documents · Links · Licensing ·