Skip to content

Conversation

HatsuMora
Copy link

I was running CTFd in a docker host that had portainer.io running at the same time. And I got an error message containing KeyError: 'PublicPort'.

Once I looked into https://my-https-docker:2376/containers/json?all=1 I could see why the error happened.

The portainer ports looks like this:

"Ports":[
{
"IP":"0.0.0.0",
"PrivatePort":9443,
"PublicPort":9443,
"Type":"tcp"
},
{
"IP":"0.0.0.0",
"PrivatePort":8000,
"PublicPort":5080,
"Type":"tcp"
},
{
"PrivatePort":9000,
"Type":"tcp"
}.

Adding an extra check to verify that the Ports contain the key PublicPort

I was running CTFd in a docker host that had portainer.io running at the same time. And I got an error message containing KeyError: 'PublicPort'. 

Once I looked into https://my-https-docker:2376/containers/json?all=1 I could see why the error happened.

The portainer ports looks like this: 

"Ports":[
   {
      "IP":"0.0.0.0",
      "PrivatePort":9443,
      "PublicPort":9443,
      "Type":"tcp"
   },
   {
      "IP":"0.0.0.0",
      "PrivatePort":8000,
      "PublicPort":5080,
      "Type":"tcp"
   },
   {
      "PrivatePort":9000,
      "Type":"tcp"
}.

Adding an extra check to verify that the Ports contain the key PublicPort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant