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

Namecheap Update Does Not Fail on IP Whitelisting Error #406

Closed
er4z0r opened this issue Mar 25, 2024 · 2 comments
Closed

Namecheap Update Does Not Fail on IP Whitelisting Error #406

er4z0r opened this issue Mar 25, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@er4z0r
Copy link

er4z0r commented Mar 25, 2024

Describe the bug
Ghostwriter marks a Namecheap Update as successful even if it throws an error due to GWs IP not being whitelisted for the Namecheap API key.

To Reproduce
Steps to reproduce the behavior:

  1. Configure a Namcheap API-Key
  2. Don not whitelist your Ghostwriter instance's IP address for that API key.
  3. Configure GW to use the API-Key configured in 1.
  4. Trigger Domain Update.
  5. See no error
  6. Check task status (successful tasks) in Admin-Panel:
  7. Find following error:

{'errors': {'namecheap': 'Namecheap API returned error #1011150: Invalid request IP: XX.XX.XX.XX (see https://www.namecheap.com/support/api/error-codes/)'}, 'updates': {}}

Expected Behavior
The update task should fail.

Server Specs:

  • OS: Ubuntu 22.04.3 LTS
  • Docker Docker version 20.10.21, build baeda1f
  • Ghostwriter: v4.0.1, released 27 September 2023 ( I know, I know. Waiting for 4.1)
@er4z0r er4z0r added the bug Something isn't working label Mar 25, 2024
@chrismaddalena
Copy link
Collaborator

Good catch, @er4z0r. Thanks for reporting it. We'll have a look at it today. It should be an easy fix we can include in the next release.

@chrismaddalena
Copy link
Collaborator

@er4z0r I see this error if the IP address is not whitelisted and I test the API configuration:

error

I think step 4 in your post references the "Pull Domains from Namecheap" update task on the control panel page. That does trigger "successfully" and record as successful with Django Q, but the result shows the error about the IP.

The task being "successful" in the admin panel is technically correct. Django Q only considers a task as failed if an error raised during the task. The Namecheap update task tracks the error response and logs it, but the task finished successfully (i.e., there were no runtime errors).

The problem is you, the user requesting the update, don't see that error. The issue was actually in the webpage template. There was a bad conditional check that meant the error wasn't displayed. I fixed it so you will now see this:

Screenshot 2024-03-25 at 12 14 50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants