OPL syntax check endpoint is giving 404 page not f...
# talk-keto
e
OPL syntax check endpoint is giving 404 page not found. keto config:
Copy code
version: v0.11.1

dsn: memory

namespaces:
  location: file:///home/ory/namespaces.keto.ts

log:
  level: debug
  format: json
  leak_sensitive_values: true


serve:
  read:
    host: 0.0.0.0
    port: 4466
  write:
    host: 0.0.0.0
    port: 4467
I am making a post request to this endpoint : localhost:4466/opl/syntax/check #keto
v
Hello, the OPL check endpoint belongs to the relationship API which is the "write" API. This means that the endpoint should be checked upon the 4467 port and not 4466 which is the permission (read) api. Hope that helps!
e
Hi, i tried it with 4467 still it does'nt work
v
I had a mysterious issue like this as well. What fixed it for me was to upgrade the keto version to 0.32 and removing this line from my OPL file:
// import { Namespace, SubjectSet, Context } from "@ory/permission-namespace-types"
You should check the keto logs to see if you can get additionnal info on what's happening. Note that when removing the import, my app code which used the OPL file for its interfaces would not compile (because of the missing references). I had to add
// @ts-nocheck
at the top of the file.
e
okay, i'll try that
s
@echoing-postman-28418 were you able to solve this issue? I'm trying to do the same but I;m getting the following error:
destination for keto.keto.config.namespaces is a table. Ignoring non-table value ([map[id:0 name:sample]])
I'm deploying keto with helm using this chart: https://artifacthub.io/packages/helm/ory/keto/0.28.2 My values regarding this are as follow:
Copy code
config:
    dsn: memory 
    serve:
      read:
        port: 4466
      write:
        port: 4467
      metrics:
        port: 4468

    namespaces: 
      location: file:///etc/namespaces/namespaces.keto.ts
The file inside /etc/namespaces/namespaces.keto.ts is loaded via volumes/configmap:
Copy code
extraVolumes:
  - name: olp-file
    configMap:
      name: keto-olp

extraVolumeMounts:
  - name: olp-file
    mountPath: /etc/namespaces
If i get into the pod, the file is correctly created. The ts file used is the one provided as example in the ory website.
v
The documentation is not explicit. I believe your issue comes from having an extra S in
locationS
. It should be like this:
Copy code
namespaces:
            location: ...
EDIT: My bad I can't read properly
Could you please provide your ConfigMap ?
s
that was a typo, but the error persists 😕 I've been revising the schema as well: https://github.com/ory/keto/blob/master/.schema/config.schema.json and a related disussion in keto github: https://github.com/ory/keto/discussions/1125 But to no avail.
v
I will give you what works for me so you can compare: ConfigMap:
Copy code
apiVersion: v1
kind: ConfigMap
metadata:
  name: keto-config-namespaces
  namespace: {{ .Release.Namespace }}
  annotations:
    <http://helm.sh/hook-weight|helm.sh/hook-weight>: "0"
    <http://helm.sh/hook|helm.sh/hook>: "pre-install, pre-upgrade"
data:
  namespaces.keto.ts: |-
{{ .Files.Get "namespaces.keto.ts" | indent 4}}
values.yaml:
Copy code
deployment:
    extraVolumes:
      - name: keto-config-namespaces-volume
        configMap:
            name: keto-config-namespaces
    extraVolumeMounts:
      - name: keto-config-namespaces-volume
        mountPath: /etc/config-namespaces
        readOnly: true
keto:
    ...
    config:
    ...
        namespaces:
            location: file:///etc/config-namespaces/namespaces.keto.ts
I hope that helps
s
@victorious-eye-56567 thanks! I'll check them out, there's probably something that I'm not seeing.
Okay, I think I got the issue. I was getting wrong the indentation of the code inside the configmap 🤦 thanks Luc, you made my day!
v
Haha that's why I hate yaml I lost so much time with stuff like this. Glad I could help!
113 Views