IceWhaleTech / CasaOS

CasaOS - A simple, easy-to-use, elegant open-source Personal Cloud system.
https://casaos.io
Apache License 2.0
26.06k stars 1.42k forks source link

[Bug] can't create container with custom network. Error: network casaos was found but has incorrect label com.docker.compose.network set to "" #1377

Open raphamotta opened 1 year ago

raphamotta commented 1 year ago

Describe the bug

I was using CasaOS without problem in the last 6 months. Today I re-run the install script again for updates (I was already on 0.4.4.1) to see if have new updates. I got the terminal working again (was a known bug) but now I can't create containers from UI with a custom network I have, it calls 'casaos'. I got this error:

network casaos was found but has incorrect label com.docker.compose.network set to ""

I can attach it to container with Portainer as a workaround. It's indeed a bug because I did not have this problem with other old installations.

To Reproduce

Create a custom network and try to change to this in any container from UI.

Expected behavior

no error

Desktop (please complete the following information):

 - OS: Debian 12
 - Browser [e.g. chrome, safari] - Edge
 - Version: latest 117
testing on Raspberry pi and Orange pi
LinkLeong commented 1 year ago

Our application center has been reconstructed, that is, before 0.4.4 applications in 0.4.4 and later versions will appear incompatible problems, we are also actively adapting, we are sorry for the inconvenience caused to you, if necessary, we can assist you to solve the problem.

raphamotta commented 1 year ago

That's OK, I know bugs happens, and I discovered out a workaround. Just to let you know about the bug and hopefully get it fixed soon

LinkLeong commented 1 year ago

Thank you for your feedback, please keep in touch with us if you have any questions.

raphamotta commented 1 year ago

Please don't close the issue, I just tested with a clean installation and it still exist

LinkLeong commented 1 year ago

Okay, we'll follow up.

LinkLeong commented 1 year ago

@raphamotta Any progress?

raphamotta commented 1 year ago

@raphamotta Any progress?

I have the same issue with a fresh installation. Could you please test it too?

LinkLeong commented 1 year ago

Can you export the app to me?

raphamotta commented 1 year ago

Ok, steps to reproduce @LinkLeong :

First, create a custom network thru cli:

docker network create mynetwork

Then, from UI, try to add any container with this new created network. Example:

image

Try to deploy:

image

Could you try to reproduce? There's no file to send to you since no container was created.

I can say that with previous version this was working

cyrus0880 commented 1 year ago

i have same problem with ui use custom docker network but if you use docker-compose.yml

with external:true is work

version: '3'
services:
  main:
    networks:
      - appnet
  ....
networks:
  appnet:
    external: true
cyrus0880 commented 1 year ago

Can you export the app to me?

what version will work? i have same problem in 4.4.2 & 4.4.3

cyrus0880 commented 1 year ago

Can you export the app to me?

if install apps from apps store use docker custom network can do this edit /var/lib/casaos/apps/xxxxx/docker-compose.yml

find this setting and add external: true

networks:
   app:
      name: app
      external: true  # < add this line

and go to ui click start will work

can you fix this at casaos code?

raphamotta commented 1 year ago

Can you export the app to me?

what version will work? i have same problem in 4.4.2 & 4.4.3

4.4.1 and older works, I have one server that I did not update yet

raphamotta commented 9 months ago

This issue still happens on 0.4.5. I will not update till this issue is solved, it's very important to choose the network in the UI.

raphamotta commented 9 months ago

Same error with 0.4.6 version. If you will not fix it, I suggest to take it off from UI.

amccarter commented 7 months ago

I just recently discovered CasaOS and started playing around with it when I ran into this issue, too. I'm running 0.4.7, and the inability to use custom networks is preventing me from really fully utilizing this. I hope that this can be fixed in a future update.

Parlax commented 6 months ago

Still an issue in 0.4.8

raphamotta commented 5 months ago

Same on 0.49. Please @LinkLeong , help us.

lk-vila commented 4 months ago

Happened with me too. I'm on 0.49

Any workarounds?

dragonfire1119 commented 4 months ago

This issue occurs normally when you change the network from the UI. You can use my script to edit the Docker Compose. https://community.bigbeartechworld.com/t/added-an-edit-casaos-apps-script/197?u=dragonfire1119

chxlls commented 4 months ago

You can also add the network to a container via Portainer however this is a band-aid fix.

Bring down the containers, Add the containers to the network, Bring up the containers.

If the containers go down for any reason (system reboot, config change etc) then they will revert to the bridge network and you will have to do it again.

Once you've done this, try ping one of the containers for another container and it should work.

felipechang commented 4 months ago

Managed to add custom network using: sudo docker network create --label com.docker.compose.network=casaos casaos Using 0.49

raphamotta commented 1 month ago

New version e no fix for it.. Just workarounds. Still using version 0.4.4