Closed nosachamos closed 3 years ago
@nosachamos Please take a look at the response to your comment here - https://github.com/aws-amplify/amplify-cli/issues/677#issuecomment-749142755
@kaustavghosh06 thank you! I did use version 4.40.1-beta.0
- does it include the fix you mentioned?
@kaustavghosh06 I did reinstall using the @beta
tag as you suggested and it ended up installing the version I was using already:
(base) stark@gpu-cluster:~/Work/mmr-dashboard (master)$ amplify --version
4.40.1-beta.0
I guess the fix did not address the problem in my case. Could maybe have been checked into the wrong branch?
@nosachamos Are you seeing this on a new app (with init -> add api) or an existing app?
Also, one quick question - after specifying project info do you select for an AWS profile or manually enter AWS creds during the init step?
I tried on a brand new app. Started a new app with create-react-app, and then did init and added that simple sample api. Then I get it on push.
I tried filling in all optional things like key description, for example, just in case it was expecting something to have a value, but that didn't help.
I also checked the dev settings and the info inside local-env-info.json
, and it looks good:
{
"projectPath": "/home/stark/Work/mmr-evolution-dashboard",
"defaultEditor": "none",
"envName": "dev"
}
Let me know if you'd like me to check anything else. I'll be watching this ticket. Thanks a lot for looking into it!
@nosachamos What does your amplify/.config/local-aws-info.json
look like? Please hide sensitive information like credentials when sharing.
Also, do you have the responses in your terminal for these questions when running amplify push
?
? Do you want to generate code for your newly created GraphQL API Yes
? Choose the code generation language target javascript
? Enter the file name pattern of graphql queries, mutations and subscriptions src/graphql/**/*.js
? Do you want to generate/update all possible GraphQL operations - queries, mutations and subscriptions Yes
? Enter maximum statement depth [increase from default if your schema is deeply nested] 2
The amplify/.config/local-aws-info.json
looks like this:
{
"dev": {
"configLevel": "project",
"useProfile": true,
"profileName": "default"
}
}
And I answered the questions on amplify push
like so:
Do you want to update code for your updated GraphQL API Yes
? Do you want to generate GraphQL statements (queries, mutations and subscription) based on your schema types?
This will overwrite your current graphql queries, mutations and subscriptions Yes
I reran but did not get some of the questions you showed above this time (maybe because its not the firs time?). I will redo it from scratch on a clean project now and post here.
I used typescript on my previous run though, so I answered like this:
? Do you want to generate code for your newly created GraphQL API Yes
? Choose the code generation language target typescript
? Enter the file name pattern of graphql queries, mutations and subscriptions src/graphql/**/*.ts
? Do you want to generate/update all possible GraphQL operations - queries, mutations and subscriptions Yes
? Enter maximum statement depth [increase from default if your schema is deeply nested] 2
@kaustavghosh06 This time I made sure to run everything with sudo
just in case, and the error is gone!
So it seems this could use a better error message but the issue was lack of permissions to do something... Should this ticket cover giving a better message? Or can it be closed?
That's great!
@nosachamos I wonder which file it is, can you check ~/.amplify/logs
for the latest file and see if it gives any clues to where it is failing?
@nosachamos You shouldn't need to run the amplify commands with sudo unless the project itself has only a sudo level permissions. For example - did you run create-react-app
using sudo?
@kaustavghosh06 This particular time I did run create-react-app using sudo. I am not sure how I did last time, but its very possible I did as a habit. Good to know!
@ammarkarachi I checked but I can't quite tell where the path is missing there. Here is what I see in the logs:
...
2020-12-21T18:55:49.930Z|info : amplify-provider-awscloudformation.utility-functions.getIntrospectionSchema.appSyncModel.appSync.getIntrospectionSchema([{"apiId":"[***]342opyq6bdy","format":"JSON"}])
2020-12-21T18:55:50.392Z|error : amplify-provider-awscloudformation.push-resources.run([{"resourcesToBeCreated":[{"service":"AppSync","providerPlugin":"[***]rmation","output":{"authConfig":{"defaultAuthentication":{"authenticationType":"API_KEY","apiKeyConfig":{"apiKeyExpirationDays":365,"description":""}},"additionalAuthenticationProviders":[]}},"resourceName":"[***]dashboar","category":"api"}],"resourcesToBeUpdated":[],"resourcesToBeSynced":[],"resourcesToBeDeleted":[],"tagsUpdated":false,"allResources":[{"service":"AppSync","providerPlugin":"[***]rmation","output":{"authConfig":{"defaultAuthentication":{"authenticationType":"API_KEY","apiKeyConfig":{"apiKeyExpirationDays":365,"description":""}},"additionalAuthenticationProviders":[]}},"resourceName":"[***]dashboar","category":"api"}]}])
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
@kaustavghosh06 unfortunately on my existing project I still get that same error even when running all commands with sudo.?The logs show the same kind of error:
2020-12-21T20:15:16.259Z|info : amplify-provider-awscloudformation.utility-functions.getIntrospectionSchema.appSyncModel.appSync.getIntrospectionSchema([{"apiId":"[***]p6pbmqbreum","format":"JSON"}])
2020-12-21T20:15:16.739Z|error : amplify-provider-awscloudformation.push-resources.run([{"resourcesToBeCreated":[{"service":"AppSync","providerPlugin":"[***]rmation","output":{"authConfig":{"defaultAuthentication":{"authenticationType":"API_KEY","apiKeyConfig":{"apiKeyExpirationDays":365,"description":""}},"additionalAuthenticationProviders":[]}},"resourceName":"[***]dashboar","category":"api"}],"resourcesToBeUpdated":[],"resourcesToBeSynced":[],"resourcesToBeDeleted":[],"tagsUpdated":false,"allResources":[{"service":"AppSync","providerPlugin":"[***]rmation","output":{"authConfig":{"defaultAuthentication":{"authenticationType":"API_KEY","apiKeyConfig":{"apiKeyExpirationDays":365,"description":""}},"additionalAuthenticationProviders":[]}},"resourceName":"[***]dashboar","category":"api"}]}])
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
Is there anything else I can do to help track down the issue?
In this project I ran amplify delete and started from scratch, except that I ran everything with sudo, but got the error.
I figured out what was wrong!
I don't know how this appened, but the generated .graphqlconfig.yml
file was missing this section:
extensions:
amplify:
version: 3
I added it manually and now its working. Mystery solved. Now how it got like that I don't know...
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.
Describe the bug Starting a simply React project with the sample Single Object api in Linux (I'm on Ubuntu) always fails when running
amplify push
. Not possible to push anything.Amplify CLI Version Used both 4.40 and the latest 4.40.1-beta.0 - same results
To Reproduce To repro, run init a new react (I used a create-react-app app) with
amplify init
:This succeeds. Then add an API:
This also seems to succeed.
Finally, run
amplify push
. This will fail with:Expected behavior App should be pushed without errors.
Desktop (please complete the following information):
Additional context
Happens every time for me. I'm totally blocked.