-
Notifications
You must be signed in to change notification settings - Fork 9
draft troubleshooting guide #522
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8774d75
draft troubleshooting guide
kidk 927dba9
added contact support notice
kidk 70610fd
added review install steps and check connection
kidk 92238fb
little change
kidk 3aa6564
removed unneeded content + AIKIDO_DEBUG
kidk 681a498
changed link
kidk 4e4c70d
removed check page as it's also checked in install
kidk 172d376
Update docs/troubleshooting.md
bitterpanda63 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| # Troubleshooting | ||
|
|
||
| ## Review installation steps | ||
|
|
||
| Double-check your setup against the [installation guide](../README.md#installation). | ||
| Make sure: | ||
| - The package installed correctly. | ||
| - The firewall is initialized early in your app (before routes or handlers). | ||
| - Your framework-specific integration (middleware, decorator, etc.) matches the example in the README. | ||
| - You’re running a supported runtime version for your language. | ||
|
|
||
| ## Check connection to Aikido | ||
|
|
||
| The firewall must be able to reach Aikido’s API endpoints. | ||
|
|
||
| Test from the same environment where your app runs and follow the instructions on this page: https://help.aikido.dev/zen-firewall/miscellaneous/outbound-network-connections-for-zen | ||
|
|
||
| ## Check logs for errors | ||
|
|
||
| Common places: | ||
| - Docker: `docker logs <your-app-container>` | ||
| - systemd: `journalctl -u <your-app-service> --since "1 hour ago"` | ||
| - Local dev: your terminal or IDE run console | ||
|
|
||
| Tip: search for lines that contain `Aikido` or `aikido_zen`. | ||
|
|
||
| ## Enable debug logs temporarily | ||
| Add this early in your app to surface initialization details: | ||
kidk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```python | ||
| import logging | ||
kidk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| logging.basicConfig(level=logging.INFO) | ||
| logging.getLogger("aikido_zen").setLevel(logging.INFO) # use DEBUG or TRACE if needed | ||
| ``` | ||
|
|
||
| If you use Gunicorn or Uvicorn, also run them with higher verbosity so stdout includes the module logs. | ||
kidk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Confirm the package is installed | ||
|
|
||
| ``` | ||
| pip show aikido-zen || python -m pip show aikido-zen | ||
| python -c "import importlib; print('ok' if importlib.util.find_spec('aikido_zen') else 'missing')" | ||
kidk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
| ## Confirm it is wired early in the request pipeline | ||
| Make sure all requests hit the protection layer before your routes or views. | ||
kidk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| FastAPI or Starlette (ASGI) | ||
| ``` | ||
| from fastapi import FastAPI | ||
| import aikido_zen | ||
|
|
||
| app = FastAPI() | ||
| aikido_zen.protect(app) # add as early as possible, before routes | ||
kidk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| # define routes after this | ||
| ``` | ||
|
|
||
| Flask (WSGI) | ||
|
|
||
| ``` | ||
| from flask import Flask | ||
| import aikido_zen | ||
|
|
||
| app = Flask(__name__) | ||
| aikido_zen.protect(app) # call before registering blueprints or running the app | ||
| ``` | ||
|
|
||
|
|
||
| Django | ||
kidk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| In settings.py, add the middleware near the top so it runs before others: | ||
|
|
||
| ``` | ||
| MIDDLEWARE = [ | ||
| "aikido_zen.django.Middleware", # keep this high in the list | ||
| # ... your other middleware | ||
| ] | ||
| ``` | ||
|
|
||
| Generic ASGI | ||
kidk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ``` | ||
| import aikido_zen | ||
| from your_asgi_app import app | ||
| aikido_zen.protect(app) | ||
| ``` | ||
|
|
||
| ## Contact support | ||
|
|
||
| If you still can’t resolve the issue: | ||
|
|
||
| - Use the in-app chat to reach our support team directly. | ||
| - Or create an issue on [GitHub](../../issues) with details about your setup, framework, and logs. | ||
kidk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Include as much context as possible (framework, logs, and how Aikido was added) so we can help you quickly. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.