question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImportError: cannot import name 'MINIO_BUCKET'

See original GitHub issue

Describe the bug I’m installing sregistry via the “official”(?) Ansible Role: https://github.com/grycap/ansible-role-singularity-registry. The only changes I’ve made to it is to customise the Nginx container with a custom configuration to include my TLS certificates as they’re rotated. I’ve included this code below:

- block:
    - name: Upload Nginx HTTPS config
      template:
          src: nginx-https.conf
          dest: "{{ sregistry_dir }}/nginx.conf"

    - name: Upload registry certificate
      copy:
          src: "{{ nginx_https_certificate }}"
          dest: "{{ sregistry_dir }}/registry.crt"

    - name: Upload registry key
      copy:
          src: "{{ nginx_https_key }}"
          dest: "{{ sregistry_dir }}/registry.key"
  when: nginx_use_https

From a freshly cloned copy of the sregistry repository, using the master branch (the default for the Role above), I get the following error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/django/core/handlers/wsgi.py", line 141, in __call__
    response = self.get_response(request)
  File "/usr/local/lib/python3.5/site-packages/django/core/handlers/base.py", line 75, in get_response
    response = self._middleware_chain(request)
  File "/usr/local/lib/python3.5/site-packages/django/core/handlers/exception.py", line 36, in inner
    response = response_for_exception(request, exc)
  File "/usr/local/lib/python3.5/site-packages/django/core/handlers/exception.py", line 90, in response_for_exception
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
  File "/usr/local/lib/python3.5/site-packages/django/core/handlers/exception.py", line 128, in handle_uncaught_exception
    callback, param_dict = resolver.resolve_error_handler(500)
  File "/usr/local/lib/python3.5/site-packages/django/urls/resolvers.py", line 597, in resolve_error_handler
    callback = getattr(self.urlconf_module, 'handler%s' % view_type, None)
  File "/usr/local/lib/python3.5/site-packages/django/utils/functional.py", line 80, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/local/lib/python3.5/site-packages/django/urls/resolvers.py", line 577, in urlconf_module
    return import_module(self.urlconf_name)
  File "/usr/local/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 985, in _gcd_import
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
  File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 697, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "./shub/urls.py", line 19, in <module>
    from shub.apps.library import urls as library_urls
  File "./shub/apps/library/urls.py", line 12, in <module>
    from shub.apps.library import views
  File "./shub/apps/library/views/__init__.py", line 2, in <module>
    from .images import (
  File "./shub/apps/library/views/images.py", line 19, in <module>
    from shub.settings import (
ImportError: cannot import name 'MINIO_BUCKET'

This has only started happening in the week or so. I believe I was able to successfully run sregistry about two weeks ago. I notice that some of the latest commits to the master branch contain references to minio so perhaps something has been introduced that’s breaking this?

To Reproduce The steps to reproduce are either:

  1. Execute the above Ansible Role
  2. See this file for manual steps: https://github.com/grycap/ansible-role-singularity-registry/blob/master/tasks/sregistry.yml

Expected behavior A working Singularity Registry installation with my TLS certificate in place listening on 443.

If applicable, add versions and screenshots to help explain your problem.

  • Latest master branch
  • Ansible 2.9.9

Docker information:

Client: Docker Engine - Community
 Version:           19.03.11
 API version:       1.40
 Go version:        go1.13.10
 Git commit:        42e35e61f3
 Built:             Mon Jun  1 09:13:48 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.11
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.10
  Git commit:       42e35e61f3
  Built:            Mon Jun  1 09:12:26 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:38 (22 by maintainers)

github_iconTop GitHub Comments

1reaction
serlophugcommented, Jun 4, 2020

Hi @mrcrilly and @vsoch ! Sure, I also think that update my repo is the best option. @vsoch , would you give me more information about the Minio configuration for sregistry? Regarding the docker container, Do I have to modify the Dockerfile?

1reaction
vsochcommented, Jun 4, 2020

okay, for a quick fix I’ve released (on GitHub) the current master along with the last version without Minio 1.1.23. I’d highly suggest using the Minio backend it hugely improves memory usage and upload speed (multipart uploads!) I also added a quick fix to the docs to note the version required:

image

Let’s wait to hear from @serlophug to decide on next steps - either updating his repo for Minio support (this would be my preference, it’s a better registry) or providing a recipe here. I’m off to bed, thanks for your kind words! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

ImportError: cannot import name 'S3Error' from 'minio.error'
I have tried to import the minio.error on Python 3.10, which returns this error. How can I resolve this? python · importerror ·...
Read more >
MinIO Client — MinIO Object Storage for Linux
The mc watch command watches for events on the specified MinIO bucket or local filesystem path. For S3 services, use mc event add...
Read more >
Object Storage, Minio, and Kubernetes - Think Microservices
As its name implies, Object Storage stores data as managed objects. ... we have a pristine MinIO instance with no buckets and no...
Read more >
Import files from MinIO | Transloadit Docs
/minio/import imports whole directories of files from your MinIO bucket. ... You can pick any names for Steps except ":original" (reserved for user ......
Read more >
kfx - PyPI
import kfp.components import kfp.dsl import kfx.dsl transforms = ( kfx.dsl. ... print(text) return text @kfp.dsl.pipeline(name="demo") def pipeline(text: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found