amplify-cli: Could not initialize 'dev' : ENOENT : no such file or directory , realpath

Before opening, please confirm:

  • I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

How did you install the Amplify CLI?

npm install -g @aws-amplify/cli

If applicable, what version of Node.js are you using?

v14.16.0

Amplify CLI Version

4.46.1

What operating system are you using?

windows

Amplify Categories

Not applicable

Amplify Commands

pull, push

Describe the bug

i was working on a project and it works fine but yesterday after adding a couple columns to graphQL api and deploy using admin UI i decide to pull the changes on local then i face with error below:

Could not initialize ‘dev’ : ENOENT : no such file or directory , realpath ‘<project-path>’\amplify.temp#current-cloud-backup\api<GraphQLApiResourceName>\build\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack

after searching a lot in google, i couldn’t find any thing

i decide to create a new fresh project in amplify and it works till today and today i faced with this error again

Expected behavior

after running amplify pull --y i should get updated sources from cloud to local but i face with this error

Could not initialize ‘dev’ : ENOENT : no such file or directory , realpath ‘<project-path>’\amplify.temp#current-cloud-backup\api<GraphQLApiResourceName>\build\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack

Reproduction steps

i really don’t know why is this happening there is no logs to check

i just add couple of normal string columns to graphQL and then, this happens

GraphQL schema(s)

# Put schemas below this line
type Notice @model @key(name: "byUser", fields: ["userID"]) @auth(rules: [{allow: owner, operations: [read, create, delete, update]}, {allow: private, operations: [read]}]) {
  id: ID!
  category: String!
  expiry_date: AWSDateTime!
  description: String!
  title: String!
  userID: ID
  location: String!
  start_date: AWSDateTime!
  User: User @connection
}

type WebsiteEmail @model @auth(rules: [{allow: groups, groups: ["admin"], operations: [read, create, update, delete]}]) {
  id: ID!
  email: String
  first_name: String
  last_name: String
}

type ExhibitionArtwork @model @key(name: "byExhibition", fields: ["exhibitionID"]) @auth(rules: [{allow: owner, operations: [read, create, delete, update]}, {allow: groups, groups: ["admin"], operations: [read, create, update, delete]}]) {
  id: ID!
  Artwork: Artwork @connection
  artist_comment: String
  curator_comment: String
  exhibitionID: ID
}

type Exhibition @model @auth(rules: [{allow: groups, groups: ["admin"], operations: [read, create, update, delete]}, {allow: owner, operations: [read, create, update, delete]}]) {
  id: ID!
  title: String!
  description: String!
  release_date: AWSDateTime
  tags: [String]
  ExhibitionArtworks: [ExhibitionArtwork] @connection(keyName: "byExhibition", fields: ["id"])
}

type Artwork @model @auth(rules: [{allow: owner, operations: [read, create, update, delete]}, {allow: private, operations: [read]}, {allow: groups, groups: ["admin"], operations: [read, create, update, delete]}, {allow: groups, groups: ["art_lover"], operations: [read]}, {allow: groups, groups: ["curator"], operations: [read]}]) @key(name: "byUser", fields: ["userID"]) {
  id: ID!
  title: String!
  category: String!
  price: Float
  draft: Boolean
  is_secure: Boolean
  width: Float
  height: Float
  depth: Float
  completed_date: AWSDateTime
  medium: String
  availability: String
  country_location: String
  city_location: String
  reserve_until: AWSDateTime
  tags: [String]
  can_delete: Boolean
  currency: String
  measurement_type: String
  userID: ID
  User: User @connection
  images: [String]
  purchased_from: String
  artist_who_created: String
}

type User @model @auth(rules: [{allow: owner, operations: [read, update]}, {allow: groups, groups: ["admin"], operations: [read, update, create, delete]}]) {
  id: ID!
  owner: String!
  is_signup_completed: Boolean!
  bio: String
  statement: String
  paid_at: AWSDateTime
  payment_expire_at: AWSDateTime
  Artworks: [Artwork] @connection(keyName: "byUser", fields: ["id"])
  portrait_path: String
  favourite_artwork_path: String
  work_video_path: String
  favourite_exhibitions: [String]
  favourite_works: [String]
  favourite_artists: [String]
  featured_exhibition: [String]
  collection_first_time_complete: Boolean
  notice_board_first_time_complete: Boolean
  artist_intro_first_time_complete: Boolean
  helpful_matrix_first_time_complete: Boolean
  Notices: [Notice] @connection(keyName: "byUser", fields: ["id"])
}
 

Log output

# Put your logs below this line


2021-03-24T15:42:35.124Z|info : amplify pull core  {"yes":true}
2021-03-24T15:43:04.032Z|info : amplify-provider-awscloudformation.system-config-manager.getProfileConfig(["default"])
2021-03-24T15:43:04.048Z|info : amplify-provider-awscloudformation.system-config-manager.getProfiledAwsConfig.profileConfig([{"region":"eu-west-2"}])
2021-03-24T15:43:04.048Z|info : amplify-provider-awscloudformation.system-config-manager.getProfileCredentials(["default"])
2021-03-24T15:43:04.079Z|info : amplify-provider-awscloudformation.amplify-service-permission-check.checkAmplifyServiceIAMPermission.amplifyClient.listApps([])
2021-03-24T15:43:04.282Z|info : amplify-provider-awscloudformation.attach-backend.getAmplifyApp.amplifyClient.listApps([{"maxResults":25}])
2021-03-24T15:43:08.016Z|info : amplify-provider-awscloudformation.attach-backend.getBackendEnv.amplifyClient.listBackendEnvironments([{"appId":"[***]n6nfhv"}])
2021-03-24T15:43:08.110Z|info : amplify-provider-awscloudformation.attach-backend.downloadBackend.s3.getObject([{"Key":"[***]rent-[***]ud-[***]d.zip","Bucket":"[***]ify-[***]kend-[***]ev-[***]235-[***]ment"}])

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 3
  • Comments: 44 (13 by maintainers)

Most upvoted comments

@Lorenzohidalgo Yes, your hunch is right - it might be due to the long paths which might cause issues with Windows specifically. The PR out here - https://github.com/aws-amplify/amplify-cli/pull/7010 specifically has a fix for this to avoid nesting of these folders moving forward. We’re trying to get a release out with this fix ASAP.

Thanks for you help @kaustavghosh06 😃 I don’t really care about the AppSync API, it can disappear. What I mean with ‘recover our installations and projects’ is at least be able to amplify pull and push again.

@Lorenzohidalgo what is WSL?

@ritxweb with WSL I meant Windows Subsystem for Linux. If you have a Linux shell installed you can use it for running the pull / push commands while they work on the fix.

@kaustavghosh06 After more investigating, it appears that the issue I was having is somewhere in the amplify push/pull. These operations apparently abstract a lot behind the scenes. Maybe if I stayed completely away from the CLI and just used the console with CI, it would have worked out.

I would have loved to use Amplify, but errors like this took up way too much of my time. Setup is easy, but error resolution is a nightmare right now. I may try again in the future on a different project. Thanks for your help!

same problem for me:

Could not initialize ‘dev’: ENOENT: no such file or directory, realpath 'C:\projectfolder\.temp#current-cloud-backend\api\pubwin2\build\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\resolvers

but the folder is present and is empty…

any suggestion?