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

[conan_server] Could not start Conan Server 1.13 #4723

Closed
uilianries opened this issue Mar 12, 2019 · 5 comments

Comments

@uilianries
Copy link
Member

commented Mar 12, 2019

To help us debug your issue please explain:

Hi!

Conan Version: 1.13.0

I'm updating Conan Docker Tools and the Conan Server image is not working:

docker run -t -p 9300:9300 --name conan-server conanio/conan_server:latest
[2019-03-12 18:19:25 +0000] [7] [INFO] Starting gunicorn 19.9.0
[2019-03-12 18:19:25 +0000] [7] [INFO] Listening at: http://0.0.0.0:9300 (7)
[2019-03-12 18:19:25 +0000] [7] [INFO] Using worker: sync
[2019-03-12 18:19:25 +0000] [10] [INFO] Booting worker with pid: 10
[2019-03-12 18:19:25 +0000] [11] [INFO] Booting worker with pid: 11
[2019-03-12 18:19:25 +0000] [12] [INFO] Booting worker with pid: 12
[2019-03-12 18:19:25 +0000] [13] [INFO] Booting worker with pid: 13
**********************************************
**********************************************
*                                            *
*      ERROR: STORAGE MIGRATION NEEDED!      *
*                                            *
*      ERROR: STORAGE MIGRATION NEEDED!      *
*                                            *
**********************************************
A migration of your storage is needed, please backup first the storage directory and run:

$ conan_server --migrate

[2019-03-12 18:19:25 +0000] [11] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
    worker.init_process()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
    self.load_wsgi()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
    return self.load_wsgiapp()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/usr/local/lib/python3.7/site-packages/gunicorn/util.py", line 350, in import_app
    __import__(module)
  File "/conan-1.13.0/conans/server/server_launcher.py", line 3, in <module>
    launcher = ServerLauncher()
  File "/conan-1.13.0/conans/server/launcher.py", line 27, in __init__
    server_config = migrate_and_get_server_config(user_folder, None, self.force_migration)
  File "/conan-1.13.0/conans/server/migrate.py", line 10, in migrate_and_get_server_config
    storage_path = server_config.disk_storage_path
  File "/conan-1.13.0/conans/server/conf/__init__.py", line 139, in disk_storage_path
    mkdir(ret)
  File "/conan-1.13.0/conans/util/files.py", line 231, in mkdir
    os.makedirs(path)
  File "/usr/local/lib/python3.7/os.py", line 221, in makedirs
    mkdir(name, mode)
FileExistsError: [Errno 17] File exists: '/root/.conan_server/data'
[2019-03-12 18:19:25 +0000] [11] [INFO] Worker exiting (pid: 11)

Steps

wget https://github.com/conan-io/conan/archive/1.13.0.zip
unzip 1.13.0.zip
cd conan-1.13.0
pip3 install -r conans/requirements.txt
pip3 install -r conans/requirements_server.txt
pip3 install gunicorn
gunicorn -b 0.0.0.0:9300 -w 4 -t 300 conans.server.server_launcher:app

Troubleshooting

If I install Conan and run the migration, Conan Server works again:

pip3 install conan-1.13.0/
conan_server --migrate
gunicorn -b 0.0.0.0:9300 -w 4 -t 300 conans.server.server_launcher:app
  • I've read the CONTRIBUTING guide.
  • I've specified the Conan version, operating system version and any tool that can be relevant.
  • I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.
@memsharded

This comment has been minimized.

Copy link
Member

commented Mar 12, 2019

I think this was explicit decission. A migration on the server side is a bit risky, so we preferred to request a backup before migrating.

I will assign @lasote for confirming this point.

@uilianries

This comment has been minimized.

Copy link
Member Author

commented Mar 12, 2019

I think the problem is related to gunicorn + multiple workers. I'm able to run gnuicorn with 1 worker, but the error only happens when there are multiple workers.

As ~/.conan_server is not created yet and multiple workers try to do the same thing at startup, some conflict happens.

@memsharded

This comment has been minimized.

Copy link
Member

commented Mar 12, 2019

Oh, yes exactly! The migration cannot be done by multiple workers, this definitely should fail.

@uilianries

This comment has been minimized.

Copy link
Member Author

commented Mar 12, 2019

So this issue should be invalid, since we can't fix it, but we need to warning some way when this happen, because the solution is not clear at first execution. Maybe adding a section in conan docs.

@lasote

This comment has been minimized.

Copy link
Contributor

commented Mar 13, 2019

I think its clear enough with the printed message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.