sammy007 / open-ethereum-pool

Open Ethereum Mining Pool
GNU General Public License v3.0
1.4k stars 1.12k forks source link

Stats API Temporarily Down #472

Open duckducknono opened 3 years ago

duckducknono commented 3 years ago

System information

Geth version: Version: 1.10.1-stable Git Commit: c2d2f4ed8f232bb11663a1b01a2e578aa22f24bd Architecture: amd64 Go Version: go1.16

Redis version: Redis server v=3.0.6

OS & Version: LINUX VERSION="16.04.7 LTS (Xenial Xerus)

Expected behaviour

Static homepage to deploy correctly as opposed to application-error.hbs

Actual behaviour

The homepage/root page, through nGinx is displaying a stats unavailable page. Statistics are showing on /api/stats however despite altering the ApiUrl in environment.js, config.json and checking nginx configurations nothing seems to be taking a hold. I have make cleaned and rebuilt on numerous occasion.

I have noticed in dev console that 'stats' asset is 404'ing due to a 'doubled up' destination URL (the server public IP is displaying twice concatenated).

The rebuilds of environment/js configurations don't seem to be taking effect and it seems like the configurations are cached somewhere.

Geth is successfully syncing and mining as well as the pool running successfully.

Steps to reproduce the behaviour

Visible here http://104.238.171.71/

Backtrace

[backtrace]
mikeyb commented 3 years ago

What does your nginx & pool configs look like (with sensitive info removed)?

mikeyb commented 3 years ago

http://104.238.171.71/104.238.171.71:80api/stats Looks like it is just a simple misconfiguration. Should be able to tell once I see the configs

duckducknono commented 3 years ago

Hey

NGINX

server {
    listen 80 default_server;
    listen [::]:80 default_server;

    # SSL configuration
    #
    # listen 443 ssl default_server;
    # listen [::]:443 ssl default_server;
    #
    # Note: You should disable gzip for SSL traffic.
    # See: https://bugs.debian.org/773332
    #
    # Read up on ssl_ciphers to ensure a secure configuration.
    # See: https://bugs.debian.org/765782
    #
    # Self signed certs generated by the ssl-cert package
    # Don't use them in a production server!
    #
    # include snippets/snakeoil.conf;

    root /var/www/openpool/open-ethereum-pool/www/dist;

    # Add index.php to the list if you are using PHP
    index index.html index.htm index.nginx-debian.html index.hbs;

    server_name 104.238.171.71;

    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ index.html;

    ##Allow CORS
    add_header Access-Control-Allow-Origin *;
    add_header Access-Control-Max-Age 3600;
    add_header Access-Control-Expose-Headers Content-Length;
    add_header Access-Control-Allow-Headers Range;
    }

    location /api {
       proxy_pass http://api;
    }

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    #   include snippets/fastcgi-php.conf;
    #
    #   # With php7.0-cgi alone:
    #   fastcgi_pass 127.0.0.1:9000;
    #   # With php7.0-fpm:
    #   fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #   deny all;
    #}
}

upstream api {
    server 127.0.0.1:8080;
}

ENVIRONMENT.JS

/* jshint node: true */

module.exports = function(environment) {
  var ENV = {
    modulePrefix: 'open-ethereum-pool',
    environment: environment,
    rootURL: '/',
    locationType: 'hash',
    EmberENV: {
      FEATURES: {
        // Here you can enable experimental features on an ember canary build
        // e.g. 'with-controller': true
      }
    },

    APP: {
      // API host and port
      ApiUrl: 'http://104.238.171.71/',

      // HTTP mining endpoint
      HttpHost: 'http://example.net',
      HttpPort: 8888,

      // Stratum mining endpoint
      StratumHost: 'example.net',
      StratumPort: 8008,

      // Fee and payout details
      PoolFee: '1%',
      PayoutThreshold: '0.5 Ether',

      // For network hashrate (change for your favourite fork)
      BlockTime: 14.4
    }
  };

  if (environment === 'development') {
    /* Override ApiUrl just for development, while you are customizing
      frontend markup and css theme on your workstation.
    */
    ENV.APP.ApiUrl = 'http://127.0.0.1:8080/'

I realise that the other settings have example.net in them as I have just attempted to put the configs back to originals.

My issues is that the the IP error in dev console never seems to change despite rebuilding.

Thanks for your help!

mikeyb commented 3 years ago

Just to verify, you ran ./build.sh after making the changes to open ethereum pool config? And did a nginx reload after making changes to the nginx configs?

duckducknono commented 3 years ago

Yeah 100% - I've just done a rebuild and restarted again just in case.

I've been through iterations of changing both environment.js and config.json to try and spot changes in the destination error in console but this 'http://104.238.171.71/104.238.171.71:80api/stats' never seems to change. I was wondering if a built file had the potential to hold that IP and doesn't get overwritten after rebuilding? Not entirely sure....

If you're confident the above configurations look correct that I may have to build again from scratch.

mikeyb commented 3 years ago

The configs do seem correct to me. Are there any errors when running build.sh? If you redo the install and still run into issues, I would be willing to jump on the server and take a look at things if you like.

duckducknono commented 3 years ago

There are a few warnings yes - they are related to the API, too, although I had just assumed it was a deprecation thing given all the random package versions I'm using.

OK - well I'll probably try and have a rebuild tomorrow and see if that resolves anything. Thanks for your help - greatly appreciated!

https://pasteboard.co/JVXFC0E.png

tatuiot commented 2 years ago

Hi team, I see this same error on my server , I have been trying to troubleshoot for several days so far. I think it might be related to a permission error, did you find the issue? Please share, thanks a lot

tatuiot commented 2 years ago

Hi team... I finally after so much testing... the fix was the following in open-etc-pool/www/config/environment.js relpace localhost to server address the ENV.APP.ApiUrl entry.