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

can't change timezone for cron #1404

Closed
ksourdrille opened this issue Aug 8, 2023 · 19 comments · Fixed by #1740
Closed

can't change timezone for cron #1404

ksourdrille opened this issue Aug 8, 2023 · 19 comments · Fixed by #1740

Comments

@ksourdrille
Copy link

Hi,

I've a problem with cron and timezone, my timezone is Europe/Paris, and the container have the UTC timezone, so we have 2 hours difference, for the cron i have to set -2 for trigger at the good hours in france,

There is a way for change the timezone of the container ?

i've already tried the TZ environment, puting volumes with /etc/timezone and /etc/localtime but the time doesn't impacted

@ansibleguy
Copy link
Contributor

Just linking - related to: #1407

@Altersoundwork
Copy link

Hi @keliansrdl ,

I came across the same issue (Europe/Madrid). Here's what I ran to fix the issue within the docker's console.

docker run -e "TZ=Europe/Madrid"
sudo timedatectl set-timezone Europe/Madrid

Obviously, modify accordingly.

@ksourdrille
Copy link
Author

Hi @keliansrdl ,

I came across the same issue (Europe/Madrid). Here's what I ran to fix the issue within the docker's console.

docker run -e "TZ=Europe/Madrid" sudo timedatectl set-timezone Europe/Madrid

Obviously, modify accordingly.

Hi, that's doesn't work for me ... where do you run the docker run command ?

Kélian

@Altersoundwork
Copy link

Try running just: "sudo timedatectl set-timezone Europe/Paris" within the docker (not the host OS).

@ksourdrille
Copy link
Author

like this ?

image

@Altersoundwork
Copy link

like this ?

image

Ah, I see the issue. Sorry for the confusion. I checked and I believe I was thinking of a previous docker of Semaphore. My current installation is on a Ubuntu Server Instance so, looking at the command history I see the sudo command is what I used for the fix.

@ksourdrille
Copy link
Author

Oh yes i see, np :)

@Altersoundwork
Copy link

@ksourdrille
Copy link
Author

i think yes, that will work, but i don't want rebuild a docker image every update

@Reupireup
Copy link

same prob here, is there a plan to fix it ?
#1042 seems to describe the same bug, almost a year from now 😐

@andreas-marschke
Copy link
Collaborator

Can you verify if it works better now with #1733 merged?

@ksourdrille
Copy link
Author

ksourdrille commented Feb 5, 2024

Hi @andreas-marschke, CRON works fine with the good TZ with the 9.47 beta, however i've an error during task running :

time="2024-02-05T10:30:09+01:00" level=info msg="Task 1208 added to queue"
time="2024-02-05T10:30:12+01:00" level=info msg="Set resource locker with TaskRunner 1208"
time="2024-02-05T10:30:12+01:00" level=info msg="Task 1208 removed from queue"
time="2024-02-05T10:30:15+01:00" level=info msg="Stopped running TaskRunner 1208"
time="2024-02-05T10:30:15+01:00" level=info msg="Release resource locker with TaskRunner 1208"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x95a8af]

@andreas-marschke
Copy link
Collaborator

@ksourdrille That sounds concerning. Would you be able to reproduce that exception?
Could you produce tracelogs from the application so that we can figure out where in the code that crash happens?
The panic: runtime error: invalid memory address or nil pointer dereference is indicative of a code issue but without actual context this isn't beneficial for troubleshooting.

@ksourdrille
Copy link
Author

ksourdrille commented Feb 5, 2024

@andreas-marschke did you know where i can found the tracelogs from the application ? (with docker install)

@ksourdrille
Copy link
Author

ksourdrille commented Feb 5, 2024

Ok i have this @andreas-marschke :

time="2024-02-05T14:06:16Z" level=info msg="Task 1207 added to queue"
time="2024-02-05T14:06:17Z" level=info msg="Set resource locker with TaskRunner 1207"
time="2024-02-05T14:06:17Z" level=info msg="Task 1207 removed from queue"
time="2024-02-05T14:06:23Z" level=info msg="Stopped running TaskRunner 1207"
time="2024-02-05T14:06:23Z" level=info msg="Release resource locker with TaskRunner 1207"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x95a8af]

goroutine 133 [running]:
github.com/ansible-semaphore/semaphore/db_lib.AnsiblePlaybook.RunPlaybook({0x1d, {0x3, {0xc002a869e2, 0xb}, 0x5, {0xc00296c360, 0x25}, {0xc002a869f0, 0x4}, 0x5b, ...}, ...}, ...)
        /go/src/github.com/ansible-semaphore/semaphore/db_lib/AnsiblePlaybook.go:58 +0x8f
github.com/ansible-semaphore/semaphore/db_lib.(*AnsibleApp).Run(0x0?, {0xc001438000?, 0xc000be7958?, 0x1?}, 0xb18300?, 0xb1b380?)
        /go/src/github.com/ansible-semaphore/semaphore/db_lib/AnsibleApp.go:63 +0x90
github.com/ansible-semaphore/semaphore/services/tasks.(*LocalJob).Run(0xc002a90000, {0xc002b5b110, 0xb}, 0x0?)
        /go/src/github.com/ansible-semaphore/semaphore/services/tasks/LocalJob.go:328 +0x335
github.com/ansible-semaphore/semaphore/services/tasks.(*TaskRunner).run(0xc00045d700)
        /go/src/github.com/ansible-semaphore/semaphore/services/tasks/TaskRunner.go:188 +0x6a6
created by github.com/ansible-semaphore/semaphore/services/tasks.(*TaskPool).Run
        /go/src/github.com/ansible-semaphore/semaphore/services/tasks/TaskPool.go:172 +0x4ca

is that better ?

@tboerger
Copy link
Collaborator

tboerger commented Feb 5, 2024

Possibly it have been already fixed within v2.9.47-beta as I remember there had been a similar report on the weekend.

@ksourdrille
Copy link
Author

ksourdrille commented Feb 5, 2024

@tboerger you're right, it's fixed --> #1736, but i used the 2.9.47-beta in my side and i've the error

@andreas-marschke
Copy link
Collaborator

@ksourdrille According to #1736 the other user was asked to test and confirmed the change not fixed.
But the stack you produced is worth a ton. Thanks!

@tboerger
Copy link
Collaborator

tboerger commented Feb 5, 2024

I have pushed #1740, the AnsiblePlaybook struct was missing the logger dependency as well, 78c93b1 has added it to AnsibleApp only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants