ComusThumbz ドキュメント
管理者ログイン

ComusThumbz トラブルシューティング


プロフィール

このガイドでは、ComusThumbz CMS全体でトラブルシューティング情報を統合し、バックエンド管理パネルの両方をカバーする()ct/admin/)およびフロントエンドの公開ページ(プロジェクトルート)。 問題は、症状、原因、および解決策のカテゴリによって組織されます。

ヒント: 特定の問題に潜入する前に、最もよくある問題を特定するために、以下のクイック診断チェックリストを実行します。


速い診断チェックリスト

問題が発生した場合は、これらのチェックを実行します。

  1. PHP のエラーログ - チェック ct/logs/ サーバの PHP のエラーは、最近のエラーをログに記録します。
  2. Cronジョブ - cronジョブが実行されていることを確認します(ほとんどの「更新されていないデータ」の問題)
  3. ファイル権限 - Webサーバーは、アクセスを読み取り/書き込みする必要があります uploads/, ct/logs/, ct/dat/
  4. データベース接続 - とテストして下さい https://yourdomain.com/tools/simpletest.php?key=comus2025
  5. APIヘルス - とテストして下さい https://yourdomain.com/ct/api/v1/features
  6. 特集 トグル - 無効な機能は「ページが表示されない」の最も一般的な原因です
  7. ブラウザコンソール - JavaScript エラー (F12 -> Console) のチェック
  8. ネットワークタブ - 失敗した API リクエストのチェック (F12 -> ネットワーク)

サーバーと PHP のエラー

空白ページ/500内部サーバーエラー

エラー:
症状: このページは、完全に空白を表示したり、HTTP 500を目に見えるエラーなしで返したりします。

一般的な原因:

  1. declare(stricttypes=1) 配置 - アフターフォロー . 致命的な間違いを引き起こす前に空白、BOM 文字、またはコード。
  1. PHP の構文エラー - エラーログを確認します。
tail -50 /var/log/php/error.log
  1. ミスはファイルを含む - A requireonce 存在しないファイル:
grep -r "requireonce" ct/admin/yourpage.php
  1. 無効な表示エラー - デバッグのために一時的に有効にして下さい:
iniset('displayerrors', 1);
   errorreporting(EALL);

ソリューション: PHP のエラーログを最初にチェックします。 空の場合、有効 displayerrors 実際のエラーを一時的に確認します。

AdminLanguageシングルトンエラー

エラー:
症状: Fatal error: Cannot instantiate AdminLanguage または管理者ページ上の類似500エラー。

原因: 使用方法 new AdminLanguage() シングルトンパターンの代わりに。

修正:

// WRONG

$lang = new AdminLanguage();


// CORRECT
$lang = AdminLanguage::getInstance();

記憶限界 排出される

エラー:
症状: Fatal error: Allowed memory size of X bytes exhausted

一般的なトリガー:

  • 大型ビデオファイルアップロード
  • 大規模な画像ギャラリーの処理
  • 400K+カムパフォーマーレコードのバルク操作

ソリューション: PHP メモリの制限を増やす:

; php.ini

memorylimit = 512M        ; Minimum recommended

uploadmaxfilesize = 2G    ; For video uploads

postmaxsize = 2G          ; Must be >= uploadmaxfilesize

または/script:

iniset('memorylimit', '512M');

最高の実行時間超過

エラー:
症状: Fatal error: Maximum execution time of 30 seconds exceeded

一般的なトリガー:

  • ビデオ処理 cron ジョブ
  • 大規模なデータベースのクエリ
  • 外部 API はタイミングアウト

ソリューション:

; php.ini

maxexecutiontime = 300    ; 5 minutes for web requests

cronジョブの場合、無制限に設定します。

settimelimit(0);

ファイル許可エラー

エラー:
症状: Permission denied ファイルを記述したり、ディレクトリを作成するときにエラー。

必須権限:

ディレクトリパーミッションミッション
uploads/775のユーザーのアップロード、アバター、コンテンツ
uploads/videos/original/775の生のビデオアップロード
uploads/ftpuploads/775のFTPバルクアップロードインテーク
ct/logs/775のアプリケーションログ
ct/dat/775の設定ファイル
assets/images/755の静的画像
修正:
chown -R www-data:www-data uploads/ ct/logs/ ct/dat/
chmod -R 775 uploads/ ct/logs/ ct/dat/

データベースの問題

データベース接続失敗

エラー:
症状: ページの読み込みに失敗し、API は 500 エラー、ログに "Connection rejectd" を返します。

診断:

  1. クイックデータベースツールでテスト:

https://yourdomain.com/tools/simpletest.php?key=comus2025

  1. 資格情報を確認する ct/dat/config.inc.php: : :
$dbhost = 'localhost';
   $dbuser = 'admincomus';
   $dbpasswd = 'yourpassword';
   $db = 'admincomus';
  1. MySQL が実行されていることを確認してください:
systemctl status mysql

ソリューション: MySQL サービスが実行されていることを確認し、データベース設定に一致する資格情報を確認してください。

テーブルロック&ブロックキー

エラー:
症状: API はタイムアウトを呼び出しますが、直接データベースのクエリは高速です。 このページは30〜60秒間ハングします。

診断:

  1. MySQL ステータス ツールを実行します。
https://yourdomain.com/tools/mysqlstatus.php?key=comus2025

  1. 問い合わせをブロックするためのチェック:
SHOW FULL PROCESSLIST;
30秒以上経過しているクエリを探します。
  1. InnoDBロック解析用のデータベースロックインスペクタを使用します。
https://yourdomain.com/tools/dblockinspector.php?key=comus2025

ソリューション:

  1. ブロッククエリをキル化:

KILL ;

  1. またはデバッグツール経由で:
https://yourdomain.com/tools/mysqlstatus.php?key=comus2025&kill=PROCESSID

共通の犯人: ザ・オブ・ザ・ apicron.php marksiteperformersoffline() 一度にすべてのパフォーマーを更新する機能。 これは、バッチ更新で固定された(10msのポーズで1000行)。

スローキー

エラー:
症状: 特定のページは、特にカムパフォーマーまたはビデオリストをゆっくりとロードします。

診断:

-- Check table locks

SHOW OPEN TABLES WHERE Inuse > 0;


-- テーブルの性能を分析して下さい
分析テーブルtblCamsPerformers;
分析テーブルtblVideos;


-- Check index usage
SHOW INDEX FROM tblCamsPerformers;
SHOW INDEX FROM tblVideos;

ソリューション:

  1. 頻繁な列にインデックスが存在することを確認します。
  2. 使用条件 EXPLAIN 不足しているインデックスを識別するためのスロークエリ
  3. APCuキャッシュが動作しているかどうかチェック (php -m | grep apcu)
  4. カムパフォーマーのために、使用して下さい ?fast=1 COUNT クエリをスキップする

SQL デバッグコマンド

構成 必須:
手動データベースのデバッグのための速い参照:

-- Show all running queries
SHOW FULL PROCESSLIST;

-- 特定のクエリをキル化
キル123;


-- 30秒以上の古い接続をスリープする
選択コンキャット('KILL', id, ';')
インフォメーションスキーマ。 プロセスリスト
Command='Sleep' と 時間 > 30;


-- チェックテーブルロック
ショーオープンテーブルは、
使用 > 0;


-- Check InnoDB status for deadlocks
SHOW ENGINE INNODB STATUS;


ビデオ処理

動画 吸う 'pending'

エラー:
症状: アップロードされた動画が、決して処理しません。 ステータスは「終わり」を無期限に残します。

これは最も一般的なビデオの問題です。 順序でこれらをチェックして下さい:

  1. 実行されていないCronジョブ - ビデオ・プロセッサはスケジュールで動きます:
# Must be in crontab
  • php /path/to/ct/admin/cron/ftpビデオプロセッサー.php

   /5     php /path/to/ct/admin/cron/videoprocessor.php
  1. 間違ったファイルデータベースのパス形式 - 最も一般的なデータバグ:
-- Check filepath format
   SELECT videoid, filepath, status FROM tblVideos WHERE status='pending';

ファイルパスは必須です: uploads/videos/original/{filename}

お知らせ ファイル名だけ、 お知らせ 含まれるもの ct/ プレフィックス。

  1. 正しいファイルパスを修正:
-- Fix paths that are just filenames
   UPDATE tblVideos
   SET filepath = CONCAT('uploads/videos/original/', filepath)
   WHERE filepath NOT LIKE 'uploads/%'
     AND filepath NOT LIKE '%/%'
     AND status = 'pending';
  1. 明確なスタック処理キュー:
DELETE FROM tblVideoProcessingJobs
   WHERE videoid IN (SELECT videoid FROM tblVideos WHERE status = 'pending');
  1. ディスクに存在するファイルを確認します。
ls -la /path/to/ct/uploads/videos/original/

FFmpeg / FFprobeが見つかりません

エラー:
症状: ログに「FFmpegが見つからなかった」「FFprobeが見つからなかった」とビデオ処理が失敗します。

診断:

which ffmpeg

which ffprobe

ffmpeg -version

ソリューション:

  1. FFmpegをインストール:

sudo apt install ffmpeg    # Debian/Ubuntu

  1. config マッチの実際の場所にあるパスを確認します。
// ct/dat/config.inc.php
   $ffmpegpath = '/usr/bin/ffmpeg';
   $ffprobepath = '/usr/bin/ffprobe';
  1. PHP がシェルコマンドを実行できるようにします。
// Check if exec() is disabled
   vardump(functionexists('exec'));

ビデオ処理エラー

エラー:
症状: 処理の試みの後の 'error' の状態へのビデオ変更。

診断:

  1. 処理ログをチェック:

tail -100 ct/logs/videoprocessor/.log

  1. ビデオ録画を確認してください。
SELECT videoid, filepath, status, errormessage
   FROM tblVideos WHERE status = 'error'
   ORDER BY videoid DESC LIMIT 10;

一般的な原因:

  • 破損したソースファイル
  • サポートされていないコーデック
  • 不十分なディスクスペース
  • FFmpeg バージョンも 古い (4.0+ が必要)

ソリューション: 根本的な原因を修正し、再処理のためにビデオをリセットします。

UPDATE tblVideos SET status = 'pending', errormessage = NULL

WHERE videoid = ;

HLS Streaming 機能しない

エラー:
症状: ビデオプレーヤーは、エラーを表示したり、MP4に戻って落ちたりします。 フリガナ .m3u8 ローディングしないファイル。

診断:

  1. HLSファイルが生成されたかどうかを確認します。

SELECT videoid, hlspath FROM tblVideoFiles WHERE videoid = ;

  1. マスタープレイリストがアクセス可能であることを確認します。
curl -I https://cdn.example.com/videos/{shard}/{id}/hls/master.m3u8
  1. Check MIME type configuration. Your web server must serve .m3u8 as application/vnd.apple.mpegurl:
# Apache .htaccess
   AddType application/vnd.apple.mpegurl .m3u8
   AddType video/MP2T .ts

Solution: Verify HLS files exist on CDN, MIME types are correct, and securemedia.php token is valid.

 

Thumbnails Not Generating

 

Error:
Symptom: Videos process but have no poster image, preview, or timeline thumbnails.

 

Diagnosis:

SELECT videoid, posterpath, previewpath

FROM tblVideoFiles WHERE videoid = <ID>;

 

Common causes:

  • ImageMagick not installed (convert command needed for contact sheets)
  • FFmpeg failed during thumbnail extraction
  • CDN upload for thumbnails failed (check storage server logs)

 

Solution:

# Verify ImageMagick

which convert

convert --version

 


Reprocess thumbnails only


php ct/admin/cron/videoprocessor.php --video-id=<ID> --thumbnails-only

CDN Upload Failures

 

Error:
Symptom: Video processes locally but files don't appear on CDN storage server.

 

Diagnosis:

  1. Check storage server configuration:

SELECT  FROM tblStorageServers WHERE enabled = 1;

   SELECT  FROM tblStorageServerGroups;

 

  1. Check file location records:
SELECT  FROM tblStorageFileLocations WHERE videoid = <ID>;
  1. Verify CDN credentials and connectivity from the admin panel.

File sharding formula: floor(videoid / 1000) 1000
Example: Video ID 4321 goes to shard 4000:

https://cdn.example.com/videos/4000/4321/webmp4/web.mp4

 

Solution: Check CDN credentials, test connectivity, verify storage server group assignment.

 

Distributed Conversion Server Issues

 

Error:
Symptom: Videos not being assigned to remote conversion servers, or remote processing fails.

 

Diagnosis:

  1. Check server status:

SELECT serverid, title, statusid, currentjobs, maxconcurrentjobs,

          lastheartbeat, loadaverage

   FROM tblConversionServers WHERE statusid = 1;

 

  1. Check conversion logs:
SELECT  FROM tblConversionServerLogs
   WHERE loglevel IN ('WARNING', 'ERROR')
   ORDER BY createdat DESC LIMIT 20;
  1. Verify settings:
SELECT  FROM tblSettings WHERE settinggroup = 'videoprocessing';

Solution:

  • Ensure conversionuseremoteservers is set to 1
  • Verify remote server SSH/FTP connectivity
  • Check that FFmpeg is installed on remote servers
  • Verify conversionfallbacktolocal is 1 for automatic fallback

 


API Issues

API Authentication Failures

 

Error:
Symptom: API returns 401 Unauthorized or "Invalid token" errors.

 

Common causes:

  1. Wrong user ID column - tblCMSUsers uses id, NOT userid:
-- CORRECT
   SELECT id, username, accountstatus FROM tblCMSUsers WHERE id = 123;

-- WRONG (column doesn't exist)
SELECT userid FROM tblCMSUsers;

 

  1. Wrong status column - tblCMSUsers uses accountstatus, NOT status:
-- CORRECT
   WHERE accountstatus = 'active'

-- WRONG
WHERE status = 'active'

 

  1. JWT token expired - Tokens have an expiration time. Re-authenticate:
POST /ct/api/v1/auth/login
  1. JWT secret mismatch - Verify in config:
$jwtsecret = md5($domain . $licensekey);

API Calls Failing from JavaScript

 

Error:
Symptom: Frontend pages can't load data. Browser console shows fetch errors.

 

Diagnosis:

  1. Check ApiClient base URL:

// Browser console

   const api = new ApiClient();

   console.log(api.baseUrl);

 

  1. Check Network tab (F12) for the failing request - note the URL, status code, and response body.
  1. Verify the endpoint exists in the router:
  • File: ct/api/v1/index.php
  • 90+ endpoints defined
  1. Check JWT token:
console.log(localStorage.getItem('authtoken'));

Solution: Verify base URL detection, check endpoint exists in router, verify authentication token if endpoint requires auth.

 

API Returns Empty Data

 

Error:
Symptom: API returns {"success": true, "data": []} with no content.

 

Diagnosis:

  1. Check if data exists in the database:

SELECT COUNT() FROM tblVideos WHERE status = 'active';

   SELECT COUNT() FROM tblCamsPerformers WHERE status = 1 AND enabled = 1;

 

  1. Check feature toggles - some API endpoints return empty when features are disabled.
  1. Check query parameters - pagination offset may be beyond available data.

Solution: Verify data exists in the database and feature toggles are enabled.

 

CORS Errors

 

Error:
Symptom: Browser console shows Access-Control-Allow-Origin errors.

 

Cause: API and frontend on different domains or ports.

Solution: Ensure the API sets proper CORS headers:

header('Access-Control-Allow-Origin: https://yourdomain.com');

header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS');

header('Access-Control-Allow-Headers: Content-Type, Authorization');

 

Or in .htaccess:

Header set Access-Control-Allow-Origin "https://yourdomain.com"

 


Frontend Issues

Features Not Showing / All Disabled

 

Error:
Symptom: Pages redirect with "feature disabled" message, or navigation items are missing.

 

Diagnosis:

  1. Test the features API endpoint:

curl https://yourdomain.com/ct/api/v1/features

 

  1. Check feature cache - APCu may have stale data:
// Clear APCu cache
   apcuclearcache();
  1. Check featurehelper.php - all features default to enabled if not found in database.
  1. Verify feature settings in admin panel: Admin Panel -> Feature Toggles

Solution: Clear APCu cache, verify feature settings in admin panel, check that the API is reachable.

 

Translations Not Loading

 

Error:
Symptom: Translation keys displayed instead of text (e.g., videos.title instead of "Videos").

 

Diagnosis:

  1. Verify lang/en.json exists and is valid JSON:
php -r "jsondecode(filegetcontents('lang/en.json')); echo jsonlasterrormsg();"

 

  1. Check file permissions (must be readable by web server).
  1. Verify the translation key exists in the JSON:
# Search for a specific key
   grep -o '"videos"' lang/en.json
  1. Check for typos in nested keys - videos.sortby.videoid requires all parent keys to exist.

Solution: Validate JSON syntax, check file permissions, verify key path exists in the translation file.

 

CSS Styles Not Applying

 

Error:
Symptom: Page looks unstyled or broken layout.

 

Rules:

  1. Only use assets/css/style.css - no external CSS frameworks (Bootstrap, Tailwind, etc.)
  2. Check for specificity conflicts with Style Manager overrides (Phase 12)
  3. Verify the stylesheet is loaded in includes/header.php
  4. Check browser cache - append ?v=timestamp to stylesheet URL

 

Solution:

// Force cache bust

<link rel="stylesheet" href="assets/css/style.css?v=<?= time() ?>">

 

Dark Mode Not Working

 

Error:
Symptom: Dark mode toggle doesn't change the page appearance.

 

Diagnosis:

  1. Check featuredarkmode is enabled in feature toggles
  2. Verify localStorage is available:

console.log(localStorage.getItem('comusdarkmode'));

  1. Confirm body.dark-mode CSS rules exist in assets/css/style.css
  2. Check that both body and html elements get the class:

document.body.classList.contains('dark-mode');

   document.documentElement.classList.contains('dark-mode');

 

Solution: Enable the feature toggle, clear localStorage, verify CSS dark mode rules exist.

 

Video Player Not Loading

 

Error:
Symptom: Video player area is blank, shows error, or spinner never completes.

 

Diagnosis:

Check browser Network tab for /ct/api/v1/videos/{id} requestVerify video data is returned with valid URLsCheck access control - user may lack permission (free/premium/VIP)For HLS: verify HLS.js is loaded and browser supports it
  1. Check securemedia.php token generation:

GET /securemedia.php?token=...&type=video&id=...

 

Solution: Check API response, verify access control, ensure HLS.js or native HLS support is available, verify media token is valid.

 

Click Tracking Not Working

 

Error:
Symptom: External links not being tracked, or affiliate revenue is missing.

 

Critical rule: ALL external links MUST route through click.php. Direct links incur a 100% skim penalty.

Correct format:

// PHP

$url = sprintf('click.php?url=%s&type=video&id=%d',

    urlencode($externalurl), $videoid);

 


// JavaScript
const url = click.php?url=${encodeURIComponent(externalUrl)}&type=${type}&id=${id};

 

Diagnosis:

  1. Check that click.php exists at the project root
  2. Verify tblClickTracking is receiving records:

SELECT  FROM tblClickTracking ORDER BY clickid DESC LIMIT 10;

  1. Check tblContentClicks for aggregated counts

 

Solution: Audit all external links to ensure they use click.php. Use browser DevTools to verify link href attributes.

 

SEO Meta Tags Missing

 

Error:
Symptom: Social media shares show generic or missing preview data. Search engines don't index properly.

 

Cause: SEO data must be loaded BEFORE header.php is included.

Correct order:

// 1. Load config and API helper FIRST

requireonce DIR . '/ct/dat/config.inc.php';

requireonce DIR . '/includes/InternalApiHelper.php';

 


// 2. Fetch data for SEO
$api = InternalApiHelper::getInstance();
$videoData = $api->getVideoForSeo($videoId);


// 3. NOW include header (generates meta tags from loaded data)
requireonce DIR . '/includes/header.php';

 

Diagnosis:

View page source and check for <meta property="og:title"> tagsUse Facebook/Twitter debugger tools to validate Open Graph tags
  • Check ct/dat/seosettings.json for template configuration

 

Solution: Ensure SEO data is loaded before header, verify SeoHelper.php and InternalApiHelper.php are working.

 


Cam Performers System

No Performers Appearing

 

Error:
Symptom: Cam performers page is empty, no performer cards shown.

 

Diagnosis (in order):

  1. Check cron jobs are running:

php ct/admin/cronupdatecams.php

  1. Verify API credentials in Admin -> Cam Settings
  2. Check tblCamsSites for enabled sites:

SELECT recordnum, name, enabled FROM tblCamsSites WHERE enabled = 1;

  1. Verify featurelivecams is enabled in feature toggles
  2. Check logs:

tail -50 ct/logs/cron-update.log

  1. Test the internal API directly:
GET /ct/api/v1/cams/online?perpage=1&fast=1

 

Solution: Enable cron jobs, verify API credentials, enable the feature toggle.

 

All Performers Showing Offline

 

Error:
Symptom: Performers exist but all show as offline.

 

Diagnosis:

  1. Run the cron update manually:

php ct/admin/cronupdatecams.php

  1. Check if external API is responding:

curl --location 'https://performersext-api.pcvdaa.com/performers-ext/?token=<TOKEN>&gender=f&live=true&size=1&page=1' \

   --header 'x-api-key: <APIKEY>' \

   --header 'User-Agent: ComusThumbz/1.0'

  1. Verify API token hasn't expired
  2. Check database for online performers:
SELECT COUNT() FROM tblCamsPerformers WHERE status = 1;

 

Solution: Run cron manually, verify external API credentials are valid.

 

External API 403 Forbidden

 

Error:
Symptom: External CrakRevenue API returns {"message": "Forbidden"} or HTML error page.

 

Causes:

  1. Missing or invalid x-api-key header
  2. Missing User-Agent header (returns HTML error page)
  3. API key revoked by CrakRevenue

 

Diagnosis:

-- Check stored API credentials

SELECT recordnum, name, apiData, parameters FROM tblCamsSites WHERE enabled = 1;

 

Solution: Verify x-api-key (stored in tblCamsSites.apiData) and ensure requests include a User-Agent header. Contact CrakRevenue if key was revoked.

 

External API 401 Unauthorized

 

Error:
Symptom: External API returns {"message": "Unauthorized: brands not allowed"} or similar.

 

Causes:

  1. Invalid or missing token parameter
  2. Requesting brands not authorized for your token
  3. Token is domain-bound and being used from wrong domain

 

Diagnosis:

-- Check token values

SELECT recordnum, name, parameters, brand FROM tblCamsSites WHERE enabled = 1;

 

Solution: Verify token (stored in tblCamsSites.parameters), ensure you only request authorized brands, verify token is for your domain.

 

Slow Cam Performers Page

 

Error:
Symptom: Cam performers page takes 5+ seconds to load.

 

Diagnosis:

  1. Use the debug panel: add ?debug=1 to the URL to see timing breakdown
  2. Use the full debug tool:
https://yourdomain.com/tools/camperformersdebug.php?key=comus2025

 

Optimization checklist:

  1. Enable fast mode - ensure frontend uses ?fast=1 parameter
  2. Check APCu is installed and enabled:

php -m | grep apcu

  1. Verify stats cache cron is running:

/2     php /path/to/ct/admin/cron/updatecamperformerstats.php

  1. Reduce perpage to 24 or less
  2. Check for blocking database queries (see Table Locks)

 

Three-layer caching strategy:

  • Layer 1: APCu in-memory cache (30s TTL)
  • Layer 2: Database stats cache (tblCamsPerformersStatsCache)
  • Layer 3: Fast mode (skip COUNT queries entirely)

 

Solution: Enable all three caching layers and verify cron jobs are running.

 

Affiliate Revenue Missing

 

Error:
Symptom: Clicks on cam performers not tracking, affiliate commissions not appearing.

 

Cause: External performer links not routed through click.php.

Required format:

$clickurl = sprintf('click.php?url=%s&type=camperformer&id=%d',

    urlencode($performer['chatroomurl']), $performer['performerid']);

 

Also verify:

  • Affiliate ID is present in the roomUrl from the external API
  • tblClickTracking is recording cam performer clicks
  • Performer chatroomurl contains valid affiliate tracking parameters

 

Solution: Audit all performer links to ensure click.php routing. Verify affiliate ID in room URLs.

 


Live Streaming (LiveKit)

LiveKit Server Not Starting

 

Error:
Symptom: Docker container won't start or crashes immediately.

 

Diagnosis:

# Check container status

docker ps -a | grep livekit

 


Check logs


docker logs livekit

Verify Docker is running


systemctl status docker

Common causes:

  1. Port conflicts (7880, 7881, 40000-40100 already in use)
  2. Invalid livekit-config.yaml syntax
  3. Docker not installed or not running
  4. Insufficient permissions

 

Solution:

# Check port availability

ss -tlnp | grep 7880

 


Restart container


docker restart livekit

Or recreate


docker rm -f livekit
docker run -d --name livekit --network host \
  -v $(pwd)/livekit-config.yaml:/livekit.yaml:ro \
  livekit/livekit-server:latest --config /livekit.yaml

Stream Not Connecting

 

Error:
Symptom: Creator clicks "Start Streaming" but video never appears. Viewers see loading spinner.

 

Diagnosis:

  1. Check LiveKit config in ct/dat/config.inc.php:

define('LIVEKITHOST', 'wss://yourdomain.com/livekit/');

   define('LIVEKITAPIKEY', 'yourkey');

   define('LIVEKITAPISECRET', 'yoursecret');

 

  1. Verify WebSocket connection from browser:
  • Open browser console (F12)
  • Look for WebSocket connection errors
  • Check if wss:// URL is accessible
  1. Verify firewall rules:
sudo ufw status | grep -E "7880|7881|40000"

Required ports:

  • 7880 - WebSocket signaling
  • 7881 - TCP media
  • 40000-40100 - UDP media (WebRTC)

 

Solution: Verify LiveKit credentials match between config and server, check firewall ports, ensure SSL is configured for wss://.

 

High Latency / Buffering

 

Error:
Symptom: Live stream has noticeable delay (>2 seconds) or frequent buffering.

 

Causes:

  1. UDP ports blocked - WebRTC falls back to TCP (higher latency)
  2. Server overloaded
  3. Client bandwidth insufficient

 

Solution:

  1. Ensure UDP ports 40000-40100 are open
  2. Check server load:

top -bn1 | head -5
  1. Verify nodeip in livekit-config.yaml matches your public IP

 

Chat Not Working

 

Error:
Symptom: Chat messages not sending or not appearing for other viewers.

 

Diagnosis:

  1. Check tblLiveStreamChat for recent messages:
SELECT  FROM tblLiveStreamChat ORDER BY id DESC LIMIT 10;

  1. Verify WebSocket connection in browser console
  2. Check that the stream ID is valid in tblLiveStreams

 

Solution: Verify stream exists, WebSocket is connected, and chat API endpoint is responding.

 


Creator Monetization

Tips Not Processing

 

Error:
Symptom: Tips sent but not appearing in creator's balance or transaction history.

 

Diagnosis:

-- Check recent token transactions

SELECT  FROM tblTokenTransactions ORDER BY createdat DESC LIMIT 10;

 


-- Check creator tips
SELECT
FROM tblCreatorTips ORDER BY created
at DESC LIMIT 10;


-- Check user token balance
SELECT id, username, tokenbalance FROM tblCMSUsers WHERE id = <USERID>;

 

Common causes:

  • Insufficient token balance
  • Creator profile not verified
  • API endpoint error (check response)

 

Solution: Verify sender has sufficient tokens, creator profile is active, and POST /tips/send returns success.

 

Earnings Not Aggregating

 

Error:
Symptom: Creator earnings dashboard shows $0 despite receiving tips/subscriptions.

 

Cause: Earnings aggregation cron job not running.

Required cron:

     php /path/to/ct/admin/cron/aggregatecreatorearnings.php

 

Diagnosis:

-- Check daily earnings records

SELECT  FROM tblCreatorEarningsDaily

WHERE creatorid = <ID>

ORDER BY earningdate DESC LIMIT 10;

 


-- Check if raw transactions exist
SELECT SUM(amount) as total
FROM tblTokenTransactions
WHERE recipientid = <ID> AND createdat >= CURDATE();

 

Solution: Ensure the aggregatecreatorearnings.php cron job is running every minute.

 

Creator Posts Not Displaying

 

Error:
Symptom: Creator wall is empty or posts aren't visible.

 

Diagnosis:

  1. Check featurecreatorposts is enabled
  2. Verify posts exist:

SELECT  FROM tblCreatorPosts WHERE creatorid = <ID> ORDER BY createdat DESC LIMIT 10;

  1. Check post visibility settings (public vs subscriber-only vs PPV)
  2. Verify media uploads if post contains images/video:
SELECT  FROM tblCreatorPostMedia WHERE postid = <POSTID>;

 

Solution: Enable the feature toggle, verify posts exist in the database, check access control for post visibility.

 

Subscription Issues

 

Error:
Symptom: Subscriptions not activating, or subscribers can't access content.

 

Diagnosis:

-- Check active subscriptions

SELECT  FROM tblCreatorSubscriptions

WHERE subscriberid = <USERID> AND status = 'active';

 


-- Check subscription packages
SELECT
FROM tblCreatorSubscriptionPackages WHERE creatorid = <CREATORID>;

 

Solution: Verify featuresubscriptions is enabled, check payment processing, verify subscription record status.

 


Authentication & Users

Login Fails

 

Error:
Symptom: Login form returns error or redirects back without logging in.

 

Diagnosis:

  1. Test the auth API directly:

POST /ct/api/v1/auth/login

   {"username": "test", "password": "test"}

 

  1. Check user account status:
SELECT id, username, accountstatus, emailverified
   FROM tblCMSUsers WHERE username = 'testuser';

Remember: column is accountstatus, NOT status.

  1. Check if account is locked, suspended, or unverified.

Solution: Verify account exists, is active (accountstatus = 'active'), and email is verified if required.

 

Session Issues

 

Error:
Symptom: User logged in via API but pages don't recognize session. Constant redirects to login.

 

Diagnosis:

  1. Check auth/setsession.php is being called after login
  2. Verify session cookie is being set:

document.cookie  // Check for PHP session cookie

  1. Check PHP session configuration:
vardump(sessionstatus());  // Should be PHPSESSIONACTIVE

   vardump($SESSION);         // Should contain user data

 

Solution: Ensure setsession.php is called after API login returns JWT token. Verify session cookie domain matches.

 

2FA Problems

 

Error:
Symptom: Two-factor authentication code rejected, or 2FA setup fails.

 

Diagnosis:

  1. Check feature2fa is enabled
  2. Verify server time is accurate (TOTP codes are time-based):

date

   timedatectl status

  1. Time drift of >30 seconds will cause code rejection.

 

Solution: Sync server time with NTP, verify 2FA secret is stored correctly.

 


Cron Jobs

Verifying Cron Jobs Are Running

 

Configuration Required:
Check if cron jobs are configured:

 

crontab -l

Check if they've run recently:

# Check video processor logs
ls -la ct/logs/videoprocessor/

Check last modification of log files


stat ct/logs/cron-update.log

Test a cron job manually:

php ct/admin/cron/videoprocessor.php

echo $?  # 0 = success

 

Required Cron Schedule

 

Configuration Required:
The following cron jobs must be running for full system operation:

 

# Video Processing (CRITICAL)
  • php /path/to/ct/admin/cron/ftpvideoprocessor.php

/5     php /path/to/ct/admin/cron/videoprocessor.php
/5     php /path/to/ct/admin/cron/conversionpoller.php

Cam Performers


/5     php /path/to/ct/admin/cronupdatecams.php
/2     php /path/to/ct/admin/cron/updatecamperformerstats.php
0 3      php /path/to/ct/admin/cron/maintenancecamperformers.php

Creator Monetization


  • php /path/to/ct/admin/cron/aggregatecreatorearnings.php

Site Maintenance


0 0      php /path/to/ct/admin/cron/generatesitemap.php
0 1      php /path/to/ct/admin/cron/sitecron.php

Impact of missing cron jobs:

Missing Cron Impact
videoprocessor.php Videos stuck at 'pending' forever
ftpvideoprocessor.php FTP uploads never processed
cronupdatecams.php Cam performer data goes stale
updatecamperformerstats.php Stats cache outdated, slow page loads
aggregatecreatorearnings.php Creator earnings show $0
generatesitemap.php Search engines can't discover new content

Debug Tools Reference

 

Note:
All debug tools require the security key parameter: ?key=comus2025

 

Tool URL Purpose
simpletest.php /tools/simpletest.php?key=comus2025 Quick database connectivity test
camperformersdebug.php /tools/camperformersdebug.php?key=comus2025 Full cam API chain test (MySQL, sites API, online API, direct DB)
mysqlstatus.php /tools/mysqlstatus.php?key=comus2025 MySQL status + kill blocking queries
dblockinspector.php /tools/dblockinspector.php?key=comus2025 InnoDB lock analysis, metadata locks, deadlocks
baredbtest.php /tools/baredbtest.php?key=comus2025 Ultra-minimal database connection test

Kill a blocking query via URL:

https://yourdomain.com/tools/mysqlstatus.php?key=comus2025&kill=PROCESSID

Cam performers debug panel:

https://yourdomain.com/camperformers.php?debug=1


Shows: API URL, TTFB, download time, JSON parse time, DOM render time.

 


Log File Locations

Log Location Contains
Video Processor ct/logs/videoprocessor/ FFmpeg output, processing status, errors
Cron Updates ct/logs/cron-update.log Cam performer sync logs
API Errors ct/logs/api/ REST API error responses
PHP Errors /var/log/php/error.log (server-specific) PHP fatal errors, warnings
Apache/Nginx /var/log/apache2/error.log or /var/log/nginx/error.log Web server errors
LiveKit docker logs livekit Streaming server logs

Common SQL Fixes

 

Configuration Required:
Frequently-used SQL commands for fixing common data issues:

 

-- Fix videos with incorrect filepath (just filename, missing path)
UPDATE tblVideos
SET filepath = CONCAT('uploads/videos/original/', filepath)
WHERE filepath NOT LIKE 'uploads/%'
  AND filepath NOT LIKE '%/%'
  AND status IN ('pending', 'error');

-- Reset errored videos for reprocessing
UPDATE tblVideos SET status = 'pending', errormessage = NULL
WHERE status = 'error' AND video
id IN (1, 2, 3);


-- Clear stuck processing jobs
DELETE FROM tblVideoProcessingJobs
WHERE videoid IN (SELECT videoid FROM tblVideos WHERE status = 'pending');


-- Check cam performer online counts by site
SELECT s.name, COUNT(p.performerid) as onlinecount
FROM tblCamsPerformers p
JOIN tblCamsSites s ON p.site = s.recordnum
WHERE p.status = 1 AND p.enabled = 1
GROUP BY s.name;


-- Check feature toggle status
SELECT setting
key, settingvalue
FROM tblSettings
WHERE setting
key LIKE 'feature%'
ORDER BY setting
key;


-- Check recent click tracking
SELECT type, COUNT() as clicks, MAX(createdat) as lastclick
FROM tblClickTracking
GROUP BY type ORDER BY clicks DESC;


-- Find users with authentication issues
SELECT id, username, accountstatus, emailverified, lastlogin
FROM tblCMSUsers
WHERE account
status != 'active'
ORDER BY id DESC LIMIT 20;


-- Check storage server health
SELECT serverid, servername, servertype, enabled,
last
check, lasterror
FROM tblStorageServers;


-- Verify creator earnings aggregation
SELECT creator
id, earningdate, totaltips, totalsubscriptions,
total
ppv, totalearnings
FROM tblCreatorEarningsDaily
ORDER BY earning
date DESC LIMIT 20;