fix(gerrit): tmpdir-related failure #119

Open
kfearsoff wants to merge 1 commit from kfearsoff/infra:fix-alloy-gerrit into main
First-time contributor

Closes #108

Closes #108
kfearsoff added 1 commit 2024-09-28 13:42:26 +00:00
janik reviewed 2024-09-28 17:19:09 +00:00
@ -112,6 +112,7 @@ in
pyroscope.java "java" {
targets = discovery.relabel.java.output
forward_to = [pyroscope.write.production.receiver]
tmp_dir = "/var/lib/gerrit" // The default "/tmp" can be cleaned up and provoke failure, see #108
Owner

I don't see how this change closes #108 it just moves the occasional unpacking problem from /tmp to /var/lib/gerrit. Btw I'm pretty sure that it's a bad idea to change the tmp_dir setting to a non-temporary directory.

I don't see how this change closes #108 it just moves the occasional unpacking problem from `/tmp` to `/var/lib/gerrit`. Btw I'm pretty sure that it's a bad idea to change the `tmp_dir` setting to a non-temporary directory.
Author
First-time contributor

My understanding is that unpacking fails because the /tmp path got cleaned up by the system, hence the "directory doesn't exist" error message. The error message is accurate - the tmpdir is deleted, so when Alloy tries to access it, the OS says that the directory doesn't exist. The tmp_dir seems to only be used for unpacking the asprof, so it should be fine? I hope?

My understanding is that unpacking fails because the `/tmp` path got cleaned up by the system, hence the "directory doesn't exist" error message. The error message is accurate - the tmpdir is deleted, so when Alloy tries to access it, the OS says that the directory doesn't exist. The `tmp_dir` seems to only be used for unpacking the asprof, so it should be fine? I hope?
Owner

It should be in /run/alloy, not in /var/lib/gerrit, systemd won't cleanup the runtime directory of Alloy.

It should be in `/run/alloy`, not in ` /var/lib/gerrit`, systemd won't cleanup the runtime directory of Alloy.
raito requested changes 2024-10-05 14:40:14 +00:00
Dismissed
raito left a comment
Owner

It should use the relevant runtime directory.

It should use the relevant runtime directory.
kfearsoff force-pushed fix-alloy-gerrit from 3e1d493f80 to 6a119600c9 2024-10-09 16:44:48 +00:00 Compare
kfearsoff requested review from raito 2024-10-09 16:44:53 +00:00
raito reviewed 2024-10-19 17:23:42 +00:00
raito left a comment
Owner

Looks good, will test in production.

Looks good, will test in production.
raito requested changes 2024-10-19 17:30:57 +00:00
raito left a comment
Owner
oct. 19 17:30:36 gerrit01 alloy[26220]: Error: /etc/alloy/config.alloy:32:1: Failed to build component: building component: extract async profiler: failed to open tmp dir /run/alloy: open /run/alloy: no such file or directory
oct. 19 17:30:36 gerrit01 alloy[26220]: 31 |
oct. 19 17:30:36 gerrit01 alloy[26220]: 32 |   pyroscope.java "java" {
oct. 19 17:30:36 gerrit01 alloy[26220]:    |  _^^^^^^^^^^^^^^^^^^^^^^^
oct. 19 17:30:36 gerrit01 alloy[26220]: 33 | |   targets = discovery.relabel.java.output
oct. 19 17:30:36 gerrit01 alloy[26220]: 34 | |   forward_to = [pyroscope.write.production.receiver]
oct. 19 17:30:36 gerrit01 alloy[26220]: 35 | |   tmp_dir = "/run/alloy" // The default "/tmp" can be cleaned up and provoke failure, see #108
oct. 19 17:30:36 gerrit01 alloy[26220]: 36 | |   profiling_config {
oct. 19 17:30:36 gerrit01 alloy[26220]: 37 | |     interval = "60s"
oct. 19 17:30:36 gerrit01 alloy[26220]: 38 | |     alloc = "512k"
oct. 19 17:30:36 gerrit01 alloy[26220]: 39 | |     cpu = true
oct. 19 17:30:36 gerrit01 alloy[26220]: 40 | |     sample_rate = 100
oct. 19 17:30:36 gerrit01 alloy[26220]: 41 | |     lock = "1ms"
oct. 19 17:30:36 gerrit01 alloy[26220]: 42 | |   }
oct. 19 17:30:36 gerrit01 alloy[26220]: 43 | | }
oct. 19 17:30:36 gerrit01 alloy[26220]:    | |_^
oct. 19 17:30:36 gerrit01 alloy[26220]: 44 |
oct. 19 17:30:36 gerrit01 alloy[26220]: ts=2024-10-19T17:30:36.196314431Z level=error msg="failed to start reporter" err="context canceled"
oct. 19 17:30:36 gerrit01 alloy[26220]: interrupt received

I think there's a missing RuntimeDirectory directive somewhere.

``` oct. 19 17:30:36 gerrit01 alloy[26220]: Error: /etc/alloy/config.alloy:32:1: Failed to build component: building component: extract async profiler: failed to open tmp dir /run/alloy: open /run/alloy: no such file or directory oct. 19 17:30:36 gerrit01 alloy[26220]: 31 | oct. 19 17:30:36 gerrit01 alloy[26220]: 32 | pyroscope.java "java" { oct. 19 17:30:36 gerrit01 alloy[26220]: | _^^^^^^^^^^^^^^^^^^^^^^^ oct. 19 17:30:36 gerrit01 alloy[26220]: 33 | | targets = discovery.relabel.java.output oct. 19 17:30:36 gerrit01 alloy[26220]: 34 | | forward_to = [pyroscope.write.production.receiver] oct. 19 17:30:36 gerrit01 alloy[26220]: 35 | | tmp_dir = "/run/alloy" // The default "/tmp" can be cleaned up and provoke failure, see #108 oct. 19 17:30:36 gerrit01 alloy[26220]: 36 | | profiling_config { oct. 19 17:30:36 gerrit01 alloy[26220]: 37 | | interval = "60s" oct. 19 17:30:36 gerrit01 alloy[26220]: 38 | | alloc = "512k" oct. 19 17:30:36 gerrit01 alloy[26220]: 39 | | cpu = true oct. 19 17:30:36 gerrit01 alloy[26220]: 40 | | sample_rate = 100 oct. 19 17:30:36 gerrit01 alloy[26220]: 41 | | lock = "1ms" oct. 19 17:30:36 gerrit01 alloy[26220]: 42 | | } oct. 19 17:30:36 gerrit01 alloy[26220]: 43 | | } oct. 19 17:30:36 gerrit01 alloy[26220]: | |_^ oct. 19 17:30:36 gerrit01 alloy[26220]: 44 | oct. 19 17:30:36 gerrit01 alloy[26220]: ts=2024-10-19T17:30:36.196314431Z level=error msg="failed to start reporter" err="context canceled" oct. 19 17:30:36 gerrit01 alloy[26220]: interrupt received ``` I think there's a missing `RuntimeDirectory` directive somewhere.
kfearsoff force-pushed fix-alloy-gerrit from 6a119600c9 to 9ebba0f74d 2024-10-20 19:03:27 +00:00 Compare
kfearsoff force-pushed fix-alloy-gerrit from 9ebba0f74d to b534a4e6c8 2024-10-20 19:06:44 +00:00 Compare
Author
First-time contributor

My bad! Should be good now

My bad! Should be good now
kfearsoff requested review from raito 2024-10-21 15:23:03 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u fix-alloy-gerrit:kfearsoff-fix-alloy-gerrit
git checkout kfearsoff-fix-alloy-gerrit

Merge

Merge the changes and update on Forgejo.
git checkout main
git merge --no-ff kfearsoff-fix-alloy-gerrit
git checkout main
git merge --ff-only kfearsoff-fix-alloy-gerrit
git checkout kfearsoff-fix-alloy-gerrit
git rebase main
git checkout main
git merge --no-ff kfearsoff-fix-alloy-gerrit
git checkout main
git merge --squash kfearsoff-fix-alloy-gerrit
git checkout main
git merge --ff-only kfearsoff-fix-alloy-gerrit
git checkout main
git merge kfearsoff-fix-alloy-gerrit
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: the-distro/infra#119
No description provided.