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

"ERROR: no schema has been selected to create in" from Postgresql #40

Closed
f-f opened this issue Oct 25, 2015 · 8 comments
Closed

"ERROR: no schema has been selected to create in" from Postgresql #40

f-f opened this issue Oct 25, 2015 · 8 comments

Comments

@f-f
Copy link

f-f commented Oct 25, 2015

I am using docker-compose to deploy it, here's the last log of docker-compose up:

zulip_1     | Executing Zulip first start init ...
database_1  | 2015-10-25 19:37:46 UTC [43-1] zulip@zulip ERROR:  no schema has been selected to create in
database_1  | 2015-10-25 19:37:46 UTC [43-2] zulip@zulip STATEMENT:  CREATE TABLE "django_migrations" ("id" serial NOT NULL PRIMARY KEY, "app" varchar(255) NOT NULL, "name" varchar(255) NOT NULL, "applied" timestamp with time zone NOT NULL)
zulip_1     | Traceback (most recent call last):
zulip_1     |   File "/home/zulip/deployments/current/manage.py", line 24, in <module>
zulip_1     |     execute_from_command_line(sys.argv)
zulip_1     |   File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
zulip_1     |     utility.execute()
zulip_1     |   File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 330, in execute
zulip_1     |     self.fetch_command(subcommand).run_from_argv(self.argv)
zulip_1     |   File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 393, in run_from_argv
zulip_1     |     self.execute(*args, **cmd_options)
zulip_1     |   File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 444, in execute
zulip_1     |     output = self.handle(*args, **options)
zulip_1     |   File "/usr/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 93, in handle
zulip_1     |     executor = MigrationExecutor(connection, self.migration_progress_callback)
zulip_1     |   File "/usr/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 19, in __init__
zulip_1     |     self.loader = MigrationLoader(self.connection)
zulip_1     |   File "/usr/lib/python2.7/dist-packages/django/db/migrations/loader.py", line 47, in __init__
zulip_1     |     self.build_graph()
zulip_1     |   File "/usr/lib/python2.7/dist-packages/django/db/migrations/loader.py", line 182, in build_graph
zulip_1     |     self.applied_migrations = recorder.applied_migrations()
zulip_1     |   File "/usr/lib/python2.7/dist-packages/django/db/migrations/recorder.py", line 59, in applied_migrations
zulip_1     |     self.ensure_schema()
zulip_1     |   File "/usr/lib/python2.7/dist-packages/django/db/migrations/recorder.py", line 53, in ensure_schema
zulip_1     |     editor.create_model(self.Migration)
zulip_1     |   File "/usr/lib/python2.7/dist-packages/django/db/backends/base/schema.py", line 286, in create_model
zulip_1     |     self.execute(sql, params or None)
zulip_1     |   File "/usr/lib/python2.7/dist-packages/django/db/backends/base/schema.py", line 111, in execute
zulip_1     |     cursor.execute(sql, params)
zulip_1     |   File "/usr/lib/python2.7/dist-packages/django/db/backends/utils.py", line 64, in execute
zulip_1     |     return self.cursor.execute(sql, params)
zulip_1     |   File "/usr/lib/python2.7/dist-packages/django/db/utils.py", line 97, in __exit__
zulip_1     |     six.reraise(dj_exc_type, dj_exc_value, traceback)
zulip_1     |   File "/usr/lib/python2.7/dist-packages/django/db/backends/utils.py", line 62, in execute
zulip_1     |     return self.cursor.execute(sql)
zulip_1     |   File "/home/zulip/deployments/2015-10-25-16-12-27/zerver/lib/db.py", line 23, in execute
zulip_1     |     return wrapper_execute(self, super(TimeTrackingCursor, self).execute, query, vars)
zulip_1     |   File "/home/zulip/deployments/2015-10-25-16-12-27/zerver/lib/db.py", line 11, in wrapper_execute
zulip_1     |     return action(sql, params)
zulip_1     | django.db.utils.ProgrammingError: no schema has been selected to create in
zulip_1     | 
zulip_1     | Zulip first start init failed in "migrate --noinput". with exit code 0
zulip_zulip_1 exited with code 0
@f-f f-f changed the title Getting ERROR: no schema has been selected to create in Getting "ERROR: no schema has been selected to create in" from Postgresql Oct 25, 2015
@galexrt
Copy link
Collaborator

galexrt commented Oct 25, 2015

@ff- Could you please post the full output and your quay.io/galexrt/zulip image id?

@galexrt
Copy link
Collaborator

galexrt commented Oct 25, 2015

@ff- Thanks for log part. Could you provide the full log of the zulip container?

@f-f
Copy link
Author

f-f commented Oct 25, 2015

@galexrt the image id is quay.io/galexrt/zulip:v1.3.7-1

Here's the full log of the zulip_zulip_1 container:

=== Begin Initial Configuration Phase ===
Executing nginx configuration ...
Nginx configuration succeeded.
Exectuing certificates configuration...
Certificates configuration succeeded.
Setting Zulip secrets ...
Secrets already generated.
Secret found for "email_password".
Secret found for "rabbitmq_password".
Zulip secrets configuration succeeded.
Setting database configuration ...
Setting key "DATABASES", type "array".
Database configuration succeeded.
Setting caches configuration ...
Setting key "CACHES", type "array".
Caches configuration succeeded.
Activating authentication backends ...
Setting key "AUTHENTICATION_BACKENDS", type "array".
Adding authentication backend "EmailAuthBackend".
Authentication backend activation succeeded.
Setting redis configuration ...
Setting key "RATE_LIMITING", type "bool".
Setting key "REDIS_HOST", type "string".
Setting key "REDIS_HOST_PORT", type "int".
Redis configuration succeeded.
Setting rabbitmq configuration ...
Setting key "RABBITMQ_HOST", type "string".
Setting key "RABBITMQ_USERNAME", type "string".
Rabbitmq configuration succeeded.
Executing Zulip configuration ...
Setting key "EMAIL_HOST_USER", type "string".
Setting key "NOREPLY_EMAIL_ADDRESS", type "string".
Setting key "EMAIL_HOST", type "string".
Setting key "EXTERNAL_HOST", type "string".
Setting key "ADMIN_DOMAIN", type "string".
Setting key "DEFAULT_FROM_EMAIL", type "string".
Setting key "ZULIP_ADMINISTRATOR", type "string".
Zulip configuration succeeded.
Auto backup enabled.
=== End Initial Configuration Phase ===
=== Begin Bootstrap Phase ===
Waiting for database server to allow connections ...
(Re)creating database structure ...
Database structure recreated.
Bootstrapping RabbitMQ ...
RabbitMQ deleting user "guest".
Deleting user "guest" ...
RabbitMQ adding user "zulip".
Creating user "zulip" ...
RabbitMQ setting user tags for "zulip".
Setting tags for user "zulip" to [administrator] ...
RabbitMQ setting permissions for user "zulip".
Setting permissions for user "zulip" in vhost "/" ...
RabbitMQ bootstrap succeeded.
Executing Zulip user creation script ...
Zulip user creation left enabled.
Executing Zulip first start init ...
Traceback (most recent call last):
  File "/home/zulip/deployments/current/manage.py", line 24, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 330, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 393, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 444, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 93, in handle
    executor = MigrationExecutor(connection, self.migration_progress_callback)
  File "/usr/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 19, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/usr/lib/python2.7/dist-packages/django/db/migrations/loader.py", line 47, in __init__
    self.build_graph()
  File "/usr/lib/python2.7/dist-packages/django/db/migrations/loader.py", line 182, in build_graph
    self.applied_migrations = recorder.applied_migrations()
  File "/usr/lib/python2.7/dist-packages/django/db/migrations/recorder.py", line 59, in applied_migrations
    self.ensure_schema()
  File "/usr/lib/python2.7/dist-packages/django/db/migrations/recorder.py", line 53, in ensure_schema
    editor.create_model(self.Migration)
  File "/usr/lib/python2.7/dist-packages/django/db/backends/base/schema.py", line 286, in create_model
    self.execute(sql, params or None)
  File "/usr/lib/python2.7/dist-packages/django/db/backends/base/schema.py", line 111, in execute
    cursor.execute(sql, params)
  File "/usr/lib/python2.7/dist-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/usr/lib/python2.7/dist-packages/django/db/utils.py", line 97, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/usr/lib/python2.7/dist-packages/django/db/backends/utils.py", line 62, in execute
    return self.cursor.execute(sql)
  File "/home/zulip/deployments/2015-10-25-16-12-27/zerver/lib/db.py", line 23, in execute
    return wrapper_execute(self, super(TimeTrackingCursor, self).execute, query, vars)
  File "/home/zulip/deployments/2015-10-25-16-12-27/zerver/lib/db.py", line 11, in wrapper_execute
    return action(sql, params)
django.db.utils.ProgrammingError: no schema has been selected to create in

Zulip first start init failed in "migrate --noinput". with exit code 0

@galexrt
Copy link
Collaborator

galexrt commented Oct 25, 2015

@ff- I looked into the problem and I fixed it in 4b46b0b.
Images are currently being built (You can see the status here https://quay.io/repository/galexrt/zulip).

Could you please post the output of the command docker exec -t zulip_zulip_1 env here, if you have added credentials please remove them in the output. Thanks.

@galexrt galexrt changed the title Getting "ERROR: no schema has been selected to create in" from Postgresql "ERROR: no schema has been selected to create in" from Postgresql Oct 25, 2015
@f-f
Copy link
Author

f-f commented Oct 25, 2015

@galexrt that command would not run, because the zulip_zulip_1 container has exited on the error.

The build that you just triggered will be available under the same tag?

@galexrt
Copy link
Collaborator

galexrt commented Oct 25, 2015

@ff- Yes under the same tag. Please repull, when the image is built.
See here https://quay.io/repository/galexrt/zulip.

It will take some time for the image to be built (current estimated time 2 hours).
Sry about the long image build time. But the error you have, should be fixed now.

If you have any other questions, you can join the IRC. :)

@galexrt
Copy link
Collaborator

galexrt commented Oct 25, 2015

@ff- Can you try again with the new image if the error is still there?

@f-f
Copy link
Author

f-f commented Oct 26, 2015

@galexrt it is fixed now, thank you so much for the hotfix! :)

I can see the container starting correctly from the logs, however I cannot access to the webpage yet, due to some SSL problems that I'm debugging. I will open another issue if they are related to this Dockerfile, while I'm closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants