Skip to content
This repository has been archived by the owner on Feb 7, 2020. It is now read-only.

awsmobile publish stops if a cloud-api is imported; does not deploy frontend #51

Closed
ceich opened this issue Feb 3, 2018 · 16 comments
Closed
Labels

Comments

@ceich
Copy link

ceich commented Feb 3, 2018

I set up a MobileHub project a few days ago with an imported Cloud API, TokenGenerator. As expected, there is no code for this API pulled down by awsmobile pull. As not expected, awsmobile push does not work. I had been using [email protected], but just upgraded to 1.0.11:
removed 12 packages and updated 4 packages in 4.274s

I get the same error:

$ awsmobile push
checking for local backend changes
      Warning: no codebase found for lambda function: TokenGenerator/{proxy+}: undefined
@ceich
Copy link
Author

ceich commented Feb 3, 2018

This is keeping me from publishing, which is a pain.

Update: I found the -f flag so I am not blocked from publishing the front end.

@UnleashedMind
Copy link
Contributor

It was a bug and it's been fixed. please get the latest version 1.0.12

@ceich
Copy link
Author

ceich commented Feb 3, 2018

Do you think it'll work if there are a mix of MH-created and imported APIs?

@UnleashedMind
Copy link
Contributor

the fix made sure that even if no backend update is needed, frontend publish is still executed.
Please give it a try and let us know.

@ceich
Copy link
Author

ceich commented Feb 3, 2018

For some reason (perhaps due to having used older versions of the CLI before) it now thinks a backend update is required and still fails. Same error as above.

My most recent comment suggested that the push would still fail if a MH-created (and locally edited) API needed to push, but an imported (and not locally edited) API also existed.

@ceich
Copy link
Author

ceich commented Feb 3, 2018

I tried a pull before trying publish (to try to sync up state) but did not sync backend with #current-backend-info. Should I have?

@ceich
Copy link
Author

ceich commented Feb 3, 2018

$ diff -b -r awsmobilejs/{#current-backend-info,backend}
Only in awsmobilejs/#current-backend-info: aws-exports.js
Only in awsmobilejs/#current-backend-info: backend-details.json
Only in awsmobilejs/backend: cloud-api
diff -b -r awsmobilejs/#current-backend-info/mobile-hub-project.yml awsmobilejs/backend/mobile-hub-project.yml
9c9
<           api-arn: "arn:aws:execute-api:us-east-1:305905853980:w50y4cvwed"
---
>           api-arn: 'arn:aws:execute-api:us-east-1:305905853980:w50y4cvwed'
14c14
<           "/{proxy+}": !com.amazonaws.mobilehub.v0.Function {}
---
>           '/{proxy+}': !com.amazonaws.mobilehub.v0.Function {}

@UnleashedMind
Copy link
Contributor

Yes, please execute awsmobile pull and sync backend with #current-backend-info

@ceich
Copy link
Author

ceich commented Feb 3, 2018

Makes no difference. Same diffs as above, and publish still wants to push.

@ceich
Copy link
Author

ceich commented Feb 3, 2018

Looking at backend-update.js, I understand why it wants to push (last push failed).

The problem is the push failing, not the decision that a push is needed. Go back to the original error: the tool does not seem to support an imported API.

@UnleashedMind
Copy link
Contributor

We will notify our server side team on this issue

@ceich
Copy link
Author

ceich commented Feb 4, 2018

Update: I just realized the message above is not a fail but a warning (indeed push returns status 0), but nevertheless something about the imported API causes publish to not proceed to deploy the front end.

@ceich ceich changed the title awsmobile push fails if a cloud-api is imported awsmobile publish stops if a cloud-api is imported; does not deploy frontend Feb 4, 2018
@elorzafe
Copy link
Contributor

elorzafe commented Feb 8, 2018

Hi @ceich I did reproduced the issue. We are working on a fix and planning to publish it ASAP.

Thanks

@UnleashedMind
Copy link
Contributor

This is a bug, and it has been fixed. The fix will be released in the next version. Thanks for providing the information.

@UnleashedMind
Copy link
Contributor

The latest update (v 1.0.13) should have resolved this issue.

@ceich
Copy link
Author

ceich commented Feb 11, 2018

Thanks, it seems to work for me. Warning is still in place for an expected situation, but the push/publish both run to completion.

I haven't tried with a backend that mixes imported and MH-created APIs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants