Back to list
olivenet-iot

error-handling

by olivenet-iot

0🍴 0📅 Jan 24, 2026

SKILL.md


name: error-handling description: Common errors and fixes. Use when debugging or troubleshooting.

Error Handling

Common Errors

ErrorCauseFix
Telegram Parse ErrorMarkdown charsescape_markdown() veya parse_mode=None
Instagram Rate LimitToo many calls0.3s delay ekle
Video TimeoutSora/Veo slowgenerate_video_smart() kullan
Container FINISHED timeoutIG processingmax_attempts=30, sleep=10s
None.upper()Missing null check(value or "").upper()
JSON decode errorInvalid response_clean_json_response()

Retry Pattern

from app.agents.base_agent import retry_with_backoff

@retry_with_backoff(max_retries=3, base_delay=2.0)
async def my_function():
    # Delays: 2s, 4s, 8s (exponential)
    pass

Telegram Markdown Escape

def escape_markdown(text: str) -> str:
    chars = ['_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!']
    for char in chars:
        text = text.replace(char, f'\\{char}')
    return text

Instagram Container Polling

max_attempts = 30
for attempt in range(max_attempts):
    status = await check_container_status(container_id)
    if status["status_code"] == "FINISHED":
        break
    await asyncio.sleep(10)
else:
    raise TimeoutError("Container processing timeout")

Video Generation Fallback

# Sora fail → Veo fallback
result = await generate_video_smart(prompt, topic)
if not result["success"] and result.get("fallback"):
    result = await generate_video_veo3(prompt)

JSON Cleanup

def clean_json(text: str) -> str:
    # Remove markdown code blocks
    if "```json" in text:
        text = text.split("```json")[1].split("```")[0]
    # Fix control characters
    text = text.replace('\n', '\\n').replace('\t', '\\t')
    return text.strip()

Debug Commands

# Check logs
tail -f /opt/olivenet-social-bot/logs/app.log

# Test database
sqlite3 data/content.db ".schema posts"

# Check bot status
systemctl status olivenet-social

# Restart bot
sudo systemctl restart olivenet-social
  • TROUBLESHOOTING.md - Full troubleshooting guide
  • app/agents/base_agent.py - Retry decorator
  • app/telegram_pipeline.py - escape_markdown()

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon