Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 inernal after upgrade ralph-core #2478

Closed
daro1337 opened this issue Jun 10, 2016 · 21 comments
Closed

500 inernal after upgrade ralph-core #2478

daro1337 opened this issue Jun 10, 2016 · 21 comments

Comments

@daro1337
Copy link

Hey guys I have got 500 internal after upgrade ralph-core from 3.0.0-snapshot-20160607-5736 to 3.0.0-snapshot-20160610
this did help https://github.com/allegro/ralph/issues?page=2&q=is%3Aissue+is%3Aopen

Error:

ralph migrate
/opt/ralph/ralph-core/lib/python3.4/site-packages/django/contrib/contenttypes/models.py:161: RemovedInDjango19Warning: Model class django.contrib.contenttypes.models.ContentType doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
class ContentType(models.Model):

/opt/ralph/ralph-core/lib/python3.4/site-packages/django/contrib/admin/models.py:28: RemovedInDjango19Warning: Model class django.contrib.admin.models.LogEntry doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
class LogEntry(models.Model):

/opt/ralph/ralph-core/lib/python3.4/importlib/_bootstrap.py:321: RemovedInDjango19Warning: django.contrib.contenttypes.generic is deprecated and will be removed in Django 1.9. Its contents have been moved to the fields, forms, and admin submodules of django.contrib.contenttypes.
return f(_args, *_kwds)

/opt/ralph/ralph-core/lib/python3.4/importlib/_bootstrap.py:321: RemovedInDjango19Warning: The utilities in django.db.models.loading are deprecated in favor of the new application loading system.
return f(_args, *_kwds)

/opt/ralph/ralph-core/lib/python3.4/site-packages/django/contrib/auth/models.py:41: RemovedInDjango19Warning: Model class django.contrib.auth.models.Permission doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
class Permission(models.Model):

/opt/ralph/ralph-core/lib/python3.4/site-packages/django/contrib/auth/models.py:98: RemovedInDjango19Warning: Model class django.contrib.auth.models.Group doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
class Group(models.Model):

/opt/ralph/ralph-core/lib/python3.4/site-packages/django/contrib/auth/models.py:436: RemovedInDjango19Warning: Model class django.contrib.auth.models.User doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
class User(AbstractUser):

/opt/ralph/ralph-core/lib/python3.4/site-packages/taggit/models.py:96: RemovedInDjango19Warning: Model class taggit.models.Tag doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
class Tag(TagBase):

/opt/ralph/ralph-core/lib/python3.4/site-packages/taggit/models.py:201: RemovedInDjango19Warning: Model class taggit.models.TaggedItem doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
class TaggedItem(GenericTaggedItemBase, TaggedItemBase):

/opt/ralph/ralph-core/lib/python3.4/importlib/_bootstrap.py:321: RemovedInDjango19Warning: django.utils.importlib will be removed in Django 1.9.
return f(_args, *_kwds)

password and user database are ok. also checked in ralph shell.

@daro1337
Copy link
Author

ok, errors are still occurs, but somehow it works now: what i did: install apt-get purge ralph-core and again install, ralph migrate (with errors),
Type ralph sitetree_resync_apps to reload menu.
=>ralph createsuperuser to add new user.

i created new user (previously after upgrade i didn't made this). Is it essential?
then i run ralph with errors, but it's working.

@mkurek
Copy link
Contributor

mkurek commented Jun 10, 2016

@daro1337 these are just warnings. Could you paste some traceback of this 500 error?

@vi4m
Copy link
Contributor

vi4m commented Jun 10, 2016

probably it's the settings being set to the DEBUG=false in the /opt/ralph ... settings file

@vi4m
Copy link
Contributor

vi4m commented Jun 10, 2016

should be DEBUG=true

@renki81
Copy link

renki81 commented Jul 12, 2016

Hi
I become the same error.
If I want to start ralph and open it in the browser I get this message:
`Environment:

Request Method: GET
Request URL: http://server/

Django Version: 1.8.12
Python Version: 3.4.3
Installed Applications:
('ralph.admin',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.humanize',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_rq',
'import_export',
'mptt',
'reversion',
'sitetree',
'ralph.accounts',
'ralph.assets',
'ralph.attachments',
'ralph.back_office',
'ralph.dashboards',
'ralph.data_center',
'ralph.dhcp',
'ralph.deployment',
'ralph.licences',
'ralph.domains',
'ralph.supports',
'ralph.security',
'ralph.lib.foundation',
'ralph.lib.table',
'ralph.networks',
'ralph.data_importer',
'ralph.dc_view',
'ralph.reports',
'ralph.virtual',
'ralph.operations',
'ralph.lib.external_services',
'ralph.lib.transitions',
'ralph.lib.permissions',
'ralph.lib.custom_fields',
'rest_framework',
'rest_framework.authtoken',
'taggit',
'taggit_serializer',
'ralph.ralph2_sync')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware')

Traceback:
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/core/handlers/base.py" in get_response

  1.                 response = wrapped_callback(request, _callback_args, *_callback_kwargs)
    
    File "/usr/lib/python3.4/contextlib.py" in inner
  2.             return func(_args, *_kwds)
    
    File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/contrib/admin/sites.py" in wrapper
  3.             return self.admin_view(view, cacheable)(_args, *_kwargs)
    
    File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/utils/decorators.py" in _wrapped_view
  4.                 response = view_func(request, _args, *_kwargs)
    
    File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  5.     response = view_func(request, _args, *_kwargs)
    
    File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/contrib/admin/sites.py" in inner
  6.         return view(request, _args, *_kwargs)
    
    File "/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/admin/sites.py" in index
  7.     return super().index(request, extra_context)
    
    File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  8.     response = view_func(request, _args, *_kwargs)
    
    File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/contrib/admin/sites.py" in index
  9.                         'name': apps.get_app_config(app_label).verbose_name,
    
    File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/apps/registry.py" in get_app_config
  10.         raise LookupError("No installed app with label '%s'." % app_label)
    

Exception Type: LookupError at /
Exception Value: No installed app with label 'cross_validator'.`

DEBUG=true have i set

@renki81
Copy link

renki81 commented Jul 12, 2016

I can see that on the server:

`Internal Server Error: /
Traceback (most recent call last):
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/apps/registry.py", line 148, in get_app_config
return self.app_configs[app_label]
KeyError: 'cross_validator'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/core/handlers/base.py", line 132, in get_response
response = wrapped_callback(request, _callback_args, *_callback_kwargs)
File "/usr/lib/python3.4/contextlib.py", line 30, in inner
return func(_args, *_kwds)
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/contrib/admin/sites.py", line 254, in wrapper
return self.admin_view(view, cacheable)(_args, *_kwargs)
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/utils/decorators.py", line 110, in _wrapped_view
response = view_func(request, _args, *_kwargs)
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
response = view_func(request, _args, *_kwargs)
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/contrib/admin/sites.py", line 233, in inner
return view(request, _args, *_kwargs)
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/admin/sites.py", line 77, in index
return super().index(request, extra_context)
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
response = view_func(request, _args, *_kwargs)
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/contrib/admin/sites.py", line 439, in index
'name': apps.get_app_config(app_label).verbose_name,
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/apps/registry.py", line 150, in get_app_config
raise LookupError("No installed app with label '%s'." % app_label)
LookupError: No installed app with label 'cross_validator'.
[12/Jul/2016 11:40:49] "GET / HTTP/1.1" 500 144149
`

@daro1337
Copy link
Author

daro1337 commented Jul 12, 2016

in my case, i had this problem when I did 'apt-get upgrade' (ralph-core) when ralph server was running. Now, i'm stopping ralph server, then i'm updating ralph core, and starting server again.

@renki81
Copy link

renki81 commented Jul 12, 2016

@daro1337 This is also my problem

@daro1337
Copy link
Author

so, is it working now?:)

@ar4s
Copy link
Contributor

ar4s commented Jul 12, 2016

@daro1337 @renki81 please add
export RALPH2_RALPH3_CROSS_VALIDATION_ENABLED=1
to yours .profile until we fixed this bug

@daro1337
Copy link
Author

daro1337 commented Jul 12, 2016

that works, but i had to change DEBUG=true after upgrade :)

@renki81
Copy link

renki81 commented Jul 12, 2016

for me it does not work unfortunately.

When i make: ralph sitetree_resync_apps
comes this:

`Traceback (most recent call last):
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/sitetree/utils.py", line 93, in item
perm = Permission.objects.get(codename=codename, content_type__app_label=app)
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/models/manager.py", line 127, in manager_method
return getattr(self.get_queryset(), name)(_args, *_kwargs)
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/models/query.py", line 334, in get
self.model._meta.object_name
django.contrib.auth.models.DoesNotExist: Permission matching query does not exist.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/ralph/ralph-core/bin/ralph", line 9, in
load_entry_point('ralph==3.0.0', 'console_scripts', 'ralph')()
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/main.py", line 29, in prod
main('ralph.settings.prod')
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/main.py", line 14, in main
execute_from_command_line(sys.argv)
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/core/management/init.py", line 354, in execute_from_command_line
utility.execute()
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/core/management/init.py", line 346, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/core/management/base.py", line 394, in run_from_argv
self.execute(_args, *_cmd_options)
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/core/management/base.py", line 445, in execute
output = self.handle(_args, *_options)
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/sitetree/management/commands/sitetree_resync_apps.py", line 25, in handle
tree_modules = import_project_sitetree_modules()
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/sitetree/utils.py", line 134, in import_project_sitetree_modules
module = import_app_sitetree_module(app)
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/sitetree/utils.py", line 121, in import_app_sitetree_module
sub_module = import_module('%s.%s' % (app, module_name))
File "/opt/ralph/ralph-core/lib/python3.4/importlib/init.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 2254, in _gcd_import
File "", line 2237, in _find_and_load
File "", line 2226, in _find_and_load_unlocked
File "", line 1200, in _load_unlocked
File "", line 1129, in _exec
File "", line 1471, in exec_module
File "", line 321, in _call_with_frames_removed
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/admin/sitetrees.py", line 90, in
('Ralph2 Validation'), 'cross_validator', 'CrossValidationRun'
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/admin/sitetrees.py", line 68, in section
access_by_perms='{}.add
{}'.format(app, model),
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/admin/sitetrees.py", line 40, in ralph_item
return item(_args, *_kwargs)
File "/opt/ralph/ralph-core/lib/python3.4/site-packages/sitetree/utils.py", line 95, in item
raise ValueError('Permission %s.%s does not exist.' % (app, codename))
ValueError: Permission cross_validator.add_crossvalidationrun does not exist.
`

But set in .profile export RALPH2_RALPH3_CROSS_VALIDATION_ENABLED=1
Set DEBUG=true or false
Always the same error.

@ar4s
Copy link
Contributor

ar4s commented Jul 12, 2016

@renki81 please try ralph migrate before ralph sitetree_resync_apps

@renki81
Copy link

renki81 commented Jul 12, 2016

yes i made ralph migrate before ralph sitetree_resync_apps

@vi4m
Copy link
Contributor

vi4m commented Jul 13, 2016

Did the #2565 fix your problem?

@renki81
Copy link

renki81 commented Jul 14, 2016

No Sorry.
I made apt-get install ralph-core and set Debug=True
Than: ralph migrate and ralph sitetree_resync_apps
But comes the same error as before :(

@ar4s
Copy link
Contributor

ar4s commented Jul 14, 2016

@renki81 can you run this query SELECT * FROM ralph_ng.auth_permission where codename like '%crossvalidation%'; from MySQL console and paste the results? where ralph_ng is name of your db

@renki81
Copy link

renki81 commented Jul 14, 2016

Yes my database name ist ralph_ng
I have set the query on my mysql. but i become no results.
I thought that the db perhaps has a problem.

@renki81
Copy link

renki81 commented Jul 14, 2016

Ok sorry my db is damage. i create a new one and all works.

@ar4s
Copy link
Contributor

ar4s commented Jul 14, 2016

@renki81 i'm glad hear that!

@vi4m
Copy link
Contributor

vi4m commented Nov 12, 2016

Fixed, closing then.

@vi4m vi4m closed this as completed Nov 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants