Error: getaddrinfo ENOTFOUND api.mercadolivre.com.br


I configured Nginx on my server to manage the SSL certificate, which worked correctly.

Before that I couldn’t open the OAuth2 authentication screen, now I can open the page because https is working but it gives an error:

Error: getaddrinfo ENOTFOUND api.mercadolivre.com.br
More details
Failed to connect. The window can be closed now.

Config Nginx:

server {
    listen 80;
    listen 443 ssl;
    server_name flow.mimostyle.com.br;

    ssl_certificate /etc/letsencrypt/live/mimostyle.com.br/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/mimostyle.com.br/privkey.pem;

    location / {
        proxy_pass http://localhost:5678;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Config N8N:

[Unit]
Description=✨N8N Workflow Automation ✨

[Service]
ExecStart=/usr/bin/n8n start
Restart=always
User=administrador
Group=sudo
Environment="N8N_HOST=flow.mimostyle.com.br"
Environment="N8N_PORT=5678"
Environment="N8N_PROTOCOL=https"
Environment="NODE_ENV=production"
Environment="WEBHOOK_URL=https://flow.mimostyle.com.br/"
Environment="GENERIC_TIMEZONE=America/Sao_Paulo"
Environment="TZ=UTC"
Environment="N8N_PERSONALIZATION_ENABLED=true"
Environment="N8N_BASIC_AUTH_ACTIVE=true"
Environment="N8N_BASIC_AUTH_USER=username"
Environment="N8N_BASIC_AUTH_PASS=password"
Environment="N8N_PAYLOAD_SIZE_MAX=10240"
Environment="N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY}"
Environment="NODE_FUNCTION_ALLOW_EXTERNAL=moment,lodash,moment-with-locales"
Environment="EXECUTIONS_DATA_PRUNE_INTERVAL=true"
Environment="EXECUTIONS_DATA_MAX_AGE=24"
Environment="EXECUTIONS_DATA_PRUNE_MAX_COUNT=50"
Environment="EXECUTIONS_DATA_MAX_AGE=336"
Environment="LD_LIBRARY_PATH=/opt/oracle/instantclient"
Environment="N8N_LOG_LEVEL=verbose"
Environment="N8N_LOG_OUTPUT=console,file"
Environment="N8N_LOG_FILE_LOCATION=/home/administrador/.n8n/logs/n8n.log"
Environment="N8N_LOG_FILE_MAXSIZE=50"
Environment="N8N_LOG_FILE_MAXCOUNT=60"
Environment="N8N_SECURE_COOKIE=false"
NODE_OPTIONS="--max_old_space_size=8000"
Environment="SSL_EMAIL=xxxxxxxxxxxx"

[Install]
WantedBy=multi-user.target

Information on your n8n setup

  • **n8n version:1.75.2
  • **Database (default: SQLite):postgres
  • **n8n EXECUTIONS_PROCESS setting (default: own, main):main
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):npm
  • **Operating system:Ubuntu 20.04

Hey @leomangueira

Were you able to solve this issue? I’m curious to know because I’m also Brazilian and the MercadoLivre API could come in handy one day.

I managed to resolve that error, but I still can’t make the request using generic authentication, I get the error: Unable to sign without access token

1 Like

Some auth methods require that you exchange more requests to obtain a token.

From what I can see in the documentation, you have to send the header token in EVERY request.

So choosing the genetic credential is not enough. Your also have to add the token in the header.

Maybe you can have the OAuth2 credential and the header token at the same time. Not sure.

But sometimes you need to execute the auth process entirely in the workflow, without using n8n credentials at all.

Let me know if you can figure that out.

I always ask ChatGPT to explain and build the requests for me, by asking for the URL, headers and body separately, instead of the cURL. And he nails it every time.

:point_right: If my reply answers your question, please remember to mark it as the solution.

Good morning,
I’m also Brazilian, thanks for your help.
The way I managed to solve the problem was by creating a workflow to generate the tokens.
I thought that N8N’s Generic Credential Type would make this whole process simple, without having to create this whole flow to generate the tokens.

Call me on WhatsApp and I’ll explain better

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.