Common Issues

This page covers frequently encountered issues and their solutions.

Upload Issues

File Upload Fails

Error: "File upload failed" or "Invalid file format"

Causes:

  • File not in .xlsx format
  • File size exceeds 10MB
  • File is password-protected
  • Corrupted Excel file

Solutions:

  1. Save file as .xlsx (Excel 2007+)
  2. Check file size: Right-click → Properties
  3. Remove password: File → Info → Protect Workbook → Encrypt with Password
  4. Try opening and re-saving in Excel
  5. Split large files into smaller batches

Upload Hangs or Times Out

Symptoms:

  • Page stuck on "Processing..."
  • No response after 5+ minutes
  • Browser shows "Page unresponsive"

Solutions:

  1. Wait 2-3 minutes (large files take time)
  2. Check server logs: ./view_logs.sh extraction
  3. Refresh page and check dashboard for session
  4. Verify server is running: ps aux | grep runserver
  5. Restart server if needed: ./stop_server.sh && ./start_server.sh

"No Quotations Found" Error

Causes:

  • No PII sheet in Excel file
  • Sheet names don't match expected patterns
  • Header row not detected
  • QTI numbers missing

Solutions:

  1. Verify sheet contains "PII" or "PUNCH" in name
  2. Check header row has "NO", "ITEM", "KODE ITEM", "QTY"
  3. Ensure QTI numbers present (e.g., QTI-240102)
  4. Use template format provided by IT

Processing Issues

SAP HANA Connection Failed

Error: "SAP Connection Error" in logs

Causes:

  • SAP HANA server unreachable
  • Invalid credentials
  • Network/firewall issues
  • Schema not accessible

Solutions:

# Test connection
cd /mnt/data/punch_quotation
source venv/bin/activate
python -c "
from hdbcli import dbapi
import os
from dotenv import load_dotenv
load_dotenv()
conn = dbapi.connect(
    address=os.getenv('HANA_HOST'),
    port=int(os.getenv('HANA_PORT')),
    user=os.getenv('HANA_USER'),
    password=os.getenv('HANA_PASSWORD')
)
print('Connected!')
conn.close()
"

If connection fails:

  1. Check .env file has correct credentials
  2. Verify network access: telnet 172.16.25.3 30015
  3. Contact SAP administrator
  4. Check firewall rules

PDF Generation Failed

Error: "Failed to generate PDF" or missing PDFs

Causes:

  • WeasyPrint not installed
  • Missing system fonts
  • Invalid quotation data
  • Disk space full

Solutions:

# Check WeasyPrint
python -c "import weasyprint; print('OK')"

# Reinstall if needed
pip install weasyprint

# Check disk space
df -h

# Check logs
./view_logs.sh django

Missing Items in Check

Not an error - Some items may not exist in SAP HANA.

Actions:

  1. Download missing items CSV
  2. Verify item codes with sales team
  3. Add new items to SAP HANA (separate process)
  4. Re-sync inventory on session detail page

Login Issues

Cannot Login

Error: "Invalid username or password"

Solutions:

  1. Verify credentials with admin
  2. Try demo accounts:
    • uploader / upload123
    • processor / process123
  3. Reset password via admin panel
  4. Check CAPS LOCK is off

Redirected to Login After Login

Causes:

  • Session expired
  • Browser cookies disabled
  • Server restart

Solutions:

  1. Clear browser cache and cookies
  2. Enable cookies in browser settings
  3. Try different browser
  4. Check server is running

"Permission Denied" After Login

Error: Cannot access dashboard or upload page

Causes:

  • User not in correct group
  • Insufficient permissions

Solutions:

  1. Contact administrator to assign proper role
  2. Uploader: Can only upload files
  3. Processor: Full access
  4. Admin: Use Django admin panel to check user groups

Server Issues

Server Not Starting

Error: "Address already in use" or connection refused

Solutions:

# Check if port 8000 is in use
netstat -tlnp | grep 8000

# Kill existing process
pkill -f "manage.py runserver"

# Start server
./start_server.sh

# Check server status
ps aux | grep runserver

Server Crashes or Restarts

Check logs:

# Server output
cat logs/server.log

# Django logs
tail -50 logs/django.log

# Extraction logs
tail -50 logs/extraction.log

Common causes:

  1. Out of memory
  2. Database corruption
  3. Python errors in code
  4. Disk full

Solutions:

  1. Check system resources: free -h, df -h
  2. Restart server: ./stop_server.sh && ./start_server.sh
  3. Check for errors in logs
  4. Contact IT if issue persists

Slow Performance

Symptoms:

  • Pages load slowly
  • Upload processing takes too long
  • Dashboard laggy

Solutions:

  1. Clear old sessions from database
  2. Check server resources: top, htop
  3. Restart server during off-peak hours
  4. Optimize database: python manage.py vacuum (if PostgreSQL)
  5. Consider hardware upgrade

