Description
When the Evolution Go API URL is configured in Admin Settings → Channels → Evolution Go, the system does not carry that value forward during channel creation. As a result, api_url is never written into the channel_whatsapp.provider_config column, breaking API communication, QR Code generation, and webhook registration.
Root Cause
Two related issues compound the problem:
-
api_url not persisted in provider_config: When creating an Evolution Go channel, the system uses the admin-configured URL to perform the connection test but does not save it into channel_whatsapp.provider_config. The Api::V1::EvolutionGo::SettingsController reads provider_config['api_url'] directly and has no fallback to installation_configs (EVOLUTION_GO_API_URL), causing a 400 Bad Request on every subsequent API call.
-
Webhook URL not sent on instance creation: Because api_url is absent from provider_config at creation time, the webhook registration call to Evolution Go also fails or is never made, leaving the instance without a configured webhook.
Steps to Reproduce
- Go to Settings → Admin Settings → Channels → Evolution Go
- Set the API URL and Admin Secret, save
- Go to Channels → New Channel → WhatsApp → Evolution Go
- Enter display name and phone number, test connection, create channel
- Open the channel settings
- Click Connect → error: "Erro ao gerar QR Code"
Expected Behavior
api_url is persisted in channel_whatsapp.provider_config at channel creation time
- The webhook URL is sent to Evolution Go when the instance is created
Api::V1::EvolutionGo::SettingsController falls back to GlobalConfigService.load('EVOLUTION_GO_API_URL') when provider_config['api_url'] is absent
Workaround
Manually patch the record via SQL:
UPDATE channel_whatsapp
SET provider_config = provider_config || '{"api_url": "https://your-evogo-domain.com"}'::jsonb
WHERE provider = 'evolution_go' AND provider_config->>'instance_uuid' = '<your_instance_uuid>';
After this patch, QR Code generation and all settings endpoints work correctly.
Environment
- Service:
evo-ai-crm-community + evo-auth-service-community
- Provider:
evolution_go
- Table affected:
channel_whatsapp (column: provider_config)
- Related controller:
Api::V1::EvolutionGo::SettingsController#set_instance_params
Description
When the Evolution Go API URL is configured in Admin Settings → Channels → Evolution Go, the system does not carry that value forward during channel creation. As a result,
api_urlis never written into thechannel_whatsapp.provider_configcolumn, breaking API communication, QR Code generation, and webhook registration.Root Cause
Two related issues compound the problem:
api_urlnot persisted inprovider_config: When creating an Evolution Go channel, the system uses the admin-configured URL to perform the connection test but does not save it intochannel_whatsapp.provider_config. TheApi::V1::EvolutionGo::SettingsControllerreadsprovider_config['api_url']directly and has no fallback toinstallation_configs(EVOLUTION_GO_API_URL), causing a400 Bad Requeston every subsequent API call.Webhook URL not sent on instance creation: Because
api_urlis absent fromprovider_configat creation time, the webhook registration call to Evolution Go also fails or is never made, leaving the instance without a configured webhook.Steps to Reproduce
Expected Behavior
api_urlis persisted inchannel_whatsapp.provider_configat channel creation timeApi::V1::EvolutionGo::SettingsControllerfalls back toGlobalConfigService.load('EVOLUTION_GO_API_URL')whenprovider_config['api_url']is absentWorkaround
Manually patch the record via SQL:
After this patch, QR Code generation and all settings endpoints work correctly.
Environment
evo-ai-crm-community+evo-auth-service-communityevolution_gochannel_whatsapp(column:provider_config)Api::V1::EvolutionGo::SettingsController#set_instance_params