Error "USER-STORE [ERROR] Server error: listen tcp :8084: bind: address already in use" when running in Azure

When PrivX is deployed in Azure, the User Store microservice may fail to start with an error:

USER-STORE [ERROR] Server error: listen tcp :8084: bind: address already in use

This indicates that a process has reserved port 8084 on the system. In Microsoft Azure, this may be due to Microsoft OMS agent occupying the port.

https://github.com/microsoft/OMS-Agent-for-Linux/blob/master/installer/scripts/npm_startup.sh

To fix this, either move OMS Agent to a different port, uninstall it or configure the PrivX User Store microservice to use a different port.

  1. To change the User-Store port, specify listen_port in the User-Store configuration at /opt/privx/etc/user-store.toml (replace 8888 with the number of a free port):

    listen_port = 8888 # use a free port
    
  2. In /etc/nginx/privx/privx-https-location.conf, set the User Store's proxy_pass to the matching port number (replace 8888 with the port number you used in the previous step):

    location /local-user-store/api/v1/ {
            if ($request_uri !~* ^/local-user-store/api/v1/) {
                    return 404;
            }
            proxy_pass      https://127.0.0.1:8888;
            include         privx/privx-proxy-headers.conf;
    }
    
  3. Restart PrivX and Nginx to apply your changes:

    systemctl restart privx nginx
    

Did this page help you?