Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to save file in the default path will affect your experience on Wechat. Try other path. #22

Closed
hongyi-zhao opened this issue Nov 11, 2020 · 23 comments
Labels

Comments

@hongyi-zhao
Copy link

hongyi-zhao commented Nov 11, 2020

I start the self-build docker image deepin-wine as shown below:

$ x11docker --share ~/Documents/x11docker --sudouser -c --desktop --init=systemd -- --cap-add=ALL --security-opt seccomp=unconfined -- hongyi-zhao/deepin-wine startdde

This will cause the following problem, which won't appear if I use the --share option like this: "--share ~/x11docker", when starting wechat:

Failure to save file in the default path will affect your experience on Wechat. Try other path.

See the screenshot for more detailed info:

image

Any hints for this problem?

Regards,
HY

@mviereck
Copy link
Owner

I am not sure why wechat has a problem here.
Please check the output of echo $HOME. Maybe wechat has a problem if the path does not start with /home/. It should regard $HOME instead.

Two notes:

  • --share ~/x11docker shares the folder/softlink where x11docker stores all home directories created with --home. This can cause confusion, please avoid this.
  • --cap-add=ALL is really a bad idea and should not be used. Malicious container applications will be able to damage your host.

@hongyi-zhao
Copy link
Author

I am not sure why wechat has a problem here.
Please check the output of echo $HOME. Maybe wechat has a problem if the path does not start with /home/. It should regard $HOME instead.

See following:

werner@e110043d87c5:~/Desktop$ echo $HOME
/home/werner

Two notes:

* `--share ~/x11docker` shares the folder/softlink where x11docker stores all home directories created with `--home`. This can cause confusion, please avoid this.

How exactly should I use this option?

* `--cap-add=ALL` is really a bad idea and should not be used. Malicious container applications will be able to damage your host.

Just for debug purpose and convenience.

@mviereck
Copy link
Owner

How exactly should I use this option?

Just rather share other folders.

@hongyi-zhao
Copy link
Author

hongyi-zhao commented Nov 12, 2020

Based on my tries, only using the --share folder located directly under the $HOME won't trigger the problem, i.e., as below:

--share ~/x11docker-share
or
--home --share ~/x11docker-share

I really can't figure out the reason. It maybe a bug of x11docker.

@mviereck
Copy link
Owner

I have tried some of your suggested failing setups. I cannot reproduce the issue here.
Maybe there is some misconfiguration of wechat in the persistent home folder. You could try to delete the container home folder ~/x11docker/deepin-wine.

@hongyi-zhao
Copy link
Author

Maybe there is some misconfiguration of wechat in the persistent home folder. You could try to delete the container home folder ~/x11docker/deepin-wine.

I don't have this folder at all:

$ ls ~/x11docker/deepin-wine
ls: cannot access '/home/werner/x11docker/deepin-wine': No such file or directory

@mviereck
Copy link
Owner

Ok, than it is /home/werner/x11docker/hongyi-zhao-deepin-wine.

@hongyi-zhao
Copy link
Author

werner@X10DAi:~$ ls /home/werner/x11docker/hongyi-zhao-deepin-wine
ls: cannot access '/home/werner/x11docker/hongyi-zhao-deepin-wine': No such file or directory

@mviereck
Copy link
Owner

If you ran the image with option --home as you said, there must a a matching folder in ~/x11docker.

@hongyi-zhao
Copy link
Author

hongyi-zhao commented Nov 12, 2020

If you ran the image with option --home as you said, there must a a matching folder in ~/x11docker.

Maybe we are discussing different problems. Could you please give the concrete example using the arguments combinations? Let us focus on each specific issue for discussion corresponding to all the situations I described above and take it one step at a time.

@mviereck
Copy link
Owner

My idea is that wechat might have stored a bad configuration.
With option --home x11docker creates persistent home folders in ~/x11docker.
You have made tests with option --home and also with --share ~/x11docker. This might have caused damaged configuration files.
An attempt to fix the issue is to remove the persistent home folder to delete possible configuration files.

@hongyi-zhao
Copy link
Author

hongyi-zhao commented Nov 12, 2020

It seems the problem is not that simple. I've already deleted all the possible configuration folders before the testings:

$ sudo rm -fr ~/.local/share/x11docker
$ rm -fr ~/x11docker

@mviereck
Copy link
Owner

Can you give me an example how I could reproduce the issue?
My wechat image is build as described in README.md.

@hongyi-zhao
Copy link
Author

hongyi-zhao commented Nov 12, 2020

Could you please first build the deepin and deepin-wine images with the same Dockerfiles used by me with the following commands:

$ docker build --network host -f Dockerfiles/deepin . -t hongyi-zhao/deepin
$ docker build --network host -f Dockerfiles/deepin-wine . -t hongyi-zhao/deepin-wine

Then do the tests I mentioned above.

@mviereck
Copy link
Owner

mviereck commented Nov 12, 2020

Could you please first build the deepin and deepin-wine images with the same Dockerfiles used by me with the following commands:

Sorry, I won't build them. I have very low internet speed and the build would take at least about 12 hours. I want to use the internet for other tasks meanwhile.

Running with your first example but my wechat image and a similar shared folder does not trigger the issue:

x11docker --share ~/Dokumente/Arduino --sudouser -c --desktop --init=systemd -- --cap-add=ALL --security-opt seccomp=unconfined -- wechat

