Giter Club home page Giter Club logo

Comments (5)

lordfriend avatar lordfriend commented on May 29, 2024

It seems that the CMD direction isn't correct.
CMD ["bash", "-c", "/etc/init.d/postgresql start && python /albireo/server.py"]
the last part should be python /home/albireo/server.py

from albireo.

lordfriend avatar lordfriend commented on May 29, 2024

@HerringtonDarkholme How did you build your docker image to run anyway? Is that path really runnable?

from albireo.

lordfriend avatar lordfriend commented on May 29, 2024

Sorry for the confusion.
In our production environment, We use a more complex docker-compose configuration to run this project in several separate containers.
And my development environment doesn't use docker because I already setup the environment before the docker file is merged to my repository.

from albireo.

Lyken17 avatar Lyken17 commented on May 29, 2024

Thanks for your response.

I fixed the directory and some other issues. Now I can run docker run , however, the flask server still has errors...

https://github.com/Lyken17/Albireo/blob/master/Dockerfile

✘ 12:35 Albireo (master) ✗ docker run --rm -it -v "latest:/albireo" -p 127.0.0.1:5000:5000 albireo

 * Starting PostgreSQL 9.3 database server                                                  [ OK ]
2018/05/07 07:36:04 http:97 create session storage dir ./.session successfully
2018/05/07 07:36:05 sentry:34 no sentry.yml exists
 * Serving Flask app "server" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off
2018/05/07 07:36:05 _internal:88  * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
2018/05/07 07:36:08 server:94 404 Not Found: The requested URL was not found on the server.  If you entered the URL manually please check your spelling and try again.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1791, in dispatch_request
    self.raise_routing_exception(req)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1774, in raise_routing_exception
    raise request.routing_exception
NotFound: 404 Not Found: The requested URL was not found on the server.  If you entered the URL manually please check your spelling and try again.
2018/05/07 07:36:08 app:1761 Exception on / [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1816, in full_dispatch_request
    return self.finalize_request(rv)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1833, in finalize_request
    response = self.process_response(response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 2114, in process_response
    self.session_interface.save_session(self, ctx.session, response)
  File "/home/albireo/utils/flask_sessions.py", line 76, in save_session
    saved_session = db_session.query(ServerSession).filter(ServerSession.session_id == sid).first()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2825, in first
    ret = list(self[0:1])
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2617, in __getitem__
    return list(res)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2925, in __iter__
    return self._execute_and_instances(context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2948, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 948, in execute
    return meth(self, multiparams, params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py", line 269, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1060, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context
    context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1413, in _handle_dbapi_exception
    exc_info
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
    context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 507, in do_execute
    cursor.execute(statement, parameters)
ProgrammingError: (psycopg2.ProgrammingError) relation "server_session" does not exist
LINE 2: FROM server_session
             ^
 [SQL: 'SELECT server_session.id AS server_session_id, server_session.session_id AS server_session_session_id, server_session.data AS server_session_data, server_session.expiry AS server_session_expiry \nFROM server_session \nWHERE server_session.session_id = %(session_id_1)s \n LIMIT %(param_1)s'] [parameters: {'session_id_1': '345384f3-be48-4ec6-9dfb-8e23d715a71e', 'param_1': 1}] (Background on this error at: http://sqlalche.me/e/f405)
2018/05/07 07:36:08 server:94 (psycopg2.ProgrammingError) relation "server_session" does not exist
LINE 2: FROM server_session
             ^
 [SQL: 'SELECT server_session.id AS server_session_id, server_session.session_id AS server_session_session_id, server_session.data AS server_session_data, server_session.expiry AS server_session_expiry \nFROM server_session \nWHERE server_session.session_id = %(session_id_1)s \n LIMIT %(param_1)s'] [parameters: {'session_id_1': '345384f3-be48-4ec6-9dfb-8e23d715a71e', 'param_1': 1}] (Background on this error at: http://sqlalche.me/e/f405)

from albireo.

lordfriend avatar lordfriend commented on May 29, 2024

Had you run the initialization?

# /etc/init.d/postgresql start && python tools.py --db-init && python tools.py --user-add admin 1234 && python tools.py --user-promote admin 3

python tools.py --db-init must be run for the first time to create database tables.

However, the root should not be accessible by default. all API can be found in http://docs.albireo.apiary.io/

You can also setup the web client to test your server.

from albireo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.