samuelclay / NewsBlur

NewsBlur is a personal news reader that brings people together to talk about the world. A new sound of an old instrument.
http://www.newsblur.com
MIT License
6.91k stars 1k forks source link

SelfHost: ServerSelectionTimeoutError on `make nb` #1810

Closed ppittle closed 1 year ago

ppittle commented 1 year ago

Following the install instructions, but failing applying migrations. I'm running on a few VM running Ubuntu 20.04.6 LTS x64

> git clone https://github.com/samuelclay/NewsBlur.git
> cd NewsBlur
> git log --oneline
cc748198d (HEAD -> master, origin/master, origin/HEAD) Merge branch 'sictiru'
21190c18b (origin/sictiru) Android v13.0.0
> sudo make nb

Fails /bin/bash: gtimeout: command not found and sudo: /usr/bin/security: command not found.

Run sudo make nb again:

 ---> Starting NewsBlur development server...
Operations to perform:
  Apply all migrations: admin, analyzer, auth, contenttypes, django_ses, feed_import, ipn, oauth2_provider, profile, push, reader, recommendations, rss_feeds, sessions, sites, social, zebra
Running migrations:
  Applying rss_feeds.0002_remove_mongo_types...Traceback (most recent call last):
  File "/srv/newsblur/./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 395, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 330, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 371, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 85, in wrapped
    res = handle_func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/core/management/commands/migrate.py", line 243, in handle
    post_migrate_state = executor.migrate(
  File "/usr/local/lib/python3.9/site-packages/django/db/migrations/executor.py", line 117, in migrate
    state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
  File "/usr/local/lib/python3.9/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
    state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
  File "/usr/local/lib/python3.9/site-packages/django/db/migrations/executor.py", line 227, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/usr/local/lib/python3.9/site-packages/django/db/migrations/migration.py", line 124, in apply
    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
  File "/usr/local/lib/python3.9/site-packages/django/db/migrations/operations/special.py", line 190, in database_forwards
    self.code(from_state.apps, schema_editor)
  File "/srv/newsblur/apps/rss_feeds/migrations/0002_remove_mongo_types.py", line 8, in remove_mongo_types
    collections = db.collection_names()
  File "/usr/local/lib/python3.9/site-packages/pymongo/database.py", line 910, in collection_names
    for result in self.list_collections(session=session,
  File "/usr/local/lib/python3.9/site-packages/pymongo/database.py", line 848, in list_collections
    return self.__client._retryable_read(
  File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1514, in _retryable_read
    server = self._select_server(
  File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1346, in _select_server
    server = topology.select_server(server_selector)
  File "/usr/local/lib/python3.9/site-packages/pymongo/topology.py", line 244, in select_server
    return random.choice(self.select_servers(selector,
  File "/usr/local/lib/python3.9/site-packages/pymongo/topology.py", line 202, in select_servers
    server_descriptions = self._select_servers_loop(
  File "/usr/local/lib/python3.9/site-packages/pymongo/topology.py", line 218, in _select_servers_loop
    raise ServerSelectionTimeoutError(
pymongo.errors.ServerSelectionTimeoutError: db_mongo:29019: [Errno -3] Temporary failure in name resolution, Timeout: 30s, Topology Description: <TopologyDescription id: 64d46597d06506dab7b7619b, topology_type: Single, servers: [<ServerDescription ('db_mongo', 29019) server_type: Unknown, rtt: None, error=AutoReconnect('db_mongo:29019: [Errno -3] Temporary failure in name resolution')>]>
Sentry is attempting to send 2 pending error messages
Waiting up to 2 seconds
Press Ctrl-C to quit
make: *** [Makefile:38: migrate] Error 1
ppittle commented 1 year ago

I tried deleting all docker image and re-cloning the repo. Got a bit further this time, but still timedout:

Operations to perform:
  Apply all migrations: admin, analyzer, auth, contenttypes, django_ses, feed_import, ipn, oauth2_provider, profile, push, reader, recommendations, rss_feeds, sessions, sites, social, zebra
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying admin.0002_logentry_remove_auto_add... OK
  Applying admin.0003_logentry_add_action_flag_choices... OK
  Applying rss_feeds.0001_initial... OK
  Applying analyzer.0001_initial... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying auth.0008_alter_user_username_max_length... OK
  Applying auth.0009_alter_user_last_name_max_length... OK
  Applying auth.0010_alter_group_name_max_length... OK
  Applying auth.0011_update_proxy_permissions... OK
  Applying auth.0012_alter_user_first_name_max_length... OK
  Applying django_ses.0001_initial... OK
  Applying feed_import.0001_initial... OK
  Applying ipn.0001_initial... OK
  Applying ipn.0002_paypalipn_mp_id... OK
  Applying ipn.0003_auto_20141117_1647... OK
  Applying ipn.0004_auto_20150612_1826... OK
  Applying ipn.0005_auto_20151217_0948... OK
  Applying ipn.0006_auto_20160108_1112... OK
  Applying ipn.0007_auto_20160219_1135... OK
  Applying ipn.0008_auto_20181128_1032... OK
  Applying oauth2_provider.0001_initial... OK
  Applying oauth2_provider.0002_auto_20190406_1805... OK
  Applying profile.0001_initial... OK
  Applying profile.0002_auto_20200620_0803... OK
  Applying profile.0003_auto_20201005_0932... OK
  Applying profile.0004_auto_20220110_2106... OK
  Applying profile.0005_profile_is_archive... OK
  Applying profile.0006_profile_days_of_unread... OK
  Applying profile.0007_auto_20220125_2108... OK
  Applying profile.0008_profile_paypal_sub_id... OK
  Applying profile.0009_paypalids... OK
  Applying profile.0010_profile_active_provider... OK
  Applying profile.0011_auto_20220408_1908... OK
  Applying profile.0012_auto_20220511_1710... OK
  Applying push.0001_initial... OK
  Applying reader.0001_initial... OK
  Applying recommendations.0001_initial... OK
  Applying rss_feeds.0002_remove_mongo_types...Traceback (most recent call last):
  File "/srv/newsblur/./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 395, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 330, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 371, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 85, in wrapped
    res = handle_func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/core/management/commands/migrate.py", line 243, in handle
    post_migrate_state = executor.migrate(
  File "/usr/local/lib/python3.9/site-packages/django/db/migrations/executor.py", line 117, in migrate
    state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
  File "/usr/local/lib/python3.9/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
    state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
  File "/usr/local/lib/python3.9/site-packages/django/db/migrations/executor.py", line 227, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/usr/local/lib/python3.9/site-packages/django/db/migrations/migration.py", line 124, in apply
    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
  File "/usr/local/lib/python3.9/site-packages/django/db/migrations/operations/special.py", line 190, in database_forwards
    self.code(from_state.apps, schema_editor)
  File "/srv/newsblur/apps/rss_feeds/migrations/0002_remove_mongo_types.py", line 8, in remove_mongo_types
    collections = db.collection_names()
  File "/usr/local/lib/python3.9/site-packages/pymongo/database.py", line 910, in collection_names
    for result in self.list_collections(session=session,
  File "/usr/local/lib/python3.9/site-packages/pymongo/database.py", line 848, in list_collections
    return self.__client._retryable_read(
  File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1514, in _retryable_read
    server = self._select_server(
  File "/usr/local/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1346, in _select_server
    server = topology.select_server(server_selector)
  File "/usr/local/lib/python3.9/site-packages/pymongo/topology.py", line 244, in select_server
    return random.choice(self.select_servers(selector,
  File "/usr/local/lib/python3.9/site-packages/pymongo/topology.py", line 202, in select_servers
    server_descriptions = self._select_servers_loop(
  File "/usr/local/lib/python3.9/site-packages/pymongo/topology.py", line 218, in _select_servers_loop
    raise ServerSelectionTimeoutError(
pymongo.errors.ServerSelectionTimeoutError: db_mongo:29019: [Errno -3] Temporary failure in name resolution, Timeout: 30s, Topology Description: <TopologyDescription id: 64d46821e81fd1eef804c8ae, topology_type: Single, servers: [<ServerDescription ('db_mongo', 29019) server_type: Unknown, rtt: None, error=AutoReconnect('db_mongo:29019: [Errno -3] Temporary failure in name resolution')>]>
Sentry is attempting to send 2 pending error messages
Waiting up to 2 seconds
Press Ctrl-C to quit
ppittle commented 1 year ago

Looks like this is a duplicate of https://github.com/samuelclay/NewsBlur/issues/1792

Still verifying the fix of:

sudo chmod 777 docker/volumes/db_mongo/
ppittle commented 1 year ago

confirmed duplicate of #1792