Skip to content

bug(evolution_go): api_url not persisted in provider_config and missing webhook on instance creation #29

@andersonlemesc

Description

@andersonlemesc

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:

  1. 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.

  2. 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

  1. Go to Settings → Admin Settings → Channels → Evolution Go
  2. Set the API URL and Admin Secret, save
  3. Go to Channels → New Channel → WhatsApp → Evolution Go
  4. Enter display name and phone number, test connection, create channel
  5. Open the channel settings
  6. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions