Problem: Getting 401 Unauthorized when making API calls.Causes:
Invalid API key
Expired API key
API key not properly set
Solutions:
# Check if API key is setimport osapi_key = os.getenv("NOXUS_API_KEY")if not api_key: print("API key not found in environment variables")# Verify API key formatif api_key and not api_key.startswith("noxus_"): print("API key format appears incorrect")# Test authenticationtry: client = Client(api_key=api_key) models = client.get_models() # Simple test call print("✅ Authentication successful")except httpx.HTTPStatusError as e: if e.response.status_code == 401: print("❌ Invalid API key")
403 Forbidden Error
Problem: Getting 403 Forbidden when accessing certain resources.Causes:
Insufficient permissions for your workspace role
Trying to access resources from another workspace
API key doesn’t have required permissions
Solutions:
Contact your workspace administrator
Verify you’re using the correct workspace API key
Check your role permissions in the Noxus dashboard
# Check your user permissionstry: client = Client(api_key="your_key") if client.admin.enabled: print("✅ You have admin permissions") else: print("ℹ️ Limited permissions - some features may not be available")except Exception as e: print(f"❌ Error checking permissions: {e}")
Problem: Cannot create or save workflows.Common Issues:
from noxus_sdk.workflows import WorkflowDefinition# Issue 1: Missing required node configurationsdef check_node_config(workflow_def): for node in workflow_def.nodes: if node.type == "TextGenerationNode": if not hasattr(node.config, 'template') or not node.config.template: print(f"❌ Node '{node.label}' missing template") if not hasattr(node.config, 'model') or not node.config.model: print(f"❌ Node '{node.label}' missing model")# Issue 2: Invalid connectionsdef check_connections(workflow_def): node_ids = {node.id for node in workflow_def.nodes} for edge in workflow_def.edges: if edge.source_node_id not in node_ids: print(f"❌ Invalid source node: {edge.source_node_id}") if edge.target_node_id not in node_ids: print(f"❌ Invalid target node: {edge.target_node_id}")# Issue 3: Orphaned nodesdef check_orphaned_nodes(workflow_def): connected_nodes = set() for edge in workflow_def.edges: connected_nodes.add(edge.source_node_id) connected_nodes.add(edge.target_node_id) orphaned = [node for node in workflow_def.nodes if node.id not in connected_nodes] if orphaned: print(f"⚠️ Orphaned nodes: {[n.label for n in orphaned]}")
Workflow Execution Fails
Problem: Workflows fail during execution.Debugging Steps:
def debug_workflow_execution(workflow, input_data): try: # Start workflow run = workflow.run(body=input_data) print(f"Started run: {run.id}") # Monitor execution while run.status not in ["completed", "failed", "cancelled"]: print(f"Status: {run.status}") time.sleep(2) run = run.refresh() if run.status == "completed": print(f"✅ Success: {run.output}") else: print(f"❌ Failed: {run.error_message}") if hasattr(run, 'error_details'): print(f"Details: {run.error_details}") except Exception as e: print(f"❌ Execution error: {e}")# Test with minimal inputdebug_workflow_execution(workflow, {"test_input": "hello world"})
import psutilimport osdef check_memory_usage(): process = psutil.Process(os.getpid()) memory_mb = process.memory_info().rss / 1024 / 1024 print(f"Memory usage: {memory_mb:.2f} MB")# Monitor memory during operationscheck_memory_usage()# Process large datasets in batchesdef process_large_dataset(items, batch_size=10): for i in range(0, len(items), batch_size): batch = items[i:i + batch_size] # Process batch yield batch check_memory_usage()# Use generators for large resultsdef get_all_workflows_generator(client): page = 1 while True: workflows = client.workflows.list(page=page, page_size=50) if not workflows: break for workflow in workflows: yield workflow page += 1
Code snippet - Minimal code that reproduces the issue
Environment - Python version, OS, SDK version
Expected behavior - What you expected to happen
Actual behavior - What actually happened
# Template for bug reportsbug_report_template = """## Bug Report**Error Message:**
[Paste full error message here]
**Code to Reproduce:**```python[Minimal code that reproduces the issue]
Environment:
Python version:
OS:
Noxus SDK version:
Backend URL:
Expected Behavior:
[What you expected to happen]Actual Behavior:
[What actually happened]Additional Context:
[Any other relevant information]
"""print(bug_report_template)
## Next Steps<CardGroup cols={2}> <Card title="Best Practices" icon="sparkles" href="/sdk/workflows/examples" > Learn best practices for using the SDK effectively </Card> <Card title="API Reference" icon="book" href="/sdk/api-reference/introduction" > Detailed API documentation for all SDK features </Card> <Card title="Examples" icon="code" href="/sdk/workflows/examples" > Working examples for common use cases </Card> <Card title="Community Support" icon="users" href="https://noxus.ai/community" > Get help from the Noxus community </Card></CardGroup>