Code Monkey home page Code Monkey logo

Comments (8)

pudo avatar pudo commented on July 21, 2024

Argh, seen this before. It looks like aleph isn't attempting to create the index correctly. if you have nothing in your database yet, can you please try running aleph evilshit (sorry about the name) - it'll delete and re-create both the SQL and ES indexes.

from aleph.

backgroundcheck avatar backgroundcheck commented on July 21, 2024

Yes, this is a New Installation and Database is Empty. will run this command

from aleph.

backgroundcheck avatar backgroundcheck commented on July 21, 2024

here is the result

root@58ced8c712ec:/aleph# aleph evilshit
INFO:aleph.model:Beginning database migration...
INFO:alembic.runtime.migration:Context impl PostgresqlImpl.
INFO:alembic.runtime.migration:Will assume transactional DDL.
INFO:aleph.model:Creating system roles...
Traceback (most recent call last):
File "/usr/local/bin/aleph", line 9, in
load_entry_point('aleph', 'console_scripts', 'aleph')()
File "/aleph/aleph/manage.py", line 167, in main
manager.run()
File "/usr/local/lib/python2.7/site-packages/flask_script/init.py", line 412, in run
result = self.handle(sys.argv[0], sys.argv[1:])
File "/usr/local/lib/python2.7/site-packages/flask_script/init.py", line 383, in handle
res = handle(_args, *_config)
File "/usr/local/lib/python2.7/site-packages/flask_script/commands.py", line 216, in call
return self.run(_args, *_kwargs)
File "/aleph/aleph/manage.py", line 161, in evilshit
upgrade_db()
File "/aleph/aleph/model/init.py", line 23, in upgrade_db
create_system_roles()
File "/aleph/aleph/model/init.py", line 28, in create_system_roles
Role.load_or_create(Role.SYSTEM_GUEST, Role.SYSTEM, 'All visitors')
File "/aleph/aleph/model/role.py", line 51, in load_or_create
role = cls.by_foreign_id(foreign_id)
File "/aleph/aleph/model/role.py", line 41, in by_foreign_id
return cls.all().filter_by(foreign_id=foreign_id).first()
File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2634, in first
ret = list(self[0:1])
File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2457, in getitem
return list(res)
File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2736, in iter
return self._execute_and_instances(context)
File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2751, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
return meth(self, multiparams, params)
File "/usr/local/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
compiled_sql, distilled_params
File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
context)
File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
exc_info
File "/usr/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 200, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb)
File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
context)
File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) relation "role" does not exist
LINE 2: FROM role
^
[SQL: 'SELECT role.id AS role_id, role.created_at AS role_created_at, role.updated_at AS role_updated_at, role.deleted_at AS role_deleted_at, role.foreign_id AS role_foreign_id, role.name AS role_name, role.email AS role_email, role.api_key AS role_api_key, role.is_admin AS role_is_admin, role.type AS role_type \nFROM role \nWHERE role.deleted_at IS NULL AND role.foreign_id = %(foreign_id_1)s \n LIMIT %(param_1)s'] [parameters: {'foreign_id_1': 'guest', 'param_1': 1}]
root@58ced8c712ec:/aleph#

from aleph.

pudo avatar pudo commented on July 21, 2024

I've pushed a more aggressive version of evilshit. Can you give it a try?

from aleph.

backgroundcheck avatar backgroundcheck commented on July 21, 2024

Yes run the command, results i have pasted already!

from aleph.

pudo avatar pudo commented on July 21, 2024

Now I'm confused - how on earth can this happen. Which of the two errors is showing up: the role table one, or the one about the ES index? If it's the role error, can you please try deleting and re-creating the DB in postgres. If it's the ES index error, please try running aleph init. Sorry for the inconvenience in setting this up!

from aleph.

andkamau avatar andkamau commented on July 21, 2024

I think i've ran into this before, @danishthanvi1
As @pudo says, try evilshit ... If that doesn't do the trick, try below (which is basically sequentially doing what evilshit does):

⚠️ Only do this if it's a fresh installation

  1. Drop the DB:
dropdb aleph -U <user> -W -h <POSTGRES-HOST> -p 5432
  1. Delete the ES index
curl -XDELETE "http://<ES-HOST>:9200/aleph"
  1. Create the DB
createdb -E utf-8 -U <user> -W -h <POSTGRES-HOST> -p 5432
  1. Create the ES index
curl -XPUT "http://<es-host>:9200/aleph"
  1. aleph upgrade

from aleph.

backgroundcheck avatar backgroundcheck commented on July 21, 2024

Hi.

Thanks for your Help, i have managed to Run Aleph it's working with Docker.

One more issue iam facing for that iam opening a New Ticket.

from aleph.

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.