This page covers common issues you might encounter when using Kirby Copilot, along with solutions to get you back on track.
If you're generating longer content (300+ words) and see errors like No object generated: could not parse the response or JSON parsing failed: Unterminated string in JSON, the AI response is likely being cut off before it completes.
Starting with Copilot v3, all AI requests go through a server-side PHP proxy for security. This means your web server needs to keep the connection alive for the entire generation – which can take 60+ seconds for longer content. The culprit is usually a timeout at the web server level, not PHP itself.
set_time_limit(0) to disable PHP's execution timeout. The issue is typically nginx closing the connection before PHP finishes.Herd uses nginx with FastCGI, and the default fastcgi_read_timeout is 60 seconds – often too short for longer AI generations.
Add the following to your Herd nginx configuration at ~/Library/Application Support/Herd/config/nginx/herd.conf:
# Add inside the server { } block or the PHP location block
fastcgi_read_timeout 300;
Restart Herd after editing for the changes to take effect.
If you're using standalone Valet (not Herd), it also uses nginx with FastCGI. Edit your site-specific configuration in ~/.config/valet/Nginx/ and add fastcgi_read_timeout 300; to the PHP location block.
MAMP uses Apache with mod_php by default, where PHP runs directly inside the Apache process. Since the Copilot proxy already disables PHP's execution timeout, no additional configuration should be needed.
If you still experience timeouts, check Apache's Timeout directive (default is 300 seconds).
If you're running nginx in Docker or a custom setup, add the timeout directive to your PHP location block:
location ~ \.php$ {
# ... existing FastCGI config ...
fastcgi_read_timeout 300;
}
For deployed sites, the configuration depends on your hosting setup:
| Environment | What to check |
|---|---|
| nginx + PHP-FPM | Add fastcgi_read_timeout 300; to your nginx config |
| Apache + mod_php | Usually works out of the box |
| Apache + PHP-FPM | Check ProxyTimeout in Apache and FPM's request_terminate_timeout |
| Cloudflare (proxied) | 100-second timeout on Free, Pro, and Business plans – not configurable |
__copilot__/proxy route or use a subdomain set to "DNS only".If requests fail with authentication errors or "Missing API key" messages, double-check your configuration:
config.php under the correct provider.google, openai, anthropic, or mistral.'johannschopplich.copilot' => [
'provider' => 'google',
'providers' => [
'google' => [
'apiKey' => 'YOUR_API_KEY' // Verify this is valid
]
]
]
When generating blocks or layouts, you might see empty results, missing fields, or incorrectly structured content. This usually comes down to the AI model's ability to handle nested JSON schemas.
A few things to try:
'johannschopplich.copilot' => [
'logLevel' => 'debug'
]
If ghost text suggestions don't appear when typing in writer fields, check the following:
copilot-suggestions mark is added to your writer field:text:
type: writer
marks:
- copilot-suggestions
completion is not disabled in your global configuration.