Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Docker error on brick build: "invalid tag format" #9

Closed
dafrie opened this issue Dec 17, 2019 · 2 comments
Closed

Docker error on brick build: "invalid tag format" #9

dafrie opened this issue Dec 17, 2019 · 2 comments

Comments

@dafrie
Copy link
Contributor

dafrie commented Dec 17, 2019

Following error I get with running brick build cmd. Beforehand I tried clearing everything in docker with docker system prune -a

Stack trace:

david@Davids-MBP backend % brick build        
2019-12-17 09:52:18,813 [INFO] 🔨 Preparing backend..
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/docker/api/client.py", line 256, in _raise_for_status
    response.raise_for_status()
  File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localhost/v1.35/images/sha256:4486daa9b9cf7e43bb8edc2987119249280e6dcf936dbd8b1469471102e306c7/tag?tag=df-%231356-electricity-input-dates&repo=backend_prepare&force=0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/brick", line 8, in <module>
    sys.exit(entrypoint())
  File "/usr/local/lib/python3.7/site-packages/brick/__main__.py", line 445, in entrypoint
    cli()  # pylint: disable=no-value-for-parameter
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/brick/__main__.py", line 266, in build
    digest = ctx.invoke(prepare, target=target)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/brick/__main__.py", line 249, in prepare
    dockerfile_contents=dockerfile_contents)
  File "/usr/local/lib/python3.7/site-packages/brick/__main__.py", line 143, in docker_build
    tag=version)
  File "/usr/local/lib/python3.7/site-packages/docker/models/images.py", line 122, in tag
    return self.client.api.tag(self.id, repository, tag=tag, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/docker/utils/decorators.py", line 19, in wrapped
    return f(self, resource_id, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/docker/api/image.py", line 533, in tag
    self._raise_for_status(res)
  File "/usr/local/lib/python3.7/site-packages/docker/api/client.py", line 258, in _raise_for_status
    raise create_api_error_from_http_exception(e)
  File "/usr/local/lib/python3.7/site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
docker.errors.APIError: 500 Server Error: Internal Server Error ("invalid tag format")

Output of docker py client:

{
  "ID": "QOKV:D5C3:5VOQ:JUQ7:DJ7M:ROSE:JZ3G:LYCS:NKUX:BZUU:WNHP:TOKZ",
  "Containers": 0,
  "ContainersRunning": 0,
  "ContainersPaused": 0,
  "ContainersStopped": 0,
  "Images": 1,
  "Driver": "overlay2",
  "DriverStatus": [
    [
      "Backing Filesystem",
      "extfs"
    ],
    [
      "Supports d_type",
      "true"
    ],
    [
      "Native Overlay Diff",
      "true"
    ]
  ],
  "SystemStatus": null,
  "Plugins": {
    "Volume": [
      "local"
    ],
    "Network": [
      "bridge",
      "host",
      "ipvlan",
      "macvlan",
      "null",
      "overlay"
    ],
    "Authorization": null,
    "Log": [
      "awslogs",
      "fluentd",
      "gcplogs",
      "gelf",
      "journald",
      "json-file",
      "local",
      "logentries",
      "splunk",
      "syslog"
    ]
  },
  "MemoryLimit": true,
  "SwapLimit": true,
  "KernelMemory": true,
  "KernelMemoryTCP": true,
  "CpuCfsPeriod": true,
  "CpuCfsQuota": true,
  "CPUShares": true,
  "CPUSet": true,
  "PidsLimit": true,
  "IPv4Forwarding": true,
  "BridgeNfIptables": true,
  "BridgeNfIp6tables": true,
  "Debug": true,
  "NFd": 29,
  "OomKillDisable": true,
  "NGoroutines": 45,
  "SystemTime": "2019-12-17T09:30:08.44687291Z",
  "LoggingDriver": "json-file",
  "CgroupDriver": "cgroupfs",
  "NEventsListener": 2,
  "KernelVersion": "4.9.184-linuxkit",
  "OperatingSystem": "Docker Desktop",
  "OSType": "linux",
  "Architecture": "x86_64",
  "IndexServerAddress": "https://index.docker.io/v1/",
  "RegistryConfig": {
    "AllowNondistributableArtifactsCIDRs": [],
    "AllowNondistributableArtifactsHostnames": [],
    "InsecureRegistryCIDRs": [
      "127.0.0.0/8"
    ],
    "IndexConfigs": {
      "docker.io": {
        "Name": "docker.io",
        "Mirrors": [],
        "Secure": true,
        "Official": true
      }
    },
    "Mirrors": []
  },
  "NCPU": 6,
  "MemTotal": 2095673344,
  "GenericResources": null,
  "DockerRootDir": "/var/lib/docker",
  "HttpProxy": "gateway.docker.internal:3128",
  "HttpsProxy": "gateway.docker.internal:3129",
  "NoProxy": "",
  "Name": "docker-desktop",
  "Labels": [],
  "ExperimentalBuild": false,
  "ServerVersion": "19.03.4",
  "ClusterStore": "",
  "ClusterAdvertise": "",
  "Runtimes": {
    "runc": {
      "path": "runc"
    }
  },
  "DefaultRuntime": "runc",
  "Swarm": {
    "NodeID": "",
    "NodeAddr": "",
    "LocalNodeState": "inactive",
    "ControlAvailable": false,
    "Error": "",
    "RemoteManagers": null
  },
  "LiveRestoreEnabled": false,
  "Isolation": "",
  "InitBinary": "docker-init",
  "ContainerdCommit": {
    "ID": "b34a5c8af56e510852c35414db4c1f4fa6172339",
    "Expected": "b34a5c8af56e510852c35414db4c1f4fa6172339"
  },
  "RuncCommit": {
    "ID": "3e425f80a8c931f88e6d94a8c831b9d5aa481657",
    "Expected": "3e425f80a8c931f88e6d94a8c831b9d5aa481657"
  },
  "InitCommit": {
    "ID": "fec3683",
    "Expected": "fec3683"
  },
  "SecurityOptions": [
    "name=seccomp,profile=default"
  ],
  "ProductLicense": "Community Engine",
  "Warnings": null
}
@corradio
Copy link
Member

I think this is due to your branch having the # symbol. We should probably escape that symbol when creating the tag name in brick

corradio added a commit that referenced this issue Dec 17, 2019
@corradio
Copy link
Member

works now!

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

No branches or pull requests

2 participants