Repository navigation
Closed
Labels
enhancementNew feature or requestfillerRequires little effort to resolve. Ready to be picked up anytime.
Milestone
Description
Environment
Sentry SaaS (sentry.io)
Relay is running on OpenShift 4.7.31 with the image:
docker.io/getsentry/relay@sha256:d6d471ec789dd046d9807fca03bfa9b94b8d0ccb67ce85fed1668c8de4de5630
Steps to Reproduce
- Create new config with "static" mode, add <project_id>.json to project directory.
- Wrap
config.yamlandprojectsdirectory to ConfigMaps. - Mount them with the following deployment:
apiVersion: apps/v1
kind: Deployment
metadata:
name: sentry-relay
labels:
app.kubernetes.io/name: sentry-relay
spec:
selector:
matchLabels:
app.kubernetes.io/name: sentry-relay
template:
metadata:
labels:
app.kubernetes.io/name: sentry-relay
spec:
volumes:
- name: config
configMap:
name: sentry-relay-config
- name: projects
configMap:
name: sentry-relay-projects
containers:
- name: sentry-relay
image: docker.io/getsentry/relay:latest
args:
- run
- "--config"
- "/etc/relay"
volumeMounts:
- name: config
mountPath: /etc/relay
- name: projects
mountPath: /etc/relay/projectsExpected Result
Relay starts with the provided config and reads projects from /etc/sentry/projects
Actual Result
Relay spams WARN log messages:
2021-10-20T23:12:35Z [relay_server::actors::project_local] WARN: skipping "/etc/relay/projects/..2021_10_20_22_46_00.150511719", not a file
2021-10-20T23:12:35Z [relay_server::actors::project_local] WARN: skipping "/etc/relay/projects/59*****.json", not a file
2021-10-20T23:12:35Z [relay_server::actors::project_local] WARN: skipping "/etc/relay/projects/..data", not a file
(valid Project ID under the stars)
Those files are symlinks in fact:
$ ls -al /etc/relay/projects
total 0
drwxrwsrwx. 3 root 1000660000 79 Oct 20 22:46 .
drwxrwsrwx. 4 root 1000660000 93 Oct 20 22:46 ..
drwxr-sr-x. 2 root 1000660000 26 Oct 20 22:46 ..2021_10_20_22_46_00.150511719
lrwxrwxrwx. 1 root root 31 Oct 20 22:46 ..data -> ..2021_10_20_22_46_00.150511719
lrwxrwxrwx. 1 root root 19 Oct 20 22:46 5910073.json -> ..data/5910073.json
Reacted by Ali Mirlou
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestfillerRequires little effort to resolve. Ready to be picked up anytime.
Activity
RaduW commentedon Oct 21, 2021
Thank you for raising this issue, we are looking into it.
elliotcourant commentedon Nov 14, 2021
I have a terrible way of getting around this as a stop gap; I did not want our logs being filled up with these messages so I approached it like this:
The downside to this is that if relay was able to recognize configmap changes without restarting (see that the file changed) this will break that behavior (configmap changes now require rolling the pod). But it does silence the warnings.
Not sure if this is helpful at all for anyone, but ended up working for me as a stopgap solution.
AliMirlou commentedon Jan 4, 2023
@elliotcourant
I had the same issue and came up with this exact solution but it was really annoying.
I looked into the relay code a bit though. I'm not a rust developer but it seemed like there is a better approach in checking the files than what has been implemented right now.
Currently,
is_fileis being used to check whether it's a file:relay/relay-server/src/actors/project_local.rs
Lines 84 to 90 in 347eb60
But this method returns
falsefor any symbolic links, as documented here:The document also suggests this approach though, which I feel like makes sense in this scenario: