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

Unable to initialize compiler: lstat /build: no such file or directory #81

Closed
ingenieroariel opened this issue Jan 29, 2019 · 2 comments

Comments

@ingenieroariel
Copy link

Describe the bug
keto serve does not start

To Reproduce

  1. keto serve
    Unable to initialize compiler: lstat /build: no such file or directory

Expected behavior
The server running

Version:

  • Environment: [Nixos]
  • Version [7798442]

Additional context
I am writing a nixos service for ORY, was already successful in creating one for Hydra and Oathkeeper but ran into this, that looks like #73

@ingenieroariel
Copy link
Author

I was able to avoid the segfault by replacing the relative url with an absolute one in my system.

I could not get packr to work on nix, but this workaround stops keto serve from dying early in the process.

diff --git a/cmd/server/serve.go b/cmd/server/serve.go
index 4190b71..f324743 100644
--- a/cmd/server/serve.go
+++ b/cmd/server/serve.go
@@ -57,10 +57,10 @@ func RunServe(
        buildVersion, buildHash string, buildTime string,
 ) func(cmd *cobra.Command, args []string) {
        return func(cmd *cobra.Command, args []string) {
-               box := packr.NewBox("../../engine/ladon/rego")
+               box := packr.NewBox("/x/rego")
 
                compiler, err := engine.NewCompiler(box, logger)
-               cmdx.Must(err, "Unable to initialize compiler: %s", err)
+               cmdx.Must(err, "Ariel Unable to initialize compiler: %s", err)
 
                writer := herodot.NewJSONWriter(logger)
                //writer.ErrorEnhancer = nil

refs #79

@aeneasr
Copy link
Member

aeneasr commented Feb 5, 2019

closing in favor of #73

@aeneasr aeneasr closed this as completed Feb 5, 2019
aeneasr added a commit that referenced this issue Feb 5, 2019
Closes #73 
Closes #81

Signed-off-by: aeneasr <[email protected]>
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

No branches or pull requests

2 participants