Error When Adding A New Post Reply To Post — this archived support thread from the APG vNext community covers a reported issue and its resolution.
Troubleshooting This Issue
- Set
customErrors mode="Off"inweb.configto expose the full error and stack trace. - Check Windows Event Viewer → Application log for ASP.NET exceptions.
- Review Admin Panel → Logs → Error Log for timestamped application errors.
- Restart the IIS Application Pool to clear stale state.
- Verify the database connection string and run any pending upgrade SQL scripts.
Related Resources
Error When Adding a New Post or Reply in APG vNext
Errors during post submission are particularly impactful because they block member participation. The most common causes are: CSRF token expiry, antivirus/WAF blocking the request body, database write failure, or a validation error on a required post field.
Diagnosing the Error
-- Check error log for post submission errors:
SELECT TOP 10 ErrorType, ErrorMessage, RequestUrl, OccurredAt
FROM apg_ErrorLog
WHERE RequestUrl LIKE '%/post%' OR RequestUrl LIKE '%/reply%'
ORDER BY OccurredAt DESC;
Fix 1: CSRF Token Expired
If the post form was open for longer than the session timeout (default 20 min), the CSRF token expires and the submit fails with a 403 or a "Security token invalid" message. Extend the timeout:
<add key="APG.CSRF.TokenLifetimeMinutes" value="60" />
Fix 2: WAF or Antivirus Blocking the POST Body
Web Application Firewalls (Cloudflare WAF, IIS Request Filtering) can block POST bodies that contain code samples (SQL, JavaScript, HTML tags). Add an exception for the forum's post endpoint:
<location path="community/post">
<system.webServer>
<security>
<requestFiltering allowDoubleEscaping="true">
<requestLimits maxAllowedContentLength="10485760" />
</requestFiltering>
</security>
</system.webServer>
</location>
Fix 3: Database Write Timeout
<add key="APG.DB.CommandTimeout" value="60" />
<!-- Increase SQL command timeout from 30s to 60s -->
Post Submission Rate Limiting and Spam Prevention
APG vNext includes a post submission rate limiter to prevent forum flooding by bots or abusive members. The rate limiter can cause legitimate member submissions to fail if the threshold is too aggressive for active power-users who post frequently. Configure the rate limit in web.config:
<add key="APG.Post.RateLimitPerMinute" value="5" />
<!-- Allow at most 5 new posts per member per minute -->
<add key="APG.Post.RateLimitByRole" value="true" />
<!-- Apply different limits per member role group -->
<add key="APG.Post.RateLimitModPosts" value="false" />
<!-- Exempt moderators from rate limiting -->
If members report intermittent post failures, check whether the error log shows rate limit violations for those members. Increase the per-minute limit for trusted member groups (Moderators, Senior Members) while keeping a stricter limit for new or unverified members.
Rich Text Editor Post Submission Errors
The APG vNext rich text editor (based on TinyMCE or a custom implementation) serialises post content to HTML before submitting via AJAX. Post submission errors can occur when: the serialised HTML contains characters that IIS Request Filtering rejects (e.g., angle brackets in a raw HTML paste), the AJAX request exceeds the configured maximum request size, or a network interruption occurs during the AJAX upload of embedded images. Configure appropriate request size limits:
<system.web>
<httpRuntime maxRequestLength="20480" /> <!-- 20 MB max post body -->
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="20971520" /> <!-- 20 MB -->
</requestFiltering>
</security>
</system.webServer>
Auto-Save Draft to Prevent Loss on Error
APG vNext's auto-save draft feature saves the post content to localStorage every 30 seconds while the member is composing. If the post submission fails due to any error, the draft is preserved and offered to the member on their next visit to the compose page. Enable auto-save draft in Admin Panel → Editor → Auto-Save Draft and configure the save interval. This is especially important for long posts on mobile devices where network interruptions are more common.
Mobile Post Submission Errors
Mobile devices introduce additional failure modes for post submission that desktop users don't encounter. Network interruptions between cell towers cause AJAX POST requests to fail mid-transmission, producing errors that are difficult to reproduce in a desktop testing environment. APG vNext addresses this with a retry mechanism for failed post submissions: if the initial AJAX POST fails due to a network error (as opposed to a 4xx or 5xx response), the editor automatically retries the submission up to three times with exponential backoff. Configure retry behaviour in Admin Panel → Editor → Network Resilience. For high-mobile-traffic forums, also reduce the maximum post size to ensure submissions complete within typical mobile network timeouts, and consider enabling the auto-save draft feature so that even if a submission ultimately fails, the member's post content is preserved locally and can be resubmitted once connectivity is restored.
Monitoring Post Submission Success Rate
Configure APG vNext to track the post submission success rate as a key operational metric. A declining submission success rate is an early warning signal that a configuration problem (WAF rule, CSRF token expiry, database write timeout) is blocking members from posting before it becomes visible as a drop in new post volume. The APG vNext admin dashboard's activity metrics include a post submission success rate graph when this tracking is enabled in Admin Panel → Monitoring → Submission Metrics. Set up an alert to notify administrators when the success rate drops below 98%, which in a normal, healthy forum corresponds to only legitimate validation rejections (e.g., duplicate post detection, word length minimum) and no infrastructure-level failures. An alert threshold of 95% or lower indicates active member impact requiring immediate investigation.
Related Resources
Looking for more help? Browse the support forum or check the Knowledge Base.