bugy / script-server

Web UI for your scripts with execution management
Other
1.59k stars 247 forks source link

Initialization failure due to failure to read log files #701

Open pedro7x opened 1 year ago

pedro7x commented 1 year ago

Depending on the characters present in the "command" parameter of the log files (log files generated by the script-server itself). The program does not start and generates the following error message:

  File "/opt/script-server/src/execution/logging.py", line 328, in _parameters_to_entry
    entry.start_time = ms_to_datetime(int(start_time))
ValueError: invalid literal for int() with base 10: '1686740150897\ncommand:python3 evento.py grupo PROBLEMA Data/Horário     : 20230614/062023.863946                               \x85   \x85

If I remove the special characters from the log file, the program starts normally.

I'm also able to start with the workaround below:

diff -uNr src/execution/logging.py_ORIG src/execution/logging.py
--- src/execution/logging.py_ORIG   2023-09-30 05:47:43.262481144 -0300
+++ src/execution/logging.py    2023-09-30 06:08:40.631369683 -0300
@@ -325,7 +325,8 @@

         start_time = parameters.get('start_time')
         if start_time:
-            entry.start_time = ms_to_datetime(int(start_time))
+            #entry.start_time = ms_to_datetime(int(start_time))
+            entry.start_time = ms_to_datetime(int(start_time.split('\n')[0]))

         return entry

I am using the latest release version available (1.18.0).

bugy commented 1 year ago

Hi @pedro7x thanks for reporting!