-
Notifications
You must be signed in to change notification settings - Fork 825
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
Re-init Amplify #13104
Comments
I actually just tried to completely start over from scratch. I created a brand new xcode ios app....and ran init.....but still it fails? will@Wills-MBP ThioScanner % amplify init --quickstart --frontend ios Resolution: Please report this issue at https://github.com/aws-amplify/amplify-cli/issues and include the project identifier from: 'amplify diagnose --send-report' Session Identifier: 94fba5a2-4563-45c6-9bd9-e245e8a42021 |
Hey @wills721, thank you for reaching out. I was able to reproduce the issue but noticed while the error does occur on init, adding resources and push worked as expected. |
Well that's great -- but :) -- it now will not update the xcode project file. Kinda leaves me stuck |
@wills721 thank you for the information. The issue seems to be related to #12596 from the comment #12596 (comment) as a workaround downgrading to Amplify CLI v12.2.3 appears to mitigate the issue. currently testing this workaround. |
Yes, looks same/similar. How do you downgrade? :) |
@wills721 just to clarify, what type of updates do you expect it to do to the project file? Are you referring to the |
Not manual updates. Amplify CLI will add to xcode project file......in cases of codegen models as well as the init |
If you're using npm, you can use |
Nope. I wish. I am on a Mac and used this to install curl -sL https://aws-amplify.github.io/amplify-cli/install | bash && $SHELL |
Hey @wills721 you can downgrade with the curl approach with the following steps:
#!/bin/sh
set -e
+version=v12.2.3
reset="\033[0m"
red="\033[31m"
green="\033[32m"
yellow="\033[33m"
cyan="\033[36m"
white="\033[37m"
trap errorMessage EXIT
function errorMessage {
exit_code=$?
if [ $exit_code -eq 0 ]; then
exit
fi
printf "\n${red}Error: Amplify CLI failed to install. Check your internet connection and try again.$reset\n"
printf "If this error still occurs, install the CLI using NPM: ${cyan}npm i -g @aws-amplify/cli$reset\n"
}
printf "\n$yellow Installing the AWS Amplify CLI...$reset\n\n"
# Detect platform
if [[ $OSTYPE == "linux-gnu" ]]; then
PLATFORM="linux"
elif [[ $OSTYPE == "darwin"* ]]; then
PLATFORM="macos"
else
echo "$red Sorry, there's no Amplify CLI binary installer available for this platform."
exit 1
fi
# Detect architecture and fallback to Rosetta when using M1 Macbook
MACHINE_TYPE=`uname -m`
if [[ $MACHINE_TYPE == "x86_64" ]]; then
ARCH='x64'
elif [[ $OSTYPE == "darwin"* && $MACHINE_TYPE == "arm64" ]]; then
ARCH='x64'
else
echo "$red Sorry, there's no Amplify CLI binary installer available for $MACHINE_TYPE architecture."
exit 1
fi
REPO_OWNER=aws-amplify
REPO_NAME=amplify-cli
if [[ -z "$version" ]]; then
# if no version specified, look up the latest version
version=`curl -sL https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/releases/latest | grep 'tag_name' | grep -oE "v[0-9]+\.[0-9]+\.[0-9]+(-[a-z]+\.[0-9]+)?"`
fi
BASE_NAME=amplify-pkg-$PLATFORM
TAR_NAME=${BASE_NAME}.tgz
BINARY_URL=https://github.com/${REPO_OWNER}/${REPO_NAME}/releases/download/$version/$TAR_NAME
# Dowload binary
BINARIES_DIR_PATH=$HOME/.amplify/bin
BINARY_NAME=amplify
BINARY_PATH=$BINARIES_DIR_PATH/$BINARY_NAME
TAR_PATH=$BINARIES_DIR_PATH/$TAR_NAME
EXTRACTION_PATH=$BINARIES_DIR_PATH/$BASE_NAME
mkdir -p $BINARIES_DIR_PATH
printf "$yellow Downloading binary...\n$reset"
curl -L -o $TAR_PATH $BINARY_URL
printf "$green Download complete!\n$reset"
printf "$yellow Extracting binary...\n$reset"
tar xzf $TAR_PATH -C $BINARIES_DIR_PATH
mv $EXTRACTION_PATH $BINARY_PATH
chmod +x $BINARY_PATH
rm $TAR_PATH
printf "$green Extraction complete!\n$reset"
# Add to $PATH
SOURCE_STR="# Added by Amplify CLI binary installer\nexport PATH=\"\$HOME/.amplify/bin:\$PATH\"\n"
add_to_path () {
command printf "\n$SOURCE_STR" >> "$1"
printf "\n$yellow Added the following to $1:\n\n$SOURCE_STR$reset"
}
SHELLTYPE="$(basename "/$SHELL")"
if [[ $SHELLTYPE = "fish" ]]; then
command fish -c 'set -U fish_user_paths ~/.amplify/bin $fish_user_paths'
printf "\n$yellow Added ~/.amplify/bin to fish_user_paths universal variable$reset."
elif [[ $SHELLTYPE = "zsh" ]]; then
SHELL_CONFIG=$HOME/.zshrc
if [ -r $SHELL_CONFIG ] && (! `grep -q '.amplify/bin' $SHELL_CONFIG`); then
add_to_path $SHELL_CONFIG
fi
else
SHELL_CONFIG=$HOME/.bashrc
if [ -r $SHELL_CONFIG ] && (! `grep -q '.amplify/bin' $SHELL_CONFIG`); then
add_to_path $SHELL_CONFIG
fi
SHELL_CONFIG=$HOME/.bash_profile
if [ -r $SHELL_CONFIG ] && (! `grep -q '.amplify/bin' $SHELL_CONFIG`); then
add_to_path $SHELL_CONFIG
fi
SHELL_CONFIG=$HOME/.bash_login
if [ -r $SHELL_CONFIG ] && (! `grep -q '.amplify/bin' $SHELL_CONFIG`); then
add_to_path $SHELL_CONFIG
fi
SHELL_CONFIG=$HOME/.profile
if [ -r $SHELL_CONFIG ] && (! `grep -q '.amplify/bin' $SHELL_CONFIG`); then
add_to_path $SHELL_CONFIG
fi
fi
$BINARY_PATH plugin scan
printf "$green\nSuccessfully installed the Amplify CLI.\nRun '$BINARY_NAME help' to get started!$reset\n"
|
Thank you! That worked! |
I do see one side affect of this......after the downgrade although it all works again every push I get the following error: |
Actually, I think this is causing an issue. At runtime i get this now (I never got this before) |
local-aws-info.json now reference's a cloudformation config that does not exist anywhere on my harddrive I'm starting to think I need to wipe everything clean now after all this (?) |
Hey @wills721 👋 can you try removing the |
Thanks for responding. I spent the day just blowing everything away and recreating from scratch and I'm back in business now. |
Closing as this issue has since been resolved |
|
How did you install the Amplify CLI?
curl
If applicable, what version of Node.js are you using?
No response
Amplify CLI Version
12.2.4
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
Describe the bug
I tried to re-init my amplify project after attempting to re-init my auth (amplify remove auth). I had a bunch of failures and now I seem stuck. Its odd because the error tells me a dir is missing but its not:
will@Wills-MBP Scanner % amplify init --quickstart --frontend ios
Updating Xcode project:
🚫 folderNotFound: Amplify project not found at "/Users/will/Desktop/Scanner".
-- Recovery suggestion: Run
amplify init
to initialize an Amplify project.🛑 Command failed with exit code 1: /Users/will/.amplify/lib/aws-amplify-amplify-frontend-ios/resources/amplify-xcode import-config --path="/Users/will/Desktop/Scanner"
Resolution: Please report this issue at https://github.com/aws-amplify/amplify-cli/issues and include the project identifier from: 'amplify diagnose --send-report'
Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/
Session Identifier: 2a553097-8c06-4166-bf1e-13685db9bde1
✅ Report saved: /var/folders/4c/983j0hb94z93c8hgwn1mnhw40000gn/T/Scanner/report-1691762388536.zip
✔ Done
Project Identifier: 92e08c1a4705f2c2d32e531a9c530cae
will@Wills-MBP Scanner % pwd
/Users/will/Desktop/Scanner
will@Wills-MBP Scanner %
Is there a way to clean this all up?
Expected behavior
Start over clean but retain my datasources, graphql and REST apis. My goal was just to remove auth and re-install auth but everything seems to have gotten corrupted.
Reproduction steps
amplify remove auth
amplify init
Project Identifier
No response
Log output
Additional information
No response
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: