Rest API installation

Hello,

I would like to use the rest tango API to develop a web GUI (with Ada Web Server) for a project using tango.
To test the possibility, I installed Tango's 9.3.4 package on a Debian buster. It seems to be ok for most applications (jive, pogo, astor) but not for tangorestserver. There is a java version problem. Version 1.8.x is too old. So I changed in the TangoRestServer bash to a newer version (version 11) and it seems to work.
I followed the explanations given on the link https://github.com/tango-controls/rest-server/wiki by creating a device server with jive then I ran "TangoRestServer test" and I got the following answer:
WARN 2021-02-02 11:36:26,772 [main - - o.t.c.d.Database] org.tango.client.database.Database.<init>:41 - database cache version release 1.13 not supported, please install it to have better performance
INFO 2021-02-02 11:36:26,929 [main - test/rest/0 - o.t.TangoRestServer] org.tango.TangoRestServer.init:145 - Initializing TangoRestServer device…
WARN 2021-02-02 11:36:26,940 [main - test/rest/0 - o.t.s.e.EventManager] org.tango.server.events.EventManager.initializeClientHwm:145 - CtrlSystem/EventBufferHwm property is not a number:
INFO 2021-02-02 11:36:27,025 [main - test/rest/0 - o.t.s.ServerManager] org.tango.server.ServerManager.init:265 - TANGO server TangoRestServer/test started
WARN 2021-02-02 11:36:27,026 [main - test/rest/0 - o.t.s.ServerManagerUtils] org.tango.server.ServerManagerUtils.dumpPID:47 - Failed to create pid file /var/tmp/TangoRestServer/TangoRestServer.pid due to java.nio.file.NoSuchFileException: TangoRestServer.pid
Exception in thread "main" java.lang.RuntimeException: java.nio.file.NoSuchFileException: /var/tmp/TangoRestServer/tomcat_4274159224536421215
at org.tango.web.server.tomcat.TomcatBootstrap.initializeBaseDir(TomcatBootstrap.java:74)
at org.tango.TangoRestServer.startTomcat(TangoRestServer.java:126)
at org.tango.TangoRestServer.main(TangoRestServer.java:118)
Caused by: java.nio.file.NoSuchFileException: /var/tmp/TangoRestServer/tomcat_4274159224536421215
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
at java.base/sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:389)
at java.base/java.nio.file.Files.createDirectory(Files.java:689)
at java.base/java.nio.file.TempFileHelper.create(TempFileHelper.java:135)
at java.base/java.nio.file.TempFileHelper.createTempDirectory(TempFileHelper.java:172)
at java.base/java.nio.file.Files.createTempDirectory(Files.java:965)
at org.tango.web.server.tomcat.TomcatBootstrap.initializeBaseDir(TomcatBootstrap.java:64)
… 2 more

I then run the following command in another terminal :

curl -u "tango-cs: tango" http: // localhost: 10001 / tango / rest

and I have the following answer:

curl: (7) Failed to connect to localhost port 10001: Connection refused

What did I do wrong or forget?

Thanks for the answer
Looks like your instance of TangoRestServer does not have permissions to create a temporary file/dir, which is required for proper running. Another reason could be insufficient space. Please check those issues. Thanks
For your convenience I have updated the wiki page of the rest-server.

Cheers,
Hi,

The rights are 777 and there is enough space
It looks like it's good. It was just the TangoRestServer directory (LOG_HOME environment variable from the TangoRestServer bash) which was not created in the /var /tmp directory. I continue !!!!
 
Register or login to create to post a reply.