Tests with --home or other --share paths did not trigger the issue, too.
Maybe you could investigate on the error message what it might mean and ask e.g. at deepin.org or at wechat.
I've checked for possible wrong ownership of '$HOME` in different setups, but it was always correct.

@hongyi-zhao
Copy link
Author

hongyi-zhao commented Nov 13, 2020

Sorry, I won't build them. I have very low internet speed and the build would take at least about 12 hours.

Today, we all in the 21st century, and I am very surprised that Germany, as a world-famous developed country, should have mature internet technology infrastructure deployed everywhere in the country. How can you have such a low-speed Internet connection? BTW, what's internet bandwidth promised by ISP for you?

Anyway, I'll try to build the exactly same docker image as yours to further pinpoint and check the problem.

@mviereck
Copy link
Owner

Today, we all in the 21st century, and I am very surprised that Germany, as a world-famous developed country, should have mature internet technology infrastructure deployed everywhere in the country.

Yes, it's a shame. Major cities normally have a good high-speed internet, but in rural areas there is often close to no internet at all. Some still use 56K-Modems, others can be happy to receive an UMTS signal.
Many rather poor countries have a better internet infrastructure than Germany.

How can you have such a low-speed Internet connection?

I am living about 3 miles away from a small city in a forest. I have a DSL connection that serves about 50 kilobyte per second, sometimes less. I am happy to get this at all. I am paying for more than this, but the ISP directly said it will be much less and asked me if I really want this. I've tried LTE, too, but depending on the weather conditions the connection broke entirely.
Currently a nearby village is getting fiber glass internet, maybe I can pay to get part of it in one or two years.

@hongyi-zhao
Copy link
Author

hongyi-zhao commented Nov 13, 2020

I created the exactly same docker image as you mentioned here with the following method:

$ cat x11docker-deepin-wechat 
#Example to add wine and wechat:

FROM x11docker/deepin
RUN env DEBIAN_FRONTEND=noninteractive dpkg --add-architecture i386 && apt-get update
RUN env DEBIAN_FRONTEND=noninteractive apt-get install -y \
    deepin-wine deepin-wine32 deepin-wine32-preloader deepin-wine-helper deepin-wine-uninstaller
RUN env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
    deepin.com.wechat

$ docker build --network host -t x11docker/deepin-wechat - < x11docker-deepin-wechat

$ mkdir ~/x11docker-share ~/Documents/x11docker-share

Then I perform the following 4 tests in sequence respectively:

1. $ x11docker --share ~/x11docker-share --sudouser -c --desktop --init=systemd -- --cap-add=ALL --security-opt seccomp=unconfined -- x11docker/deepin-wechat startdde
2. $ x11docker --share ~/Documents/x11docker-share --sudouser -c --desktop --init=systemd -- --cap-add=ALL --security-opt seccomp=unconfined -- x11docker/deepin-wechat startdde
3. $ x11docker --home --share ~/x11docker-share --sudouser -c --desktop --init=systemd -- --cap-add=ALL --security-opt seccomp=unconfined -- x11docker/deepin-wechat startdde
4. $ x11docker --home --share ~/Documents/x11docker-share --sudouser -c --desktop --init=systemd -- --cap-add=ALL --security-opt seccomp=unconfined -- x11docker/deepin-wechat startdde

Once the deepin desktop has been started successfully, I then run the following command under the deepin-terminal to start WeChat for checking whether the problem reported here will be triggered:

$ /opt/deepinwine/apps/Deepin-WeChat/run.sh

Between each of the above two tests, I run the following commands to clear the possible configuration cache:

$ rm -fr x11docker
$ sudo rm -fr ~/.local/share/x11docker

Below is the results obtained based on the above testings. Here , Yes/No means the problem will/won't be triggered.

1. No
2. Yes
3. No
4. Yes

To summarize: only using the --share folder located directly under the $HOME won't trigger the problem, i.e., as below:

--share ~/x11docker-share
or
--home --share ~/x11docker-share

Regards,
HY

@mviereck
Copy link
Owner

mviereck commented Nov 13, 2020

Thank you for the detailed analysis! Now I can reproduce the issue.

I've yet created ~/Documents/x11docker-share and shared it with --share ~/Documents/x11docker-share.
Before this I've used other folders with German names for test runs.

On host, ~/Documents and ~/Documents/x11docker-share are both owned by the host user.
But in container, ~/Documents is owned by root and only ~/Documents/x11docker-share is owned by the container user. Docker only sets the mounted folder itself to the same uid:gid as on host, the parent folders appear as root:root in container.

It seems wechat tries to access ~/Documents and fails because it is owned by root.
I can avoid the failure with --share ~/Documents/x11docker-share --share ~/Documents.

Well, I could have detected this with your earlier informations, too. But I did not thought of the possibility that the folder name itself makes a difference.

I am not sure how to handle this in future. Although --share ~/Documents might be a reasonable solution for this special case, it cannot be a general solution. One might not want to share the parent folders, too.

Another solution for the special wechat case could be to provide a ~/Documents folder so Docker does not need to create it. In the Dockerfile it could be provided with RUN mkdir -p /etc/skel/Documents

However, if a ~/Documents folder exists in the container, with --home --share ~/Documents/x11docker-share an ~/x11docker/wechat/x11docker-share folder with uid root is left on host although it should not. (mviereck/x11docker#303)

@hongyi-zhao
Copy link
Author

Before this I've used other folders with German names for test runs.

As a rule of thumb, it's sensible and reasonable to only use the English ((path|file) name | input method), and so on, for code debugging and bug analysis.

Well, I could have detected this with your earlier informations, too. But I did not thought of the possibility that the folder name itself makes a difference.

Do you mean the German names used by your previous tests?

@mviereck
Copy link
Owner

Do you mean the German names used by your previous tests?

Yes.

@mviereck
Copy link
Owner

I'd say this ticket can finally be closed.

@hongyi-zhao
Copy link
Author

hongyi-zhao commented Nov 27, 2020

Based on my tries, this problem doesn't appear for the wechat running on deepin apricot.

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

No branches or pull requests

2 participants