During migration of a CKAN instance from version 2.7.2 to 2.9 I'm facing the following error:
2022-03-11 14:11:28,312 INFO [ckan.cli] Using configuration file /etc/ckan/____/production.ini
2022-03-11 14:11:28,312 INFO [ckan.config.environment] Loading static files from public
2022-03-11 14:11:28,364 INFO [ckan.config.environment] Loading templates from /usr/lib/ckan/____/local/lib/python2.7/site-packages/ckan-2.9.5-py2.7.egg/ckan/templates
2022-03-11 14:11:28,581 INFO [ckan.config.environment] Loading templates from /usr/lib/ckan/____/local/lib/python2.7/site-packages/ckan-2.9.5-py2.7.egg/ckan/templates
Traceback (most recent call last):
File "/usr/lib/ckan/____/bin/ckan", line 11, in <module>
load_entry_point('ckan==2.9.5', 'console_scripts', 'ckan')()
File "/usr/lib/ckan/____/local/lib/python2.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/ckan/____/local/lib/python2.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/lib/ckan/____/local/lib/python2.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/ckan/____/local/lib/python2.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/ckan/____/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/ckan/____/local/lib/python2.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/lib/ckan/____/local/lib/python2.7/site-packages/ckan-2.9.5-py2.7.egg/ckan/cli/db.py", line 64, in upgrade
_run_migrations(plugin, version)
File "/usr/lib/ckan/____/local/lib/python2.7/site-packages/ckan-2.9.5-py2.7.egg/ckan/cli/db.py", line 122, in _run_migrations
repo.upgrade_db(version)
File "/usr/lib/ckan/____/local/lib/python2.7/site-packages/ckan-2.9.5-py2.7.egg/ckan/model/__init__.py", line 326, in upgrade_db
alembic_upgrade(self.alembic_config, version)
File "/usr/lib/ckan/____/local/lib/python2.7/site-packages/alembic/command.py", line 254, in upgrade
script.run_env()
File "/usr/lib/ckan/____/local/lib/python2.7/site-packages/alembic/script/base.py", line 427, in run_env
util.load_python_file(self.dir, 'env.py')
File "/usr/lib/ckan/____/local/lib/python2.7/site-packages/alembic/util/pyfiles.py", line 81, in load_python_file
module = load_module_py(module_id, path)
File "/usr/lib/ckan/____/local/lib/python2.7/site-packages/alembic/util/compat.py", line 135, in load_module_py
mod = imp.load_source(module_id, path, fp)
File "/usr/lib/ckan/____/local/lib/python2.7/site-packages/ckan-2.9.5-py2.7.egg/ckan/migration/env.py", line 80, in <module>
run_migrations_online()
File "/usr/lib/ckan/____/local/lib/python2.7/site-packages/ckan-2.9.5-py2.7.egg/ckan/migration/env.py", line 74, in run_migrations_online
context.run_migrations()
File "<string>", line 8, in run_migrations
File "/usr/lib/ckan/____/local/lib/python2.7/site-packages/alembic/runtime/environment.py", line 836, in run_migrations
self.get_context().run_migrations(**kw)
File "/usr/lib/ckan/____/local/lib/python2.7/site-packages/alembic/runtime/migration.py", line 330, in run_migrations
step.migration_fn(**kw)
File "/usr/lib/ckan/____/local/lib/python2.7/site-packages/ckan-2.9.5-py2.7.egg/ckan/migration/versions/001_103676e0a497_create_existing_tables.py", line 20, in upgrade
if skip_based_on_legacy_engine_version(op, __name__):
File "/usr/lib/ckan/____/local/lib/python2.7/site-packages/ckan-2.9.5-py2.7.egg/ckan/migration/__init__.py", line 22, in skip_based_on_legacy_engine_version
return int(version) >= int(filename.split(u'_', 1)[0])
ValueError: invalid literal for int() with base 10: 'None'
The skip_based_on_legacy_engine_version function is in this file from codebase. In this comparison int(version) >= int(filename.split(u'_', 1)[0]), the second returns 001, and the filename is the first of the versions folder.
I didn't get if the sqlalchemy migrate_version shoud maintain data stored in the Ckan database, couldn't find out.
The version should be setted on the alembic.ini file ?
Related
I get this strange error on Python2.7. It works fine with Python3:
Traceback (most recent call last):
File "/home/guettli/descript/projects/descript_jugendhaus/.tox/py27-django14/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
main()
File "/home/guettli/descript/projects/descript_jugendhaus/.tox/py27-django14/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/guettli/descript/projects/descript_jugendhaus/.tox/py27-django14/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 133, in prepare_metadata_for_build_wheel
return hook(metadata_directory, config_settings)
File "/tmp/pip-build-env-sy2MSY/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 156, in prepare_metadata_for_build_wheel
self.run_setup()
File "/tmp/pip-build-env-sy2MSY/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 243, in run_setup
self).run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-sy2MSY/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 142, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 195, in <module>
distclass=BinaryDistribution,
File "/tmp/pip-build-env-sy2MSY/overlay/lib/python2.7/site-packages/setuptools/__init__.py", line 162, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-sy2MSY/overlay/lib/python2.7/site-packages/setuptools/command/dist_info.py", line 31, in run
egg_info.run()
File "/tmp/pip-build-env-sy2MSY/overlay/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 296, in run
self.find_sources()
File "/tmp/pip-build-env-sy2MSY/overlay/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 303, in find_sources
mm.run()
File "/tmp/pip-build-env-sy2MSY/overlay/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 534, in run
self.add_defaults()
File "/tmp/pip-build-env-sy2MSY/overlay/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 570, in add_defaults
sdist.add_defaults(self)
File "/tmp/pip-build-env-sy2MSY/overlay/lib/python2.7/site-packages/setuptools/command/py36compat.py", line 36, in add_defaults
self._add_defaults_ext()
File "/tmp/pip-build-env-sy2MSY/overlay/lib/python2.7/site-packages/setuptools/command/py36compat.py", line 118, in _add_defaults_ext
if self.distribution.has_ext_modules():
File "setup.py", line 109, in has_ext_modules
return super().has_ext_modules() or 'SETUPPY_ALLOW_PURE' not in os.environ
TypeError: super() takes at least 1 argument (0 given)
What could be the root-cause?
I found a solution.
If I disable the python-hunter library it works.
I guess python-hunter is not compatible with Python2.7 any more.
That's fine for my use case. I this case I can remove the library (although it is a great tracing library).
I encountered mitmproxy crash issue with Windows 10 64-bit build 19041.207
Following are my crash logs
Mitmproxy: 5.1.1 build pypi_0 from pypi
Python: 3.7.6 from conda-forge
OpenSSL: 1.1.1g build he774522_0 from conda-forge
pyopenssl: 19.1.0 build py_1 from conda-forge
cryptography: 2.9.2 build pypi_0 from pypi
==================
D:\Dev\Anaconda3\envs\WXC_prj\python.exe D:/Dev/Anaconda3/envs/WXC_prj/src/main.py
2020-04-23 22:40:16.216 | INFO | web_server::32 - Gevent server mode
2020-04-23 22:40:19.039 | INFO | web_server::32 - Gevent server mode
`Proxy server listening at http://*:8080
192.168.1.17:58307: clientconnect
192.168.1.17:58309: clientconnect
192.168.1.17:58307: Traceback (most recent call last):
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\proxy\server.py", line 121, in handle root_layer()
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\proxy\modes\http_proxy.py", line 9, in call layer()
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\proxy\protocol\tls.py", line 285, in call layer()
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\proxy\protocol\http1.py", line 83, in call layer()
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\proxy\protocol\http.py", line 190, in call if not self._process_flow(flow):
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\proxy\protocol\http.py", line 262, in _process_flow return self.handle_regular_connect(f)
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\proxy\protocol\http.py", line 208, in handle_regular_connect layer()
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\proxy\protocol\tls.py", line 278, in call self._establish_tls_with_client_and_server()
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\proxy\protocol\tls.py", line 358, in _establish_tls_with_client_and_server self._establish_tls_with_server()
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\proxy\protocol\tls.py", line 448, in _establish_tls_with_server **args
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\connections.py", line 292, in establish_tls self.convert_to_tls(cert=client_cert, sni=sni, **kwargs)
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\net\tcp.py", line 386, in convert_to_tls **sslctx_kwargs
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\net\tls.py", line 285, in create_client_context param = SSL._lib.SSL_CTX_get0_param(context._context)
AttributeError: module 'lib' has no attribute 'SSL_CTX_get0_param'
Traceback (most recent call last):
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\proxy\server.py", line 121, in handle root_layer()
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\proxy\modes\http_proxy.py", line 9, in call layer()
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\proxy\protocol\tls.py", line 285, in call layer()
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\proxy\protocol\http1.py", line 83, in call layer()
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\proxy\protocol\http.py", line 190, in call if not self._process_flow(flow):
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\proxy\protocol\http.py", line 262, in _process_flow return self.handle_regular_connect(f)
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\proxy\protocol\http.py", line 208, in handle_regular_connect layer()
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\proxy\protocol\tls.py", line 278, in call self._establish_tls_with_client_and_server()
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\proxy\protocol\tls.py", line 358, in _establish_tls_with_client_and_server self._establish_tls_with_server()
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\proxy\protocol\tls.py", line 448, in _establish_tls_with_server **args
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\connections.py", line 292, in establish_tls self.convert_to_tls(cert=client_cert, sni=sni, **kwargs)
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\net\tcp.py", line 386, in convert_to_tls **sslctx_kwargs
File "D:\Dev\Anaconda3\envs\WXC_prj\lib\site-packages\mitmproxy\net\tls.py", line 285, in create_client_context param = SSL._lib.SSL_CTX_get0_param(context._context)
AttributeError: module 'lib' has no attribute 'SSL_CTX_get0_param'`
mitmproxy has crashed!
Please lodge a bug report at: https://github.com/mitmproxy/mitmproxy
This looks like you are using an outdated version of the cryptography library.
I installed pytest-bdd at /home/marlu/.local using python setup.py install --user, since I don't have admin privileges. Both python2.7 and pytest are located at /usr/bin/. When I check if pytest-bdd is working correctly by running py.test --version I get an error, could anyone tell me why? Thanks!
Error output:
Traceback (most recent call last):
File "/usr/bin/py.test", line 9, in <module>
load_entry_point('pytest==2.7.0', 'console_scripts', 'py.test-2.7')()
File "/usr/lib/python2.7/site-packages/_pytest/config.py", line 32, in main
config = _prepareconfig(args, plugins)
File "/usr/lib/python2.7/site-packages/_pytest/config.py", line 85, in _prepareconfig
pluginmanager=pluginmanager, args=args)
File "/usr/lib/python2.7/site-packages/_pytest/core.py", line 521, in __call__
return self._docall(self.methods, kwargs)
File "/usr/lib/python2.7/site-packages/_pytest/core.py", line 528, in _docall
firstresult=self.firstresult).execute()
File "/usr/lib/python2.7/site-packages/_pytest/core.py", line 393, in execute
return wrapped_call(method(*args), self.execute)
File "/usr/lib/python2.7/site-packages/_pytest/core.py", line 109, in wrapped_call
wrap_controller.send(call_outcome)
File "/usr/lib/python2.7/site-packages/_pytest/helpconfig.py", line 28, in pytest_cmdline_parse
config = outcome.get_result()
File "/usr/lib/python2.7/site-packages/_pytest/core.py", line 138, in get_result
py.builtin._reraise(*ex)
File "/usr/lib/python2.7/site-packages/_pytest/core.py", line 123, in __init__
self.result = func()
File "/usr/lib/python2.7/site-packages/_pytest/core.py", line 394, in execute
res = method(*args)
File "/usr/lib/python2.7/site-packages/_pytest/config.py", line 636, in pytest_cmdline_parse
self.parse(args)
File "/usr/lib/python2.7/site-packages/_pytest/config.py", line 746, in parse
self._preparse(args)
File "/usr/lib/python2.7/site-packages/_pytest/config.py", line 713, in _preparse
self.pluginmanager.consider_setuptools_entrypoints()
File "/usr/lib/python2.7/site-packages/_pytest/core.py", line 282, in consider_setuptools_entrypoints
self.register(plugin, name=name)
File "/usr/lib/python2.7/site-packages/_pytest/core.py", line 189, in register
reg(plugin, name) # may call addhooks
File "/usr/lib/python2.7/site-packages/_pytest/config.py", line 604, in _register_plugin
{'pluginmanager': self.pluginmanager})
File "/usr/lib/python2.7/site-packages/_pytest/core.py", line 360, in call_plugin
kwargs=kwargs, firstresult=True).execute()
File "/usr/lib/python2.7/site-packages/_pytest/core.py", line 394, in execute
res = method(*args)
File "/home/marlu/.local/lib/python2.7/site-packages/pytest_bdd-2.17.0-py2.7.egg/pytest_bdd/plugin.py", line 15, in pytest_addhooks
from pytest_bdd import hooks
File "/home/marlu/.local/lib/python2.7/site-packages/pytest_bdd-2.17.0-py2.7.egg/pytest_bdd/hooks.py", line 38, in <module>
#pytest.hookspec(firstresult=True)
AttributeError: 'module' object has no attribute 'hookspec'
#pytest.hookspec was introduced in pytest 2.8, so you'd need to upgrade pytest, or downgrade pytest-bdd to 2.16.1. (Whoops, I was the one who broke 2.7 compatibility)
I am using the flask-sqlalchemy extension with alembic for migrations. When I try to add a new migration file and upgrade the schema to the latest one, I get the following error:
AttributeError: 'int' object has no attribute '_compiler_dispatch'
The content of the migration file:
revision = 'ec2c2d40eb1'
down_revision = '28dda873b826'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.alter_column(
'users',
'wiki_permission',
new_column_name='wiki_group',
nullable=False,
existing_nullable=False,
type_=sa.Integer(),
existing_type=sa.Integer(),
server_default=1,
existing_server_default=1 # Line of error - 27
)
def downgrade():
op.alter_column(
'users',
'wiki_group',
new_column_name='wiki_permission',
nullable=False,
existing_nullable=False,
type_=sa.Integer(),
existing_type=sa.Integer(),
server_default=1,
existing_server_default=1
)
Thanks for taking time to help me.
Edit:
The complete error message :
INFO [alembic.migration] Context impl MySQLImpl.
INFO [alembic.migration] Will assume non-transactional DDL.
INFO [alembic.migration] Running upgrade 28dda873b826 -> ec2c2d40eb1, users change column wiki_permission to wiki_group
Traceback (most recent call last):
File "/home/kevin/Code/python/flask/terminus/venv/bin/alembic", line 9, in <module>
load_entry_point('alembic==0.6.5', 'console_scripts', 'alembic')()
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/config.py", line 298, in main
CommandLine(prog=prog).main(argv=argv)
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/config.py", line 293, in main
self.run_cmd(cfg, options)
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/config.py", line 279, in run_cmd
**dict((k, getattr(options, k)) for k in kwarg)
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/command.py", line 125, in upgrade
script.run_env()
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/script.py", line 203, in run_env
util.load_python_file(self.dir, 'env.py')
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/util.py", line 212, in load_python_file
module = load_module_py(module_id, path)
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/compat.py", line 58, in load_module_py
mod = imp.load_source(module_id, path, fp)
File "alembic/env.py", line 77, in <module>
run_migrations_online()
File "alembic/env.py", line 70, in run_migrations_online
context.run_migrations()
File "<string>", line 7, in run_migrations
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/environment.py", line 688, in run_migrations
self.get_context().run_migrations(**kw)
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/migration.py", line 258, in run_migrations
change(**kw)
File "alembic/versions/ec2c2d40eb1_users_change_column_wiki_permission_to_.py", line 27, in upgrade
existing_server_default=1,
File "<string>", line 7, in alter_column
File "<string>", line 1, in <lambda>
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/util.py", line 329, in go
return fn(*arg, **kw)
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/operations.py", line 317, in alter_column
existing_autoincrement=existing_autoincrement
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/ddl/mysql.py", line 44, in alter_column
else existing_autoincrement
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/ddl/impl.py", line 76, in _exec
conn.execute(construct, *multiparams, **params)
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 720, in execute
return meth(self, multiparams, params)
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 67, in _execute_on_connection
return connection._execute_ddl(self, multiparams, params)
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 768, in _execute_ddl
compiled = ddl.compile(dialect=dialect)
File "<string>", line 1, in <lambda>
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 468, in compile
return self._compiler(dialect, bind=bind, **kw)
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 25, in _compiler
return dialect.ddl_compiler(dialect, self, **kw)
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/sqlalchemy/sql/compiler.py", line 197, in __init__
self.string = self.process(self.statement, **compile_kwargs)
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/sqlalchemy/sql/compiler.py", line 220, in process
return obj._compiler_dispatch(self, **kwargs)
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/sqlalchemy/ext/compiler.py", line 410, in <lambda>
lambda *arg, **kw: existing(*arg, **kw))
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/sqlalchemy/ext/compiler.py", line 448, in __call__
return fn(element, compiler, **kw)
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/ddl/mysql.py", line 171, in _mysql_change_column
autoincrement=element.autoincrement
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/ddl/mysql.py", line 190, in _mysql_colspec
spec += " DEFAULT %s" % _render_value(compiler, server_default)
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/alembic/ddl/mysql.py", line 179, in _render_value
return compiler.sql_compiler.process(expr)
File "/home/kevin/Code/python/flask/terminus/venv/local/lib/python2.7/site-packages/sqlalchemy/sql/compiler.py", line 220, in process
return obj._compiler_dispatch(self, **kwargs)
AttributeError: 'int' object has no attribute '_compiler_dispatch'
Alright, I just went through this same issue. I'm not using flask-sqlalchemy, just straight alembic, but it should be identical.
Second, it worked for me with sa.Integer with no parentheses, so I would recommend that.
The alembic docs say:
When producing MySQL-compatible migration files, it is recommended that the existing_type, existing_server_default, and existing_nullable parameters be present, if not being altered.
Since it seems you are not altering these columns, the docs suggest they should be present. So:
Remove nullable, type_, and server_default. They are not being altered.
Keep existing_nullable, existing_type, and existing_server_default.
I am trying to generate a war file on my local machine, so as to deploy the Django application on the web server. I am using Django-Jython for the same purpose. I am using a MySQL database and have set the CLASSPATH variable as mentioned in the documentation. The name of my Django project is "gui" and it resides in C:\
I run the following command :
C:\gui> jython C:\gui\manage.py war --include-java-libs=C:\mysql-connector-java-5.1.16-bin.jar
And I get the following error :
Traceback (most recent call last): File "C:\gui\manage.py", line
10, in execute_from_command_line(sys.argv)
File
"C:\jython2.5.3\Lib\site-packages\django-1.4.3-py2.5.egg\django\core\management__init__.py",
line 443, in execute_from_command_line utility.execute()
File
"C:\jython2.5.3\Lib\site-packages\django-1.4.3-py2.5.egg\django\core\management__init__.py",
line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File
"C:\jython2.5.3\Lib\site-packages\django-1.4.3-py2.5.egg\django\core\management\base.py",
line 196, in run_from_argv
self.execute(*args, **options.dict)
File
"C:\jython2.5.3\Lib\site-packages\django-1.4.3-py2.5.egg\django\core\management\base.py",
line 217, in execute
translation.activate('en-us')
File
"C:\jython2.5.3\Lib\site-packages\django-1.4.3-py2.5.egg\django\core\management\base.py",
line 217, in execute
translation.activate('en-us')
File
"C:\jython2.5.3\Lib\site-packages\django-1.4.3-py2.5.egg\django\utils\translation__init__.py",
line 105, in activate
return _trans.activate(language)
File
"C:\jython2.5.3\Lib\site-packages\django-1.4.3-py2.5.egg\django\utils\translation\trans_real.py",
line 194, in activate
_active.value = translation(language)
File
"C:\jython2.5.3\Lib\site-packages\django-1.4.3-py2.5.egg\django\utils\translation\trans_real.py",
line 183, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
File
"C:\jython2.5.3\Lib\site-packages\django-1.4.3-py2.5.egg\django\utils\translation\trans_real.py",
line 161, in _fetch
apppath = os.path.join(os.path.dirname(app.file), 'locale')
File "C:\jython2.5.3\Lib\ntpath.py", line 207, in dirname
return split(p)[0] File "C:\jython2.5.3\Lib\ntpath.py", line 164, in split
d, p = splitdrive(p) File "C:\jython2.5.3\Lib\ntpath.py", line 119, in splitdrive
if p[1:2] == ':': TypeError: 'NoneType' object is unsubscriptable