These are chat archives for inuitwallet/ALP-Server

3rd
Apr 2016
Cybnate
@Cybnate
Apr 03 2016 03:22
Got stuck, entered all config. Nud and supervisor are running, but not able to get the main ALP running. The error log below:
var code="16-04-03 05:11:16 - INFO - load pool config 16-04-03 05:11:16 - INFO - load exchanges config(s) 16-04-03 05:11:16 - ERROR - Exchange config check failed: config/exchanges/ccedk.json is not valid json Traceback (most recent call last): File "/home/alp/code/ve/bin/gunicorn", line 11, in <module> sys.exit(run()) File "/home/alp/code/ve/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 74, in run WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run() File "/home/alp/code/ve/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 192, in run super(Application, self).run() File "/home/alp/code/ve/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 72, in run Arbiter(self).run() File "/home/alp/code/ve/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 61, in __init__ self.setup(app) File "/home/alp/code/ve/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 119, in setup self.app.wsgi() File "/home/alp/code/ve/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi self.callable = self.load() File "/home/alp/code/ve/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load return self.load_wsgiapp() File "/home/alp/code/ve/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp return util.import_app(self.app_uri) File "/home/alp/code/ve/local/lib/python2.7/site-packages/gunicorn/util.py", line 357, in import_app __import__(module) File "/home/alp/code/pool_server.py", line 47, in <module> config.load(app, log, os.getenv("CONFIG_DIR", 'config'), log_output=True) File "/home/alp/code/src/config.py", line 40, in load exchange_dict = json.load(exchange) File "/usr/lib/python2.7/json/__init__.py", line 290, in load **kw) File "/usr/lib/python2.7/json/__init__.py", line 338, in loads return _default_decoder.decode(s) File "/usr/lib/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode obj, end = self.scan_once(s, idx) ValueError: Expecting , delimiter: line 27 column 7 (char 455)";
Hope it makes sense to you ;-)
.
And here is the ccedk json
{
  "ccedk": {
    "btc": {
      "reward": 0.025,
      "target": 500,
      "ask": {
        "ratio": 0.50,
        "rank_1": {
          "ratio": 1.00,
          "tolerance": 0.005
        },
        "rank_2": {
          "ratio": 0.00
        }
      },
      "bid": {
        "ratio": 0.50,
        "rank_1": {
          "ratio": 1.00,
          "tolerance": 0.005
        },
        "rank_2": {
          "ratio": 0.00
        }
      }
    }
      "eur": {
      "reward": 0.025,
      "target": 3500,
      "ask": {
        "ratio": 0.50,
        "rank_1": {
          "ratio": 1.00,
          "tolerance": 0.005
        },
        "rank_2": {
          "ratio": 0.00
        }
      },
      "bid": {
        "ratio": 0.50,
        "rank_1": {
          "ratio": 1.00,
          "tolerance": 0.005
        },
        "rank_2": {
          "ratio": 0.00
        }
      }
    }

      "usd": {
      "reward": 0.025,
      "target": 7500,
      "ask": {
        "ratio": 0.50,
        "rank_1": {
          "ratio": 1.00,
          "tolerance": 0.005
        },
        "rank_2": {
          "ratio": 0.00
        }
      },
      "bid": {
        "ratio": 0.50,
        "rank_1": {
          "ratio": 1.00,
          "tolerance": 0.005
        },
        "rank_2": {
          "ratio": 0.00
        }
      }
    }

  }
}
The markdown for code doesn't play nice :-( (fixed)
inuitwallet
@inuitwallet
Apr 03 2016 05:50
Morning/evening @cybnate. You're missing some commas between the
Currency sections.
Between the last } of the BTC section and that start if the 'usd' sextion
Same before the Eur section
Cybnate
@Cybnate
Apr 03 2016 05:57
Allright, that makes sense
Still stuck with the next one:
psycopg2.OperationalError: could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
Firewall issue?
or config?
inuitwallet
@inuitwallet
Apr 03 2016 06:01
Is postgresql running?
Shouldn't be firewall as it's on the same server right?
Cybnate
@Cybnate
Apr 03 2016 06:02
same server yes, no postgreslq is not running for some reason. Will need to check that log
Problem is:
2016-04-03 07:56:52 CEST [1271-1] FATAL: could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": No such file or directory
inuitwallet
@inuitwallet
Apr 03 2016 06:03
Is it running under supervisor?
Cybnate
@Cybnate
Apr 03 2016 06:04
It is not running at all, but it does autostart
..and then fails
inuitwallet
@inuitwallet
Apr 03 2016 06:04
K. There should be a line in your /etc/rc.local to create that directory
If not you can copy it in from the ansible role for postgresql. Failing that you can create /var/run/postgresql manually and it should start
Cybnate
@Cybnate
Apr 03 2016 06:06
There is actually
inuitwallet
@inuitwallet
Apr 03 2016 06:06
That can be an issue on a reboot thoigh as the directory isn't always created on boot (hence the rc.local line)
Cybnate
@Cybnate
Apr 03 2016 06:09
the folder /var/run/postgresql is created
inuitwallet
@inuitwallet
Apr 03 2016 06:10
But still no joy?
Cybnate
@Cybnate
Apr 03 2016 06:10
It even has: /run/postgresql/9.5-main.pg_stat_tmp
With postgre owenership
Looks fine
inuitwallet
@inuitwallet
Apr 03 2016 06:11
Which log file are you looking at for the error?
Cybnate
@Cybnate
Apr 03 2016 06:11
Maybe supervisor issues with rights?
/home/alp/logs
postgresql.log
inuitwallet
@inuitwallet
Apr 03 2016 06:14
Hmm, maybe.
Does ps aux | grep postgresshow anything as running?
Cybnate
@Cybnate
Apr 03 2016 06:17
yes, it does
inuitwallet
@inuitwallet
Apr 03 2016 06:18
I wonder if that is a left over postgres process that us causing supervisor to fail. Try killing it.
Cybnate
@Cybnate
Apr 03 2016 06:18
super visor file looks fine:
[program:postgresql]
command = /usr/lib/postgresql/9.5/bin/postgres -D /var/lib/postgresql/9.5/main -c config_file=/etc/postgresql/9.5/main/postgresql.conf
autostart = true
autorestart = true
user = postgres
redirect_stderr = true
stdout_logfile = /home/alp/logs/postgresql.log
re user
I did a reboot of the VM and issue returned
will try kill
it restarted another process, but no new output in log though
Cybnate
@Cybnate
Apr 03 2016 06:23
Would expect something like ready to accept connections
inuitwallet
@inuitwallet
Apr 03 2016 06:24
Yup I would too.
Does sudo supervisorctl status show it as running?
Cybnate
@Cybnate
Apr 03 2016 06:25
postgre doesn't show up with ps- aux but does with the grep. It looks like a ghost process
No supervisor say fatal indeed
inuitwallet
@inuitwallet
Apr 03 2016 06:27
Ah, when you use grep, the grep process will show up so you should disregard that.
Cybnate
@Cybnate
Apr 03 2016 06:27
Ah, learned something here :-)
inuitwallet
@inuitwallet
Apr 03 2016 06:27
Something that does happen to me occasionally is that the postmaster.pid File doesn't get cleaned up properly.
Cybnate
@Cybnate
Apr 03 2016 06:28
Where does that live?
inuitwallet
@inuitwallet
Apr 03 2016 06:28
That's in /etc/poatgresql/9.5/main
(thats from memory so possibly a little out)
Cybnate
@Cybnate
Apr 03 2016 06:29
No pid in there
postgres user exists, check
Cybnate
@Cybnate
Apr 03 2016 06:36
/var/lib/postgresql/9.5 looks fine
/var/run/postgresql is owned by postgres
On 755
inuitwallet
@inuitwallet
Apr 03 2016 06:40
And nothing at all in the log file set in supervisor conf?
Cybnate
@Cybnate
Apr 03 2016 06:41
Hmm, where does that live, not in etc
Found it
Nothing else than the could not create lock file as above
It appears to retry 4 times
That lock file has a specific code .s.PGSQL.5432.lock. Is always the same? Does that ring a bell? Is it a parameter somewhere?
Port?
inuitwallet
@inuitwallet
Apr 03 2016 06:46
5432 is the port for postgres
To removing that whole directory and then reboot. The line in rc.local should recreate it
Cybnate
@Cybnate
Apr 03 2016 06:48
Ok, deleted and restarted. give me a sec
Folder recreated, same 4 new entries in postgresql.log. This is a tough one :-(
Cybnate
@Cybnate
Apr 03 2016 06:54
How does supervisor take ownership of postgres user?
inuitwallet
@inuitwallet
Apr 03 2016 06:54
Hmm. Time to bust out the Google fu I think. On moment
It starts as root.. Runs the postgres command as the postgres user using su I believe.
Cybnate
@Cybnate
Apr 03 2016 06:55
Ah ok
inuitwallet
@inuitwallet
Apr 03 2016 06:58
sudo chmod a+w /var/run/postgresql seems to work for some people
Cybnate
@Cybnate
Apr 03 2016 07:04
Is that a 775?
instead of the 755
will try
inuitwallet
@inuitwallet
Apr 03 2016 07:05
It should keep the 755 and add those permissions too.
I have to say that I've never had to do that.
If it fails, I'd suggest removing postgres and reinstalling.
It should do all this by default to my mind.
Cybnate
@Cybnate
Apr 03 2016 07:06
Reinstall will be learning curve, have never done that before. Rebooting....
No luck :-(
inuitwallet
@inuitwallet
Apr 03 2016 07:10
Reinstall should be easy. sudo apt-get purge postgresql-9.5. Then sudo apt-get install postgresql-9.5
Or you could rerun the ansible playbook once it's uninstalled
Cybnate
@Cybnate
Apr 03 2016 07:10
Hope that works, will try a bit later. It feels like there is a access problem though
Might try to run postgre as root
inuitwallet
@inuitwallet
Apr 03 2016 07:13
Worth a shot.
Cybnate
@Cybnate
Apr 03 2016 07:37
It is made idiot proof!
"root" execution of the PostgreSQL server is not permitted.
The server must be started under an unprivileged user ID to prevent
possible system security compromise. See the documentation for
more information on how to properly start the server
Just the package reinstall. Phew. Thought I had to go manual. Underway...
Cybnate
@Cybnate
Apr 03 2016 07:44
Reinstall didn't work either. Will try to circumvent supervisor, had some trouble with it earlier
inuitwallet
@inuitwallet
Apr 03 2016 08:00
sudo supervisorctl stop postgresql
sudo service postgresql start
Cybnate
@Cybnate
Apr 03 2016 08:04
What about this:

[pool]
name=LiquidBits
grant_address=B954pkUEdkeT1G5Lq14Cisij5no3RVxHYe
minimum_payout=1

[rpc]
user=alp_nurpc_user
pass=R6wZ0ZNBEmsX1.Dge1DZ
host=127.0.0.1
port=14002

[db]
name=alp
user=alp
pass=geRcDofSzlPJIrYpAqCz
host=localhost
port=5432

Shouldn't pool_config not refer to postgres instead of ALP?
in last entry
under [db]
inuitwallet
@inuitwallet
Apr 03 2016 08:04
That's the database name
It's under postgresql but the database name is alp
Cybnate
@Cybnate
Apr 03 2016 08:05
and user =alp?
Cybnate
@Cybnate
Apr 03 2016 08:10
the 'service postgresql start' starts the database, do have a running process now.
inuitwallet
@inuitwallet
Apr 03 2016 08:11
Yup user alp is right too.
Glad service worked. Weird that supervisor fails though.
Does the pool start now?
Cybnate
@Cybnate
Apr 03 2016 08:12
Now finding out how to start the pool.....
inuitwallet
@inuitwallet
Apr 03 2016 08:13
Supervisor should work
Cybnate
@Cybnate
Apr 03 2016 08:16
start alp? Abnormal termination
Will try again tomorrow
Thanks for your time today. Nice puzzle :-)
inuitwallet
@inuitwallet
Apr 03 2016 08:17
Indeed. Hopefully one with a solution :)