Skip to content

bug: App not found error encountered when app exists on server #235

Description

@techfg

When executing a deploy using the --app flag, the following error is encountered even though the app is verified to exist on the server:

{"statusCode":400,"error":"Bad Request","message":"App not found. Verify the app's name: mytestapp"}

The issue arises when mytestapp is not locally on disk but does exist by the exact name on the server. The error message infers that the app was not found on the SERVER and gives no indication that the problem is actually in the payload submitted as it did not contain the mytestapp.json. There is simply no way for a user to know, from the error message, that the file is missing and the message itself leads the user to believe it's a server-side issue.

While the steps to reproduce below are somewhat contrived to easily reproduce the problem, an example scenario where this could occur in practice is a user retrieve --since XXX which results in the mytestapp.json not being retrieved because it didn't meet the since criteria and then tries to deploy --app mytestapp.

Steps to Reproduce

  1. Create NLX site
  2. Create an app mytestapp
  3. Retrieve the entire site
  4. Delete apps/mytestapp.json from local disk
  5. Deploy using --app mytestapp flag

Expected Result
Either the app should deploy the resources on disk associated to the app (if its possible without the app.json file itself being present) or worst case should give the user a meaningful message that the app exists on the server but was not present in the submitted "upload/payload" and to check their local file system to ensure the app file is present.

Additionally, when --app is specified and the app.json included in the submitted payload, if any entities/resources that are assigned to the app (e.g., pages, datasources, etc.) are not present in the payload, the app & any entities that are included should be updated on the server but any entities/resources that were not present in the payload should have a warning emitted that indicates they were not updated to avoid the user thinking they updated the entire app when only a portion of it was actually updated.

Actual Result
The following error is emitted which is:

  1. Not user friendly in terms of the format of the message itself
  2. Misleading as it leads the user to believe the app does not exist on the server
  3. Lacking full explanation of what the actual problem is
  4. A raw http response dump which could be difficult to discern for someone not familiar with HTTP protocol - the error message can be extracted and all the additional response information discarded and logged separately as a debug message.
`{"statusCode":400,"error":"Bad Request","message":"App not found. Verify the app's name: mytestapp"}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions