RB 3.0.10 - upgrade problem - cannot import name signals - (in haystack)

43 lượt xem
Chuyển tới thư đầu tiên chưa đọc

Koushik Roy

chưa đọc,
12:19:15 7 thg 8, 20207/8/20
đến Review Board Development

Hi RB team,
  When I upgrade RB from 3.0.6 to 3.0.10 - I get the following problem as a result of running -

     ./contrib/internal/prepare-dev.py

Creating a settings_local.py in the current directory.
This can be modified with custom settings.
Installed post-checkout hook.
Rebuilding media paths...
Synchronizing database...

[!] Unable to execute the manager command syncdb: cannot import name
   signals
<...VIRTUAL_ENV...>/lib/python2.7/site-packages/cryptography/__init__.py:39: CryptographyDeprecationWarning: Python 2 is no longer supported by
the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
 CryptographyDeprecationWarning,


[!] Unable to execute the manager command registerscmtools: cannot
   import name signals

Your Review Board tree is ready for development.

  1. CryptographyDeprecationWarning - OK, I understand this.
  2. Cannot import name signals - this is fatal - coming from haystack/__init__.py:11 - don't know why.
  3. No database file reviewboard-3.0.db was created although the message says "...ready for development."

  Note 1: upgrade to 3.0.9 went smoothly.
  Note 2: Platform Debian 10
  Note 3: I need prepare-dev.py because I have a RB extension and before deploying I need to test my extension.

Please help with #2 and #3. I am stuck with the upgrade, cannot move forward.
At least a workaround will be helpful.

Thank you.

Koushik Roy


Christian Hammond

chưa đọc,
16:02:10 7 thg 8, 20207/8/20
đến reviewb...@googlegroups.com
Hi,

To check, are you attempting to use prepare-dev.py for a development setup, or your production install? It's not meant to be used for production, and our distributed packages are going to be required there if you want things to go smoothly.

What version of django_haystack was installed?

Can you upgrade to 3.0.18 instead? We've capped a lot of dependency version ranges since 3.0.10, for the Python 2/3 transition.

Christian

--

---
You received this message because you are subscribed to the Google Groups "Review Board Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/reviewboard-dev/1a50588a-8693-4f9e-b09e-d55e2dccc025o%40googlegroups.com.


--
Christian Hammond
President/CEO of Beanbag
Makers of Review Board

Koushik Roy

chưa đọc,
16:13:18 7 thg 8, 20207/8/20
đến reviewb...@googlegroups.com
Christian,
  It is a development setup that I am using prepare-dev.py for.
  The version of django_haystack is 2.4.1 as demanded by RB dependencies.
  I tried each single version from 3.0.10 upto and including 3.0.18 - all of them have the same problem.
  3.0.9 does not show this problem.
  A simple hack is to comment out line 11 in haystack/__init__.py - but that does not tell us what the problem is.
  Any clue?
  Thanks,

Koushik



You received this message because you are subscribed to a topic in the Google Groups "Review Board Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/reviewboard-dev/q-t8NB7w_ys/unsubscribe.
To unsubscribe from this group and all its topics, send an email to reviewboard-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/reviewboard-dev/CAE7Vndm1pZrZi%2B7NUjfyNpqXPdccCY-nDwS6_Q6cEwWb2gkGXA%40mail.gmail.com.

Koushik Roy

chưa đọc,
18:04:03 7 thg 8, 20207/8/20
đến Review Board Development
Christian,
I commented out line 11 in haystack/__init.py__ and went on.
Then I wanted to setup with my database in the development environment and I got the following errors -
This happens on every version from 3.0.10 through 3.0.18
This makes it impossible for me to upgrade.
Please help. Thank you.


 ./reviewboard/manage.py validate
...PATH.../lib/python2.7/site-packages/cryptography/__init__.py:39: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in
a future release.
 CryptographyDeprecationWarning,

2020-08-07 21:54:06,690 - DEBUG -  - root - Logging to ./reviewboard.log with a minimum level of DEBUG
2020-08-07 21:54:06,812 - DEBUG -  - root - Log file for Review Board v3.0.10 (PID 31196)
2020-08-07 21:54:06,854 - ERROR -  - djblets.extensions.manager - Error loading extension rbintegrations: APPLICATION_MODEL refers to model oauth.Application that has not been installed
Traceback (most recent call last):
...PATH.../lib/python2.7/site-packages/djblets/extensions/manager.py", line 704, in _load_extensions
   ext_class = entrypoint.load()
...PATH.../lib/python2.7/site-packages/pkg_resources/__init__.py", line 2443, in load
   return self.resolve()
...PATH.../lib/python2.7/site-packages/pkg_resources/__init__.py", line 2449, in resolve
   module = __import__(self.module_name, fromlist=['__name__'], level=0)
...PATH.../lib/python2.7/site-packages/rbintegrations/extension.py", line 6, in <module>
   from reviewboard.extensions.hooks import IntegrationHook, URLHook
...PATH.../src/reviewboard/extensions/hooks.py", line 48, in <module>
   from reviewboard.urls import (diffviewer_url_names,
...PATH.../src/reviewboard/urls.py", line 49, in <module>
   admin.autodiscover()
...PATH.../lib/python2.7/site-packages/django/contrib/admin/__init__.py", line 29, in autodiscover
   import_module('%s.admin' % app)
...PATH.../lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
   __import__(name)
...PATH.../lib/python2.7/site-packages/oauth2_provider/admin.py", line 9, in <module>
   Application = get_application_model()
...PATH.../lib/python2.7/site-packages/oauth2_provider/models.py", line 267, in get_application_model
   raise ImproperlyConfigured(e.format(oauth2_settings.APPLICATION_MODEL))
ImproperlyConfigured: APPLICATION_MODEL refers to model oauth.Application that has not been installed
CommandError: One or more models did not validate:
oauth2_provider.grant: 'application' has a relation with model <class 'reviewboard.oauth.models.Application'>, which has either not been installed or is abstract.
oauth2_provider.accesstoken: 'application' has a relation with model <class 'reviewboard.oauth.models.Application'>, which has either not been installed or is abstract.
oauth2_provider.refreshtoken: 'application' has a relation with model <class 'reviewboard.oauth.models.Application'>, which has either not been installed or is abstract.
reviews.fileattachmentcomment: 'file_attachment' has a relation with model <class 'reviewboard.attachments.models.FileAttachment'>, which has either not been installed or is abstract.
reviews.fileattachmentcomment: 'diff_against_file_attachment' has a relation with model <class 'reviewboard.attachments.models.FileAttachment'>, which has either not been installed or is abstract.
reviews.reviewrequest: 'file_attachments' has an m2m relation with model <class 'reviewboard.attachments.models.FileAttachment'>, which has either not been installed or is abstract.
reviews.reviewrequest: 'inactive_file_attachments' has an m2m relation with model <class 'reviewboard.attachments.models.FileAttachment'>, which has either not been installed or is abstract.
reviews.reviewrequest: 'file_attachment_histories' has an m2m relation with model <class 'reviewboard.attachments.models.FileAttachmentHistory'>, which has either not been installed or is abstract.
reviews.reviewrequestdraft: 'file_attachments' has an m2m relation with model <class 'reviewboard.attachments.models.FileAttachment'>, which has either not been installed or is abstract.
reviews.reviewrequestdraft: 'inactive_file_attachments' has an m2m relation with model <class 'reviewboard.attachments.models.FileAttachment'>, which has either not been installed or is abstract.

To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard-dev+unsubscribe@googlegroups.com.


--
Christian Hammond
President/CEO of Beanbag
Makers of Review Board

--

---
You received this message because you are subscribed to a topic in the Google Groups "Review Board Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/reviewboard-dev/q-t8NB7w_ys/unsubscribe.
To unsubscribe from this group and all its topics, send an email to reviewboard-dev+unsubscribe@googlegroups.com.

Christian Hammond

chưa đọc,
06:40:06 9 thg 8, 20209/8/20
đến reviewb...@googlegroups.com
I can't reproduce any of the problems you're hitting. Seems like there's an issue in your virtualenv somewhere, but I'm not sure what that would be. You shouldn't see the haystack issue or the issue with the `validate` command at all (though `validate` could be a red herring — it takes a more simplistic approach for validation that doesn't necessarily behave with our extension support, though I'm not encountering any errors in my setup).

Is there anything special in your settings_local.py? Anything added by hand, or removed?

If not, first thing I would do is try rebuilding your virtualenv, using the release-3.0.x branch of Review Board (we've recently further capped some dependency ranges for development). If there's some wonkiness with some part of Review Board not being registered, or some part of a system package not being registered, it might address it. I'd keep the old virtualenv around just in case, but set up a new one for now.

Basically, all of this is looking like either import problems (indicating a broken Python setup), broken/incompatible *.pyc files in Review Board/Haystack/others (also worth checking permissions), or something in settings_local.py that's overriding something important (like INSTALLED_APPS).

It's also possible that your extension might be somehow interfering with the loading of some part of setup and subtly breaking things. We should see evidence of that, but it's always worth considering the possibility. You could test by doing a `pip uninstall <yourextension>` to remove the entrypoints.

Christian

--
Christian Hammond
President/CEO of Beanbag
Makers of Review Board

To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard-d...@googlegroups.com.


--
Christian Hammond
President/CEO of Beanbag
Makers of Review Board

--

---
You received this message because you are subscribed to a topic in the Google Groups "Review Board Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/reviewboard-dev/q-t8NB7w_ys/unsubscribe.
To unsubscribe from this group and all its topics, send an email to reviewboard-d...@googlegroups.com.

--

---
You received this message because you are subscribed to the Google Groups "Review Board Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/reviewboard-dev/b812b085-bdad-47ed-bc13-19c254611a28o%40googlegroups.com.

Koushik Roy

chưa đọc,
14:11:51 11 thg 8, 202011/8/20
đến reviewb...@googlegroups.com
Christian,
I used an elimination process to narrow down the problem. Please check below and advice.

Starting djblets 1.0.8 - file extensions/manager.py -
Around line #37 -
try:
    from django_evolution.evolve import get_unapplied_evolutions
except ImportError:
    get_unapplied_evolutions = None

This in turn performs a whole bunch of imports and finally runs into something like
from reviewboard.extensions.base import get_extension_manager (circular dependency on djblet/extension/manager.py ??)

This only happens in the code I added, no wonder you cannot reproduce the problem.
What is your advice on this?
Thanks

Koushik



Christian Hammond

chưa đọc,
02:50:18 30 thg 8, 202030/8/20
đến reviewb...@googlegroups.com
Hi Koushik,

This is late, so I don't know if you're still struggling with this (we've been very busy, my apologies). You said it's only happening in the code you added. What does that look like? is it a particular import in your main extension code?

Christian

Koushik Roy

chưa đọc,
12:18:50 31 thg 8, 202031/8/20
đến reviewb...@googlegroups.com
Christian, no worries. I am not stuck.
I changed my code -
from reviewboard.extensions.base import get_extension_manager <- causing circular dependency on djblets/extensions/manager.py
import reviewboard.extensions as extn <- OK
then use it like - extn.base.get_extension_manager
Thanks



Trả lời tất cả
Trả lời tác giả
Chuyển tiếp
0 tin nhắn mới