Closed sina-developer closed 3 years ago
@sina-developer A few questions here
cli.json
? (Located in the amplify
directory)thanks for your response no, it was normal pull and push, nothing more, I actually updated GraphQL from Admin UI And then pull the changes from local using amplify pull
and content of cli.json:
{
"features": {
"graphqltransformer": {
"addmissingownerfields": true,
"validatetypenamereservedwords": true,
"useexperimentalpipelinedtransformer": false,
"enableiterativegsiupdates": true,
"secondarykeyasgsi": true,
"skipoverridemutationinputtypes": true
},
"frontend-ios": {
"enablexcodeintegration": true
},
"auth": {
"enablecaseinsensitivity": true
},
"codegen": {
"useappsyncmodelgenplugin": true,
"usedocsgeneratorplugin": true,
"usetypesgeneratorplugin": true,
"cleangeneratedmodelsdirectory": true,
"retaincasestyle": true
},
"appsync": {
"generategraphqlpermissions": true
}
}
}
Hi @sina-developer
I tried the steps : 1) Deploy the API from AdminUI 2) amplify pull on local 3) update the API by adding 2 models with GSI from AdminUI 4) amplify pull
amplify pull
is working fine for me.
Can you tell me the exact steps what did you update and added before you got this error? If possible can you provide the schema you used to deploy in adminUI?
hello and thank you for your response and sorry for delay on response
honestly there is not steps to reproduce this error this error happening suddenly without any reasons and we only can remove and create a new fresh project
this happens to us two times and there was no unusual steps just adding some fields to graphQL Schema and then push nothing more!
it looks like this bug is not reproducible
I was googling and i found one thing somebody said "maybe pull or push is corrupted" but i'm sure push and pull was done successfully then
btw i hope, this info is usefull for you
sorry for my English tho!
I have some news! something weird happened! as I said I've created a new project and after three days without any changes I decided to run amplify pull --y to check the project
and guess what!
that error happens again this time I have image of all those errors
image link : https://connect-app.co.uk/bug.png
I hope it is useful even I can't pull project to a empty folder!
thank you guys <3
I'm having the same error, same message, after updating a model at Amplify Admin. I've tried reinstalling the project and the CLI, but the error persists in Windows. The only difference is that I have Node 12 and NPM 6. But the same project, and CLI version works fine in Linux (Ubuntu VM)
I also just started getting this exact same error. I was updating a model in the Amplify Admin, and then I tried to do an amplify pull. I am unable to pull from my environment with a call stack almost identical to @sina-developer.
$ amplify pull --y
? Which app are you working on?
I have tried pulling this environment in a completely new project and I get the same error.
I am also on Windows with npm 6.14.11 and amplify cli 4.45.2
Same error here in the same scenario. Now the whole local project is broken with no possibility of syncing with the backend!!
I have deleted the appsync API through the console and tried to delete all the models in the Admin UI but I am not able to delete the last model and 'save and deploy', the button just disappear so I can only save and deploy with the last model still existing which preserves the database but now the rest of the project is even worst :(
Now when I try to save and deploy the remaining model in the Admin UI the deployment fails with these errors:
GraphQLSchema | 5/4/2021, 5:22:53 | UPDATE_FAILED | Failed to retrieve attribute [ApiId] for resource [GraphQLAPI]: GraphQL APIxxxxxxxxxxxxxxxxxxxxxxxxxxxxx not found. (Service: AWSAppSync; Status Code: 404; Error Code: NotFoundException; Request ID: 66691361-1b10-49ff-964c-f23235afe48d; Proxy: null)
And finally in the Amplify console, when I open my backend environment, the tab with the API is not working also and I see these errors on the browser console output:
Uncaught (in promise) NotFoundException: GraphQL API xxxxxxxxxxxxxxxxxxxxxxxxxxxx not found.
It looks like the Admin UI is not yet working properly and it broke all my Amplify project.
Please!! any help wiould be much apreciated.
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?
@marenero1974 @sina-developer @nanoTitan @angelxehg @ritxweb Could you'll please provide your Amplify app ID + region and/or the schema/data-model configured?
@ritxweb Did you delete the AppSync API in their console or Admin UI?
@marenero1974 @sina-developer @nanoTitan @angelxehg @ritxweb Could you'll please provide your Amplify app ID + region and/or the schema/data-model configured?
App Id: d3l1k7rd5bu2j6
Region: us-east-2
Schema:
type AccessCode @model @auth(rules: [{allow: public}]) {
id: ID!
awsid: String!
codigo: String!
accion: String!
descripcion: String!
argumentos: [String]
activo: Boolean!
}
type HelpPage @model @auth(rules: [{allow: public}]) {
id: ID!
titulo: String!
contenido: String!
target: Target!
visible: Boolean!
resumen: String!
}
enum Target {
APP
PANEL
UNIVERSAL
}
type Doctor @model @auth(rules: [{allow: public}]) {
id: ID!
awsid: String!
pacientes: [Paciente] @connection(keyName: "byDoctor", fields: ["id"])
nombre: String!
recetas: [Receta] @connection(keyName: "byDoctor", fields: ["id"])
email: String!
}
type Paciente @model @auth(rules: [{allow: public}]) @key(name: "byDoctor", fields: ["doctorID"]) {
id: ID!
awsid: String!
doctorID: ID!
nombre: String!
recetas: [PacienteReceta] @connection(keyName: "byPaciente", fields: ["id"])
email: String!
}
type Receta @model @auth(rules: [{allow: public}]) @key(name: "byDoctor", fields: ["doctorID"]) {
id: ID!
nombre: String!
resumen: String!
imagen: String
contenido: String
ingredientes: [Ingrediente] @connection(keyName: "porIngrediente", fields: ["id"])
doctorID: ID!
pacientes: [PacienteReceta] @connection(keyName: "byReceta", fields: ["id"])
publica: Boolean!
}
type Ingrediente @model @key(name: "porIngrediente", fields: ["recetaID"]) @auth(rules: [{allow: public}]) {
id: ID!
nombre: String!
recetaID: ID!
cantidad: Float!
unidad: String
}
type PacienteReceta @model(queries: null) @key(name: "byPaciente", fields: ["pacienteID", "recetaID"]) @key(name: "byReceta", fields: ["recetaID", "pacienteID"]) @auth(rules: [{allow: public}, {allow: public}]) {
id: ID!
pacienteID: ID!
recetaID: ID!
paciente: Paciente! @connection(fields: ["pacienteID"])
receta: Receta! @connection(fields: ["recetaID"])
}
NOTE: I'm still able to amplify pull/push/codegen
in Linux.
@marenero1974 @sina-developer @nanoTitan @angelxehg @ritxweb Could you'll please provide your Amplify app ID + region and/or the schema/data-model configured?
App ID : d57xpqjn6nfhv
region : eu-west-2
and schema :
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]
}
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
}
also it looks like we are able to pull and push on linux and mac os and it seems only windows have this issue!
@ritxweb Did you delete the AppSync API in their console or Admin UI?
no i didn't
@ritxweb Did you delete the AppSync API in their console or Admin UI?
Hello @SwaySway and thanks for you help.
I deleted it in the console. In the Admin UI, as I said before, once you delete all the models you can not 'save and deploy', the button just disappear. I have tried also to disable the Admin UI but the results are the same.
@marenero1974 @sina-developer @nanoTitan @angelxehg @ritxweb Could you'll please provide your Amplify app ID + region and/or the schema/data-model configured?
appid: d3g781xweyq37c region: Europe (Frankfurt) eu-central-1 schema: It is currently deleted but it was something like this:
type ClientWapp @model @key(name: "byClient", fields: ["clientID"]) @key(name: "byWapp", fields: ["wappID"]) @auth(rules: [{allow: owner}]) { id: ID! clientID: ID! wappID: ID! Client: Client @connection Wapp: Wapp @connection }
type Client @model @auth(rules: [{allow: owner}, {allow: groups, groups: ["Users"]}]) { id: ID! billingAddress: String users: [User] @connection(keyName: "byClient", fields: ["id"]) ClientWapps: [ClientWapp] @connection(keyName: "byClient", fields: ["id"]) }
type User @model @key(name: "byClient", fields: ["clientID"]) { id: ID! clientID: ID! client: Client! @connection }
type Wapp @model @auth(rules: [{allow: owner}, {allow: groups, groups: ["Administrators"]}]) { id: ID! name: String! ClientWapps: [ClientWapp] @connection(keyName: "byWapp", fields: ["id"]) }
@ritxweb If you deleted the app and environment in the console - unfortunately the entire backend would be deleted. Could you confirm that you deleted your Amplify App from the Console?
@ritxweb If you deleted the app and environment in the console - unfortunately the entire backend would be deleted. Could you confirm that you deleted your Amplify App from the Console?
No no, sorry, I deleted the appsync app and also disabled the Amplify Admin UI. Not the Amplify app, it is still up because I already have websites hosted for live and dev environments. I tryed to delete all the graphql models from the Amplify Admin UI before disabling it but as I mentioned before, once you delete the last model, the button 'save and deploy' disappear so you can not update the api. It looks completely like a Amplify Admin UI bug on windows but even after disabling the Admin UI the error persists and I can no longer pull or push the amplify configuration to my local original development.
@kaustavghosh06 @SwaySway having the same problem. Just updated the Data model inside AdminUI and the following error pops when trying to do a pull:
Pre-pull status:
Current Environment: dev
| Category | Resource name | Operation | Provider plugin |
| --------- | -------------------- | --------- | ----------------- |
| Auth | bonusbankapp63dba5d7 | No Change | awscloudformation |
| Analytics | bonusbankapp | No Change | awscloudformation |
| Api | bonusbankapp | No Change | awscloudformation |
| Storage | BonusBankStorage | No Change | awscloudformation |
| Fetching updates to backend environment: dev from the cloud.Could not initialize 'dev': ENOENT: no such file or directory, realpath 'C:\DEVELOPMENT\some_folder\amplify\.temp\#current-cloud-backend\api\bonusbankapp\build\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\resolvers'
App ARN: arn:aws:amplify:eu-central-1:886869467812:apps/ddhhh5znoq37b Region: Europe (Frankfurt) eu-central-1
@kaustavghosh06 @SwaySway having the same problem. Just updated the Data model inside AdminUI and the following error pops when trying to do a pull:
Pre-pull status: Current Environment: dev | Category | Resource name | Operation | Provider plugin | | --------- | -------------------- | --------- | ----------------- | | Auth | bonusbankapp63dba5d7 | No Change | awscloudformation | | Analytics | bonusbankapp | No Change | awscloudformation | | Api | bonusbankapp | No Change | awscloudformation | | Storage | BonusBankStorage | No Change | awscloudformation | | Fetching updates to backend environment: dev from the cloud.Could not initialize 'dev': ENOENT: no such file or directory, realpath 'C:\DEVELOPMENT\some_folder\amplify\.temp\#current-cloud-backend\api\bonusbankapp\build\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\resolvers'
App ARN: arn:aws:amplify:eu-central-1:886869467812:apps/ddhhh5znoq37b Region: Europe (Frankfurt) eu-central-1
After deleting the amplify folder in my flutter project and trying to pull i'm still getting the same error, but i'm now able to access the cloned environment. The dev environment is not longer listed in the amplify env list
results. Might it have something to do with the nesting of the folders? Windows is kind of picky while working with long paths...
@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.
@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 - #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 @kaustavghosh06 !! Does this means that we will recover our installations and projects affected by this bug?
@ritxweb If you've deleted your AppSync API from the AWS Console, I would recommend contacting AWS Support for this. We won't be able to help out in recovering a deleted API from the AWS Console through this forum.
If this is not a production environment, you can replicate or create a new environment with the following command - amplify env add
. and that would clone your existing environment and create a new one.
@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 - #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 @kaustavghosh06 !! Does this means that we will recover our installations and projects affected by this bug?
@ritxweb you can use WSL meanwhile as a workaround to be able to pull the changes 😉
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?
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!
I managed to migrate the models to another environment, but i wonder how to migrate data stored in the models from the old environment to the new one, is it possible? Thanks
Same error here. WTH is this? I'm coming from Ubuntu, where there was no error at all. Now i get this:
Could not initialize 'staging': ENOENT: no such file or directory, realpath 'C:\DEV...\amplify.temp#current-cloud-backend\api\apiName\build\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack'
What is the solution?
Adding an update here:
The following PR https://github.com/aws-amplify/amplify-cli/pull/7010 was merged and is included in the latest release (currently 4.47.1). This initial-stack will be removed on the next push whether it's done locally or on Amplify Admin UI. This will insure there are no nested initial state directories in your project when doing a pull.
Adding an update here:
The following PR #7010 was merged and is included in the latest release (currently 4.47.1). This initial-stack will be removed on the next push whether it's done locally or on Amplify Admin UI. This will insure there are no nested initial state directories in your project when doing a pull.
thank you when will we get an update? also new version will solve this bug ?
Is not solved the issue.
Still getting this error:
Could not initialize 'staging': ENOENT: no such file or directory, realpath 'C:\DEV...\amplify.temp#current-cloud-backend\api\apiName\build\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack'
In version: 4.47.1
@Alexminator99 Did you push a new change before doing a pull on the new version?
@Alexminator99 Did you push a new change before doing a pull on the new version?
Yes. I push storage in previous version of amplify cli.
Got it. Doing a push on the latest version (4.47.1) will fix the pull so it removes the nested stacks from #current-cloud-backend
.
Got it. Doing a push on the latest version (4.47.1) will fix the pull so it removes the nested stacks from
#current-cloud-backend
.
amplify push × There was an error pulling the backend environment staging. An error occurred during the push operation: ENOENT: no such file or directory, realpath 'C:\DEV\APPNAME\amplify.temp#current-cloud-backend\api\apiName\build\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack\states\initial-stack'
Same error!!!!
@Alexminator99 Are you using Amplify Admin UI as well?
@Alexminator99 Are you using Amplify Admin UI as well?
Yes.
@Alexminator99 Are you using Amplify Admin UI as well?
Amplify pull following the local setup instructions in Admin UI also fails...
Are you able to push a change in Amplify Admin UI?
Are you able to push a change in Amplify Admin UI?
Successfully pull after creating a test model and deploy. Now im going to delete that model and retry
for me too, worked, but not at the first try when i didn't changed any model, thanks
Closing this issue as the fix https://github.com/aws-amplify/amplify-cli/pull/7010 will prevent this from happening further.
For this that run into this situation for the first time, if you are unable to do a pull locally please deploy a small change in Amplify UI using the latest version of the CLI. This will ensure that this long directory file will not exist when doing another pull.
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server *-help
channels for those types of questions.
Before opening, please confirm:
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 ''\amplify.temp#current-cloud-backup\api\\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 ''\amplify.temp#current-cloud-backup\api\\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)
Log output