Database Issues

Database Locked

Error: "database is locked" (SQLite only)

Causes:

  • Multiple processes accessing database
  • Previous process didn't close properly

Solutions:

# Stop server
./stop_server.sh

# Wait 10 seconds
sleep 10

# Restart
./start_server.sh

Corrupted Database

Symptoms:

  • Random errors
  • Missing data
  • Cannot access dashboard

Solutions:

# Backup current database
cp db.sqlite3 db.sqlite3.backup

# Try to repair
python manage.py migrate --run-syncdb

# If repair fails, restore from backup
# Or recreate database:
rm db.sqlite3
python manage.py migrate
python manage.py setup_users

⚠️ Warning: Recreating database deletes all data.

Format Detection Issues

Wrong Format Detected

Symptoms:

  • TMMIN detected as Standard
  • Format badges incorrect
  • PDF shows wrong template

Causes:

  • Sheet name doesn't match format keywords
  • Column count mismatch
  • Missing format-specific fields

Solutions:

  1. Rename sheet to include format keyword:
    • TMMIN: "TMMIN" or "TOYOTA"
    • METINDO: "METINDO"
    • MARUICHI: "MARUICHI"
  2. Verify column count matches format
  3. Check sample files for correct structure

Date Not Showing

Error: Date shows "N/A" in quotation

Causes:

  • Date format doesn't match expected pattern
  • Missing comma or space in date
  • Date in wrong location

Expected format: Jakarta, DD MMMM YYYY

Examples:

  • Jakarta, 23 Oktober 2025
  • Jakarta,23 Oktober 2025 (comma without space)
  • 23 Oktober 2025 (missing location)
  • 2025-10-23 (wrong format)

Solutions:

  1. Add "Jakarta, " before date
  2. Use full month name in Indonesian
  3. Check comma placement

Browser Issues

Page Not Loading

Solutions:

  1. Hard refresh: Ctrl + F5 (Windows) or Cmd + Shift + R (Mac)
  2. Clear browser cache
  3. Try incognito/private mode
  4. Try different browser (Chrome, Firefox, Edge)
  5. Check server is running

JavaScript Errors

Error: Console shows "Uncaught SyntaxError" or similar

Solutions:

  1. Clear browser cache
  2. Hard refresh page
  3. Check browser console (F12) for details
  4. Report to IT with error message

Styling Issues

Symptoms:

  • Page looks broken
  • Missing colors or borders
  • Layout incorrect

Solutions:

  1. Clear browser cache
  2. Hard refresh: Ctrl + F5
  3. Check if Tailwind CSS loading
  4. Disable browser extensions
  5. Try different browser

Data Issues

Items Not Filtering

Symptoms:

  • "11 HARI KERJA" appears in item check
  • Dates like "2025-10-23" in item list
  • Notes treated as items

This should be fixed in current version.

If still occurring:

  1. Check system version
  2. Re-upload file
  3. Check logs for filtering errors
  4. Report to IT with file sample

Duplicate Quotations

Symptoms:

  • Same QTI number appears multiple times
  • Quotations counted twice

Causes:

  • QTI number appears on multiple sheets
  • Revision quotations not properly marked

Solutions:

  1. Ensure QTI numbers are unique per file
  2. Use REV suffix for revisions: QTI-240102-REV-1
  3. Remove duplicate quotations from Excel before upload

Quick Diagnostic Commands

# Check server status
ps aux | grep runserver

# Check port 8000
netstat -tlnp | grep 8000

# View recent logs
tail -50 logs/django.log
tail -50 logs/extraction.log

# Test SAP connection
cd /mnt/data/punch_quotation && source venv/bin/activate
python manage.py shell -c "from quotation.utils.sap_utils import test_hana_connection; test_hana_connection()"

# Check disk space
df -h

# Check memory
free -h

# Restart server
./stop_server.sh && sleep 2 && ./start_server.sh

Getting Help

If issue persists after trying solutions:

  1. Collect Information:

    • Error message (exact text)
    • Screenshot of issue
    • Steps to reproduce
    • Log files (logs/ directory)
  2. Check Logs:

    ./view_logs.sh all > issue_logs.txt
    
  3. Contact IT:

    • Email: it@somagede.co.id
    • Include: Error details, logs, screenshots
    • Mention: System version, browser used

Prevention Tips

  1. Regular Maintenance:

    • Clean up old sessions weekly
    • Monitor disk space
    • Check logs for warnings
    • Backup database monthly
  2. Best Practices:

    • Use template formats
    • Verify files before upload
    • Test with small files first
    • Keep browser updated
  3. Monitoring:

    • Check dashboard statistics daily
    • Review failed uploads
    • Monitor SAP connection status
    • Watch server logs for errors

Next Steps

results matching ""

    No results matching ""