transientskp / tkp

A transients-discovery pipeline for astronomical image-based surveys
http://docs.transientskp.org/
BSD 2-Clause "Simplified" License
19 stars 15 forks source link

trap-manage.py deldataset wont delete datasets #539

Closed mkuiack closed 7 years ago

mkuiack commented 8 years ago

It seems not to be reading the host from pipeline.cfg, instead using "localhost" This is run from the project directory and host="vlo.science.uva.nl" in pipeline.cfg

(trapvenv)mkuiack@struis:/scratch/mkuiack/rms_check_16SB$ trap-manage.py deldataset 1

Are you sure you want to delete dataset 1? [y/N]: y
Traceback (most recent call last):
  File "/scratch/mkuiack/trapvenv/bin/trap-manage.py", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/scratch/mkuiack/tkp/tkp/bin/trap-manage.py", line 10, in <module>
    tkp.management.main()
  File "/scratch/mkuiack/tkp/tkp/management.py", line 361, in main
    args.func(args)
  File "/scratch/mkuiack/tkp/tkp/management.py", line 257, in deldataset
    dataset = db.session.query(Dataset).filter(Dataset.id==options.id).one()
  File "/scratch/mkuiack/trapvenv/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2718, in one
    ret = list(self)
  File "/scratch/mkuiack/trapvenv/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2761, in __iter__
    return self._execute_and_instances(context)
  File "/scratch/mkuiack/trapvenv/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2774, in _execute_and_instances
    close_with_result=True)
  File "/scratch/mkuiack/trapvenv/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2765, in _connection_from_session
    **kw)
  File "/scratch/mkuiack/trapvenv/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 893, in connection
    execution_options=execution_options)
  File "/scratch/mkuiack/trapvenv/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 898, in _connection_for_bind
    engine, execution_options)
  File "/scratch/mkuiack/trapvenv/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 334, in _connection_for_bind
    conn = bind.contextual_connect()
  File "/scratch/mkuiack/trapvenv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2039, in contextual_connect
    self._wrap_pool_connect(self.pool.connect, None),
  File "/scratch/mkuiack/trapvenv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2078, in _wrap_pool_connect
    e, dialect, self)
  File "/scratch/mkuiack/trapvenv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1405, in _handle_dbapi_exception_noconnection
    exc_info
  File "/scratch/mkuiack/trapvenv/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 202, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/scratch/mkuiack/trapvenv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2074, in _wrap_pool_connect
    return fn()
  File "/scratch/mkuiack/trapvenv/local/lib/python2.7/site-packages/sqlalchemy/pool.py", line 376, in connect
    return _ConnectionFairy._checkout(self)
  File "/scratch/mkuiack/trapvenv/local/lib/python2.7/site-packages/sqlalchemy/pool.py", line 713, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/scratch/mkuiack/trapvenv/local/lib/python2.7/site-packages/sqlalchemy/pool.py", line 480, in checkout
    rec = pool._do_get()
  File "/scratch/mkuiack/trapvenv/local/lib/python2.7/site-packages/sqlalchemy/pool.py", line 1151, in _do_get
    return self._create_connection()
  File "/scratch/mkuiack/trapvenv/local/lib/python2.7/site-packages/sqlalchemy/pool.py", line 323, in _create_connection
    return _ConnectionRecord(self)
  File "/scratch/mkuiack/trapvenv/local/lib/python2.7/site-packages/sqlalchemy/pool.py", line 449, in __init__
    self.connection = self.__connect()
  File "/scratch/mkuiack/trapvenv/local/lib/python2.7/site-packages/sqlalchemy/pool.py", line 607, in __connect
    connection = self.__pool._invoke_creator(self)
  File "/scratch/mkuiack/trapvenv/local/lib/python2.7/site-packages/sqlalchemy/engine/strategies.py", line 97, in connect
    return dialect.connect(*cargs, **cparams)
  File "/scratch/mkuiack/trapvenv/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 385, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/scratch/mkuiack/trapvenv/local/lib/python2.7/site-packages/psycopg2/__init__.py", line 164, in connect
    conn = _connect(dsn, connection_factory=connection_factory, async=async)
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not connect to server: Connection refused
        Is the server running on host "localhost" (::1) and accepting
        TCP/IP connections on port 5432?
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?
gijzelaerr commented 7 years ago

solved by PR