# Native App Troubleshooting

## Common Issues

| Issue | Cause | Fix |
|-------|-------|-----|
| "Package already exists" | Package name conflict | Use `CREATE APPLICATION PACKAGE IF NOT EXISTS` or choose a different name |
| "Insufficient privileges" | Missing grants | Run Step 1 privilege checks again |
| "Stage not found" | Stage doesn't exist or wrong path | Verify stage with `SHOW STAGES IN SCHEMA <app_pkg>.stage_content` |
| "Cannot find manifest" | `manifest.yml` not at stage root | Ensure PUT uploads `manifest.yml` to the root of the stage path |
| "Invalid manifest" | YAML syntax error or missing required field | Validate YAML syntax; ensure `manifest_version` and `artifacts.setup_script` are present |
| PUT command fails | Wrong file path or permissions | Use absolute paths with `file://` prefix; check local file permissions |
| "Setup script failed" | SQL error in setup script | Enable debug mode, check error message, fix script |
| "Object already exists" | Missing `CREATE OR REPLACE` | Use idempotent CREATE statements |
| Object not visible to consumer | Missing application role grant | Add `GRANT ... TO APPLICATION ROLE` in setup script |
| "EXECUTE AS CALLER not allowed" | Procedure uses caller rights | Change to `EXECUTE AS OWNER` |
