-
Notifications
You must be signed in to change notification settings - Fork 200
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
Amplify Pull Always Failed in Xcode Run Script #3332
Comments
Hey @bevanchristian 👋 thanks for raising this! Are you able to capture the error by chance? From the screenshots it was aborted, but I'm unsure if that means it timed out and your editor running the script exited. |
Hi, thanks for the response @josefaidt . I've been facing this problem for 3 days and I'm not getting any error message. As for the timeout, it doesn't seem possible because the fetch is fast, less than 10 seconds. However, I've noticed something new. Every time I regenerate the files in generated/model, whether it's after running "amplify pull" or "amplify codegen model", my build gets aborted or stops. i also add new script like this Moreover, when I run just "amplify codegen model", I encounter the same error. |
if i run in terminal its perfectly fine, only on xcode script |
Hey @bevanchristian thanks for clarifying! Since this seems to be particular to |
@josefaidt I don't think this is related to codegen, the error being thrown seems to be due to a SIGINT being trapped by the CLI during execution, and invoking the sigIntHandler https://github.com/aws-amplify/amplify-cli/blob/a3b139fb36bcb2c1c890403e5bd754beec5b7ff7/packages/amplify-cli/src/index.ts#L192-L205 based on the last log line |
So what should i do right now? |
Hey @bevanchristian are you able to execute the same commands outside of XCode's terminal/script runner? |
yes its perfectly fine if i run in terminal |
Hey @bevanchristian can you try removing the codegen command from the script?
|
Hey @bevanchristian upon further investigation there is an XCode-specific Amplify script that will execute behind the scenes when you run For the mean time, please run this script outside of XCode. What is the workflow or use case you're looking to accomplish? |
oh i see, ok then i'll move the script out of the xcode run script. The workflow that I want is the same as Apollo GraphQL, where every time we build XCode, the schema will be automatically fetched. it would be great if amplify could implement an automatic schema fetch without having to manually type in the command line. the main reason is because I work with a large team, and each team handles certain features. and it would be a difficult if they had to learn the command line amplify so that the schema was generated, because I entered some of the folders into gitignore. btw thanks for the investigation @josefaidt |
Hey @bevanchristian out of curiosity what version of XCode are you currently using? |
i use xcode 14.2 @josefaidt |
Hey @bevanchristian apologies for the delay, but I'm going to transfer this over to our Amplify Swift repo for better assistance with debugging the Amplify CLI + XCode issue |
@bevanchristian Are you able to unblock yourself once your script is moved out of the Xcode build phase? |
How did you install the Amplify CLI?
curl -sL https://aws-amplify.github.io/amplify-cli/install | bash
If applicable, what version of Node.js are you using?
v18.16.0
Amplify CLI Version
12.1.1
What operating system are you using?
Mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
no i use default model (todo)
Describe the bug
I have an Xcode project that will implement Amplify GraphQL, and I intend to pull the schema and regenerate the queries every time the application is built to obtain the latest schema. And this script works as desired when run in a regular terminal. However, when I run it as an Xcode run script, I always encounter errors. Here is the bash.script
And I found that the amplify pull command is causing the error, while the amplify codegen command runs normally when I comment out amplify pull.
This is the error
Expected behavior
Reproduction steps
Project Identifier
No response
Log output
Additional information
No response
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: