Skip to content

docker-compose up -d fails when network already exists. #6405

@reenberg

Description

@reenberg

VIC version:

vic-v1.2.1-dev-b37a80f8

Deployment details:

I have deployed the VCH with client client and bridge network. --tls-server-key, --tls-server-cert, --tls-ca and --tls-cert-path, with https://vic_address as a insecure registry.

Steps to reproduce:

Running docker-compose up -d on a project where one network is already existing, throws an AttributeError. This could for example be due to the fact that another project is using this network as an "external" and thus the network was not deleted on docker-compose down. Of if you run docker-compose up -d without calling docker-compose down (one might just have stopped a single service, etc).

Note: This only happens as long as the network is not defined as external.

Actual behavior:

$ eval  $(cat vch.env) docker-compose up -d             
Traceback (most recent call last):                                                                          
  File "/usr/local/bin/docker-compose", line 11, in <module>                                                
    sys.exit(main())                                                                                        
  File "/usr/local/lib/python3.5/dist-packages/compose/cli/main.py", line 68, in main                      
    command()                                                                                              
  File "/usr/local/lib/python3.5/dist-packages/compose/cli/main.py", line 121, in perform_command
    handler(command, command_options)                                                                             
  File "/usr/local/lib/python3.5/dist-packages/compose/cli/main.py", line 938, in up
    scale_override=parse_scale_args(options['--scale']),                 
  File "/usr/local/lib/python3.5/dist-packages/compose/project.py", line 419, in up
    self.initialize()                                                    
  File "/usr/local/lib/python3.5/dist-packages/compose/project.py", line 468, in initialize
    self.networks.initialize()                                           
  File "/usr/local/lib/python3.5/dist-packages/compose/network.py", line 257, in initialize
    network.ensure()                                                                         
  File "/usr/local/lib/python3.5/dist-packages/compose/network.py", line 62, in ensure
    check_remote_network_config(data, self)                              
  File "/usr/local/lib/python3.5/dist-packages/compose/network.py", line 191, in check_remote_network_config
    for k in set.union(set(remote_labels.keys()), set(local_labels.keys())):
AttributeError: 'NoneType' object has no attribute 'keys'                

Expected behavior:

No errors, just create whatever services, networks or volumes that are not already created.

Logs:

I can't supply any log files (company policy -- sorry) but I can see from the docker-personality.log, that when trying to bring up the compose project, it first warns about error getting config from source: config not modified, then informs about finding various volumes, and then at the end warns about the same. These are the only new lines in that log file. Other log files doesn't seem to have any related content when trying to run the command.

Metadata

Metadata

Assignees

Labels

area/networkingNetworking-related functionalityseverity/2-seriousHigh usability or functional impact. Often has no workaround.source/customerReported by a customer, directly or via an intermediary

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions