CiscoDevNet / yangsuite

Cisco YANG Suite provides a set of tools and plugins to learn, test, and adopt YANG programmable interfaces such as NETCONF, RESTCONF, gNMI and more.
Other
244 stars 75 forks source link

yangsuite-grpc-telemetry not loading #101

Closed nesselzzz closed 1 year ago

nesselzzz commented 1 year ago

Running on Ubuntu 20.4 within docker. The following error is all that shows:

yangsuite_1 | ERROR:root:Error in loading YANG Suite app "yangsuite-grpc-telemetry": cannot import name 'DOCKER_RUN' from partially initialized module 'yangsuite.settings.base' (most likely due to a circular import) (/usr/local/lib/python3.8/dist-packages/yangsuite/settings/base.py) yangsuite_1 | yangsuite_1 | 0 static files copied to '/ys-static', 822 unmodified. yangsuite_1 | ERROR:root:Error in loading YANG Suite app "yangsuite-grpc-telemetry": cannot import name 'DOCKER_RUN' from partially initialized module 'yangsuite.settings.base' (most likely due to a circular import) (/usr/local/lib/python3.8/dist-packages/yangsuite/settings/base.py) yangsuite_1 | No changes detected yangsuite_1 | ERROR:root:Error in loading YANG Suite app "yangsuite-grpc-telemetry": cannot import name 'DOCKER_RUN' from partially initialized module 'yangsuite.settings.base' (most likely due to a circular import) (/usr/local/lib/python3.8/dist-packages/yangsuite/settings/base.py) yangsuite_1 | Operations to perform: yangsuite_1 | Apply all migrations: admin, auth, contenttypes, django_registration, sessions, ysyangtree yangsuite_1 | Running migrations: yangsuite_1 | No migrations to apply. yangsuite_1 | ERROR:root:Error in loading YANG Suite app "yangsuite-grpc-telemetry": cannot import name 'DOCKER_RUN' from partially initialized module 'yangsuite.settings.base' (most likely due to a circular import) (/usr/local/lib/python3.8/dist-packages/yangsuite/settings/base.py) yangsuite_1 | Traceback (most recent call last): yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 84, in _execute yangsuite_1 | return self.cursor.execute(sql, params) yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/backends/sqlite3/base.py", line 423, in execute yangsuite_1 | return Database.Cursor.execute(self, query, params) yangsuite_1 | sqlite3.IntegrityError: UNIQUE constraint failed: auth_user.username yangsuite_1 | yangsuite_1 | The above exception was the direct cause of the following exception: yangsuite_1 | yangsuite_1 | Traceback (most recent call last): yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/yangsuite/manage.py", line 31, in yangsuite_1 | execute_from_command_line(sys.argv) yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/django/core/management/init.py", line 419, in execute_from_command_line yangsuite_1 | utility.execute() yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/django/core/management/init.py", line 413, in execute yangsuite_1 | self.fetch_command(subcommand).run_from_argv(self.argv) yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 354, in run_from_argv yangsuite_1 | self.execute(*args, cmd_options) yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 398, in execute yangsuite_1 | output = self.handle(args, options) yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/django/core/management/commands/shell.py", line 93, in handle yangsuite_1 | exec(sys.stdin.read(), globals()) yangsuite_1 | File "", line 1, in yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/django/contrib/auth/models.py", line 163, in create_superuser yangsuite_1 | return self._create_user(username, email, password, extra_fields) yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/django/contrib/auth/models.py", line 146, in _create_user yangsuite_1 | user.save(using=self._db) yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/django/contrib/auth/base_user.py", line 67, in save yangsuite_1 | super().save(args, kwargs) yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py", line 739, in save yangsuite_1 | self.save_base(using=using, force_insert=force_insert, yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py", line 776, in save_base yangsuite_1 | updated = self._save_table( yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py", line 881, in _save_table yangsuite_1 | results = self._do_insert(cls._base_manager, using, fields, returning_fields, raw) yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py", line 919, in _do_insert yangsuite_1 | return manager._insert( yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/models/manager.py", line 85, in manager_method yangsuite_1 | return getattr(self.get_queryset(), name)(*args, **kwargs) yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 1270, in _insert yangsuite_1 | return query.get_compiler(using=using).execute_sql(returning_fields) yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/models/sql/compiler.py", line 1416, in execute_sql yangsuite_1 | cursor.execute(sql, params) yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 66, in execute yangsuite_1 | return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers yangsuite_1 | return executor(sql, params, many, context) yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 84, in _execute yangsuite_1 | return self.cursor.execute(sql, params) yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/utils.py", line 90, in exit yangsuite_1 | raise dj_exc_value.with_traceback(traceback) from exc_value yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 84, in _execute yangsuite_1 | return self.cursor.execute(sql, params) yangsuite_1 | File "/usr/local/lib/python3.8/dist-packages/django/db/backends/sqlite3/base.py", line 423, in execute yangsuite_1 | return Database.Cursor.execute(self, query, params)

xanderstevenson commented 1 year ago

Hi @nesselzzz,

I would begin with:

  1. make sure you're working within a virtual environment
  2. check circular imports of yangsuite.settings.base module. If you've named any folder or file as 'yangsuite' it could also cause issues
  3. make sure you're not trying to create a user with a username that already exists
  4. ensure that you have the latest versions of YANG Suite and dependencies installed

Any other suggestions are welcome from the team!

miott commented 1 year ago

This issue was resolved in pre-release of yangsuite-grpc-telemetry. You should be able to resolve it by going into the container and installing the pre-release.

# Get yangsuite container ID
docker ps
docker container exec -it <yangsuite container ID> bash
pip3 install yangsuite-grpc-telemetry==1.0.6.post0.dev2
exit
nesselzzz commented 1 year ago

So for whatever reason upgrading to the prerelease did not work, however I noticed there has been a release of an update of all packages recently, so I upgraded across the board and the issue disappeared. Sorry it took me so long to respond and thank you for your assistance and prompt responses, and for all that you do for this community!

miott commented 1 year ago

Thank you.