susheel227 / wxpos

Automatically exported from code.google.com/p/wxpos
0 stars 1 forks source link

Error creating database PostgreSQL #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
create a database with command CREATE DATABASE wxpos WITH ENCODING='UTF8' 
CONNECTION LIMIT=-1

database "wxpos" is available to the user "admin" for all

after the message "Reconfigure Database?
This will drop the database you chose and recreate it." get the error:

Traceback (most recent call last):
  File "wxPos.py", line 30, in <module>
    pos.app.run(config=args.config)
  File "/mnt/backup/ERP-CRM/openERP/POS/wxpos/test/wxpos/pos/app.py", line 145, in run
    ret = runConfig()
  File "/mnt/backup/ERP-CRM/openERP/POS/wxpos/test/wxpos/pos/app.py", line 120, in runConfig
    pos.modules.configDB()
  File "/mnt/backup/ERP-CRM/openERP/POS/wxpos/test/wxpos/pos/modules/__init__.py", line 219, in configDB
    pos.database.config.create()
  File "/mnt/backup/ERP-CRM/openERP/POS/wxpos/test/wxpos/pos/database/config.py", line 42, in create
    metadata.create_all()
  File "/usr/lib/python2.7/site-packages/sqlalchemy/schema.py", line 2515, in create_all
    tables=tables)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2234, in _run_visitor
    conn._run_visitor(visitorcallable, element, **kwargs)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1904, in _run_visitor
    **kwargs).traverse_single(element)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/sql/visitors.py", line 86, in traverse_single
    return meth(obj, **kw)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/ddl.py", line 67, in visit_metadata
    self.traverse_single(table, create_ok=True)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/sql/visitors.py", line 86, in traverse_single
    return meth(obj, **kw)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/ddl.py", line 80, in visit_table
    _ddl_runner=self)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/event.py", line 274, in __call__
    fn(*args, **kw)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py", line 281, in __call__
    return getattr(self.target, self.name)(*arg, **kw)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/types.py", line 1776, in _on_table_create
    t._on_table_create(target, bind, **kw)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.py", line 557, in _on_table_create
    self.create(bind=bind, checkfirst=checkfirst)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.py", line 508, in create
    bind.execute(CreateEnumType(self))
  File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1405, in execute
    params)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1490, in _execute_ddl
    compiled = ddl.compile(dialect=dialect)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/sql/expression.py", line 1722, in compile
    return self._compiler(dialect, bind=bind, **kw)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/schema.py", line 2852, in _compiler
    return dialect.ddl_compiler(dialect, self, **kw)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 699, in __init__
    self.string = self.process(self.statement)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 718, in process
    return obj._compiler_dispatch(self, **kwargs)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/sql/visitors.py", line 59, in _compiler_dispatch
    return getter(visitor)(self, **kw)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.py", line 734, in visit_create_enum_type
    self.preparer.format_type(type_),
  File "/usr/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.py", line 875, in format_type
    raise exc.ArgumentError("Postgresql ENUM type requires a name.")
ArgumentError: Postgresql ENUM type requires a name.

in the database formed the following table:

wxpos=# \d
                  List of relations
 Schema |           Name           |   Type   | Owner 
--------+--------------------------+----------+-------
 public | cashflow                 | table    | admin
 public | cashflow_id_seq          | sequence | admin
 public | categories               | table    | admin
 public | categories_id_seq        | sequence | admin
 public | currencies               | table    | admin
 public | currencies_id_seq        | sequence | admin
 public | currency_units           | table    | admin
 public | currency_units_id_seq    | sequence | admin
 public | customer_group           | table    | admin
 public | customeraddresses        | table    | admin
 public | customeraddresses_id_seq | sequence | admin
 public | customergroups           | table    | admin
 public | customergroups_id_seq    | sequence | admin
 public | customers                | table    | admin
 public | customers_id_seq         | sequence | admin
 public | menurestrictions         | table    | admin
 public | menurestrictions_id_seq  | sequence | admin
 public | permission_restriction   | table    | admin
 public | permissions              | table    | admin
 public | permissions_id_seq       | sequence | admin
 public | products                 | table    | admin
 public | products_id_seq          | sequence | admin
 public | role_permission          | table    | admin
 public | roles                    | table    | admin
 public | roles_id_seq             | sequence | admin
 public | users                    | table    | admin
 public | users_id_seq             | sequence | admin
(27 rows)

all tables are empty

in config "vxpos.cfg" is written:

drivername = postgresql
host = 127.0.0.1
port = 5432
username = admin
password = qazwsx
database = wxpos

ps:
sorry for my english

Original issue reported on code.google.com by oldbay.a...@gmail.com on 19 Feb 2012 at 9:20

GoogleCodeExporter commented 9 years ago
Right now, I am unable to test and see specific problems on PostgreSQL. I would 
recommend using MySQL (or sqlite if you have no other choice).
Now, I think this issue should be fixed in the latest revision.

Can you tell me if it really did?
Thanks.

Original comment by jadkik94@gmail.com on 21 Feb 2012 at 8:09

GoogleCodeExporter commented 9 years ago
Good day

MySQL or sqlite can not use: trying to integrate wxpos and openERP, openerp use 
postgesql database.

Using the version from svn: last revision 67
in this version - tried to create a database PostgreSQL for wxpos
get the error:

Traceback (most recent call last):
  File "wxPos.py", line 30, in <module>
    pos.app.run(config=args.config)
  File "/home/oldbay/work/OpenERP/WXPOS/TEST/pos/app.py", line 145, in run
    ret = runConfig()
  File "/home/oldbay/work/OpenERP/WXPOS/TEST/pos/app.py", line 120, in runConfig
    pos.modules.configDB()
  File "/home/oldbay/work/OpenERP/WXPOS/TEST/pos/modules/__init__.py", line 219, in configDB
    pos.database.config.create()
  File "/home/oldbay/work/OpenERP/WXPOS/TEST/pos/database/config.py", line 42, in create
    metadata.create_all()
  File "/usr/lib/python2.7/site-packages/sqlalchemy/schema.py", line 2515, in create_all
    tables=tables)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2234, in _run_visitor
    conn._run_visitor(visitorcallable, element, **kwargs)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1904, in _run_visitor
    **kwargs).traverse_single(element)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/sql/visitors.py", line 86, in traverse_single
    return meth(obj, **kw)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/ddl.py", line 67, in visit_metadata
    self.traverse_single(table, create_ok=True)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/sql/visitors.py", line 86, in traverse_single
    return meth(obj, **kw)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/ddl.py", line 80, in visit_table
    _ddl_runner=self)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/event.py", line 274, in __call__
    fn(*args, **kw)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py", line 281, in __call__
    return getattr(self.target, self.name)(*arg, **kw)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/types.py", line 1776, in _on_table_create
    t._on_table_create(target, bind, **kw)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.py", line 557, in _on_table_create
    self.create(bind=bind, checkfirst=checkfirst)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.py", line 508, in create
    bind.execute(CreateEnumType(self))
  File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1405, in execute
    params)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1490, in _execute_ddl
    compiled = ddl.compile(dialect=dialect)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/sql/expression.py", line 1722, in compile
    return self._compiler(dialect, bind=bind, **kw)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/schema.py", line 2852, in _compiler
    return dialect.ddl_compiler(dialect, self, **kw)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 699, in __init__
    self.string = self.process(self.statement)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 718, in process
    return obj._compiler_dispatch(self, **kwargs)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/sql/visitors.py", line 59, in _compiler_dispatch
    return getter(visitor)(self, **kw)
  File "/usr/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.py", line 734, in visit_create_enum_type
    self.preparer.format_type(type_),
  File "/usr/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.py", line 875, in format_type
    raise exc.ArgumentError("Postgresql ENUM type requires a name.")
ArgumentError: Postgresql ENUM type requires a name.

error message - no change

ps:
sorry for my english

Original comment by oldbay.a...@gmail.com on 22 Feb 2012 at 1:02

GoogleCodeExporter commented 9 years ago
Your english is okay. Could be worse :D
This error occurs with columns with Enum type, I fixed all of these.
Anyway, can you do the following so that I get more details on the specific 
tables that are raising this error? Please try this:
go to /trunk/pos/database/__init__.py, on line 30:
engine = create_engine(url)#, echo=True)
write this instead:
engine = create_engine(url, echo=True)
(only erase "#,")
Re-run the configuration, it should print out the queries. You can redirect 
output to a file and attach it here if you want, it's easier.

I'm sorry you have to do this, but I do not currently have access to a pgsql 
database.

Thank

Original comment by jadkik94@gmail.com on 22 Feb 2012 at 6:12

GoogleCodeExporter commented 9 years ago
Маке to your instructions
"log" in attach file:

Sorry: in file Unix-style end-of-line - "log" make in linux

Original comment by oldbay.a...@gmail.com on 22 Feb 2012 at 7:32

Attachments:

GoogleCodeExporter commented 9 years ago
Ok. The problem is what I was thinking of.
Now it should be fixed, see the latest revision r69. You can see the diff for 
more details (stupid mistake).

Sorry for the inconvenience. Tell me if there's still something wrong.
Thanks.

Original comment by jadkik94@gmail.com on 22 Feb 2012 at 8:41

GoogleCodeExporter commented 9 years ago
continue to test
run revision 69
error remained, in attach new log-file

>Sorry for the inconvenience. Tell me if there's still something wrong.

do not apologize: i am happy to help your project

Original comment by oldbay.a...@gmail.com on 22 Feb 2012 at 9:13

Attachments:

GoogleCodeExporter commented 9 years ago
There was one more enum field in customercontact table. Fixed it now.
Thanks again.

Original comment by jadkik94@gmail.com on 22 Feb 2012 at 9:20

GoogleCodeExporter commented 9 years ago
it worked!

database created: tables and data

I will continue testing and integration with OpenERP.

Thank you and good job!

Original comment by oldbay.a...@gmail.com on 22 Feb 2012 at 10:02

GoogleCodeExporter commented 9 years ago
Thanks for reporting this issue.
Keep me updated on your progress in integration with OpenERP.

Original comment by jadkik94@gmail.com on 23 Feb 2012 at 8:59