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

/0/default: no such file or directory #28

Open
jamengual opened this issue Jan 7, 2023 · 5 comments
Open

/0/default: no such file or directory #28

jamengual opened this issue Jan 7, 2023 · 5 comments

Comments

@jamengual
Copy link

For some reason when the github action run it tries to find the PR 0 on the workspace directory in the atlantis server, if I create the dir manually it seems to work but I do not know if this is an atlantis issue or the drifter action needs to send more data to the API?

this is the error:

{"level":"debug","ts":"2023-01-06T23:40:19.860-0800","caller":"server/middleware.go:45","msg":"POST /api/plan – from [::1]:59352","json":{}}
{"level":"error","ts":"2023-01-06T23:40:20.317-0800","caller":"events/instrumented_project_command_builder.go:66","msg":"Error building plan commands: checking if workspace exists: stat /Users/pepe.amengual/.atlantis/repos/jamengual/atlantmos/0/default: no such file or directory","json":{},"stacktrace":"github.com/runatlantis/atlantis/server/events.(*InstrumentedProjectCommandBuilder).buildAndEmitStats\n\t/Users/pepe.amengual/github/atlantis/server/events/instrumented_project_command_builder.go:66\ngithub.com/runatlantis/atlantis/server/events.(*InstrumentedProjectCommandBuilder).BuildPlanCommands\n\t/Users/pepe.amengual/github/atlantis/server/events/instrumented_project_command_builder.go:35\ngithub.com/runatlantis/atlantis/server/controllers.(*APIRequest).getCommands\n\t/Users/pepe.amengual/github/atlantis/server/controllers/api_controller.go:64\ngithub.com/runatlantis/atlantis/server/controllers.(*APIController).apiPlan\n\t/Users/pepe.amengual/github/atlantis/server/controllers/api_controller.go:145\ngithub.com/runatlantis/atlantis/server/controllers.(*APIController).Plan\n\t/Users/pepe.amengual/github/atlantis/server/controllers/api_controller.go:90\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/Cellar/go/1.19.3/libexec/src/net/http/server.go:2109\ngithub.com/gorilla/mux.(*Router).ServeHTTP\n\t/Users/pepe.amengual/go/pkg/mod/github.com/gorilla/[email protected]/mux.go:210\ngithub.com/urfave/negroni/v3.Wrap.func1\n\t/Users/pepe.amengual/go/pkg/mod/github.com/urfave/negroni/[email protected]/negroni.go:59\ngithub.com/urfave/negroni/v3.HandlerFunc.ServeHTTP\n\t/Users/pepe.amengual/go/pkg/mod/github.com/urfave/negroni/[email protected]/negroni.go:33\ngithub.com/urfave/negroni/v3.middleware.ServeHTTP\n\t/Users/pepe.amengual/go/pkg/mod/github.com/urfave/negroni/[email protected]/negroni.go:51\ngithub.com/runatlantis/atlantis/server.(*RequestLogger).ServeHTTP\n\t/Users/pepe.amengual/github/atlantis/server/middleware.go:70\ngithub.com/urfave/negroni/v3.middleware.ServeHTTP\n\t/Users/pepe.amengual/go/pkg/mod/github.com/urfave/negroni/[email protected]/negroni.go:51\ngithub.com/urfave/negroni/v3.(*Recovery).ServeHTTP\n\t/Users/pepe.amengual/go/pkg/mod/github.com/urfave/negroni/[email protected]/recovery.go:210\ngithub.com/urfave/negroni/v3.middleware.ServeHTTP\n\t/Users/pepe.amengual/go/pkg/mod/github.com/urfave/negroni/[email protected]/negroni.go:51\ngithub.com/urfave/negroni/v3.(*Negroni).ServeHTTP\n\t/Users/pepe.amengual/go/pkg/mod/github.com/urfave/negroni/[email protected]/negroni.go:111\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/Cellar/go/1.19.3/libexec/src/net/http/server.go:2947\nnet/http.(*conn).serve\n\t/usr/local/Cellar/go/1.19.3/libexec/src/net/http/server.go:1991"}
{"level":"debug","ts":"2023-01-06T23:40:20.320-0800","caller":"metrics/debug.go:52","msg":"timer","json":{"name":"atlantis.builder.execution_time","value":0.004596752,"tags":{},"type":"timer"}}

@jamengual
Copy link
Author

A Pr must exist in order to plan so maybe my problem is that the name: Force a terraform PR action in the README needs to run first to create a PR what then the drifter uses to run plan against? but if that was the case I do not see a reference of a PR number on the drifter code.

Please help me to understand the sequence of events, or if I need additional configs.

Thanks.

@jamengual
Copy link
Author

ok, so I managed to implement this after fixing a few bugs. There is still a bug on the API in Atlantis that needs to be addressed to make this more usable which is related to no such file or directory, how did you workaround it?

for reference: runatlantis/atlantis#2949

@zen
Copy link

zen commented Sep 26, 2023

@jamengual did you manage to actually workaround this? It seems to be serious blocker for this project's functionality

@jamengual
Copy link
Author

There is a PR in flight with an attempt to fix this but it might not be the best approach.
We are working on a more core solution to locks and workspaces in general.

The workaround for me was to create the dir semi-automatically.

@cep21
Copy link
Contributor

cep21 commented Mar 8, 2024

I'll see if something changed. /0 used to work as an acceptable default. The main problem I was trying to solve was that I wasn't sure what number to use when I make a plan so I used a PR number that I knew was safe.

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

3 participants