Skip to content
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

Useless error messages when testing one-click configurations #864

Open
NeoTheThird opened this issue Oct 18, 2020 · 1 comment
Open

Useless error messages when testing one-click configurations #864

NeoTheThird opened this issue Oct 18, 2020 · 1 comment

Comments

@NeoTheThird
Copy link

NeoTheThird commented Oct 18, 2020

When testing faulty one-click configs, the error messages are often useless.

The following config will yield this error (due to the port mapping on 80):

captainVersion: 4
services:
    $$cap_appname:
        image: alpine
        ports:
            - "80:1337"
caproverOneClickApp:
    instructions:
        start: |-
            This won't work and you won't know why
        end: |-
            See, what'd i tell ya
    displayName: Gah!
    isOfficial: true
    description: This'll error out
    documentation: https://nope

image

If you put in a really wonky config (such as the one below, note the absence of the caproverOneClickApp section), you'll just get a brief "Something bad happened" popup and then nothing. While that is hilarious, it's not very helpful.

captainVersion: 4
services:

Caprover could do some additional validation on the entered yml/json and display more useful error messages.

@githubsaturn
Copy link
Collaborator

CapRover does perform a validation on one-click apps, but not all errors can be caught by CapRover validation. In this case, the error is emitted by Docker because port 80 on the host is already taken, and you're trying to re-assign it. These types of errors are not known until you actually try and only then they will appear.

Relaying docker information back to the client is not the best practice. It can container very long logs and information that will be hard to digest in an error toast on web. Also, it is not a good practice in terms of security. Logs might contain sensitive information. For these reasons, only a handful of "expected" errors are chosen to be displayed to the user.

Having said all this, there is still some improvements that can be done. We should add to the error message information on how to troubleshoot the error further. i.e., read the logs of CapRover.

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

No branches or pull requests

2 participants