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

Date fields are UTC even is php.ini has date.timezone configured #3

Closed
victoriofelipe opened this issue Sep 1, 2022 · 7 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@victoriofelipe
Copy link

Hi. I'm runing bacula and bacularis on a debian bullseye and date fields are right in 1.0.12. The date.timezone in php.ini files are:

grep -r ^date.timezone|grep -v 'php.ini~'

7.4/cli/php.ini:date.timezone = America/Sao_Paulo
7.4/fpm/php.ini:date.timezone = America/Sao_Paulo
7.4/apache2/php.ini:date.timezone = America/Sao_Paulo

After upgrade do bacularis 1.1.0, the date fields are in UTC timezone. I tried to set the /etc/php7.4/fpm/pool.d/www.conf adding to the end fo file "php_admin_value[date.timezone] = America/Sao_Paulo" and restarted php7.4-fpm and apache2, but the date fields are wrong.

Am I missing something?

@ganiuszka
Copy link
Member

Hello victoriofelipe,

Thank you for reporting this problem.

In Bacularis 1.1.0 has been changed a little the way of working with data and time. Now as much as possible as base is used time in Unix timestamp form that on the web side is converted into date and time format.

To see where exactly is the problem in your environment I would like to ask you about providing for one selected job scheduled/start/end times from the Bacula job log and from job history table in Bacularis. For example:

From Bacula job log:

  Scheduled time:         01-Sep-2022 16:00:10
  Start time:             01-Sep-2022 16:00:20
  End time:               01-Sep-2022 16:00:21

From the job history table:

  • Scheduled time: 2022-09-01 16:00:10
  • Start time: 2022-09-01 16:00:20
  • End time: 2022-09-01 16:00:21

Please note that the scheduled time and end time in the job history table are hidden by default. To see them there is needed to enable them in the 'Column visibility' combobox at the top of the table.

Thank you in advance for the additional information.

Best regards,
Marcin Haba (gani)

@victoriofelipe
Copy link
Author

Hi. This is do job log:

Build OS: x86_64-pc-linux-gnu debian bullseye/sid
JobId: 58162
...
Scheduled time: 01-set-2022 12:45:00
Start time: 01-set-2022 12:45:00
End time: 01-set-2022 12:45:12
Elapsed time: 12 secs

This is what bacularis show in Job History:
2022-09-01 12 54 48 10 3 0 126 ea9cb23f8a2f

Thank you very for the bacularis and for your time.

Best regards
Victório Felipe

@ganiuszka
Copy link
Member

Hello Victório,

Thanks for providing additional information. Yes, comparing with the time in the job log it looks like UTC time in the job table. I don't know why it happens on your side. I am not able to reproduce it so far.

The one thing that comes to my head is a test in different web browser. Could I ask you about checking on other web browser? Does the happen on other web browser too?

What web browser do you use and what version?

Thanks in advance for response and test.

Best regards,
Marcin Haba (gani)

@victoriofelipe
Copy link
Author

Hi.
My browser is Vivaldi 5.4.2753.45 (Stable channel) (64 bits) on Windows 10
I also tested Firefox 104 on the same notebook.
I also tried on Firefox 104 and Chromium on another computer with Linux Mint 21 and got the same results.

Best regards,
Victório Felipe.

@ganiuszka
Copy link
Member

Hello Victório,

Thanks for tests with web browsers. If the problem persists on different web browsers, then it means that the wrong date comes from the database.

I think I found source of the problem. It seems that you use MySQL or MariaDB database with Bacula. There is a bug in Bacularis API 1.1.0 that appears if the MySQL/MariaDB catalog database is used.

I prepared a fix for that. Could I ask you about trying attached file with your Bacularis instance?

JobManager.php.txt

If you use Bacularis installed by binary packages, this file is located in path:

/usr/share/bacularis/protected/API/Modules/JobManager.php

You can just overwrite it by the attached file. Before overwriting you need to change the new file extension:

mv JobManager.php.txt JobManager.php

Thanks in advance for confirmation.

New Bacularis 1.1.1 with the fix should come very soon, in a day or two.

Thanks for finding this problem.

Best regards,
Marcin Haba (gani)

@ganiuszka ganiuszka added the bug Something isn't working label Sep 2, 2022
@victoriofelipe
Copy link
Author

Hi.

Yes, I am using MariaDB.

Problem solved. Thank you very much!

Best regards,
Victório Felipe

@ganiuszka
Copy link
Member

Hello Victório,

Great! Thank you very much for checking.

I am closing this ticket.

Best regards,
Marcin Haba (gani)

ganiuszka added a commit to bacularis/bacularis-api that referenced this issue Sep 2, 2022
@ganiuszka ganiuszka self-assigned this Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants