CR: Support for hostname, adding CA, https in docker compose setup. #17
Replies: 26 comments 3 replies
-
That's mean you're using VM setup where your server is on computer/instance different from client.
This is correct configuration May I know do you use hostname for your VM as Please let me know which one you use localhost or VM? And then try the above approach and if you still have issue then I'll request logs and more details about how the setup done. |
Beta Was this translation helpful? Give feedback.
-
@uniuuu, sorry, I'll try to be more explicit.
Yes, I am running in a VM setup. And yes, I made sure to build both the client and the server using the VM hostname.
Ok. Thanks for the clarification. I thought it must be correct, because I looked at the Git blame for that line, and the change looked intentional.
Yes, I am using the hostname. The VM is running on an internal, private network. I usually don't have any problem with DNS over that network. For example, I can use my laptop to access the MinIO console at
I think I've done everything correctly. I tried to follow the instructions as closely as possible. Thank you in advance for any additional help you can provide. Oh, I should add a few more details, since they might be relevant. I am trying to run this on an internal network, and we have our own root certificate. I added that certificate into the For those 4 Dockerfiles, I had to use two slightly different approaches, depending on whether I could use RUN mkdir -p /usr/local/share/ca-certificates/ \
&& wget https://internal-url/cert.cer -O /usr/local/share/ca-certificates/cert.crt \
&& cat /usr/local/share/ca-certificates/cert.crt >> /etc/ssl/certs/ca-certificates.crt And for the COPY cert.crt /usr/local/share/ca-certificates/cert.crt
RUN mkdir -p /etc/ssl/certs \
&& touch /etc/ssl/certs/ca-certificates.crt \
&& cat /usr/local/share/ca-certificates/cert.crt >> /etc/ssl/certs/ca-certificates.crt I also add RUN npm config set cafile /etc/ssl/certs/ca-certificates.crt to any Dockerfiles running |
Beta Was this translation helpful? Give feedback.
-
Hi @bradleyharden For URL's I would recommend to use on-premise Kubernetes (Microk8s) instead of docker compose. I'll write a guide for it and let you know when it's added.
|
Beta Was this translation helpful? Give feedback.
-
Hi @uniuuu, I still see the same behavior when using an IP address. To eliminate any possibility that the internal network or Dockerfile changes have any effect, I tried to reproduce the problem using the Here's what I did:
At this point, I found that the Then, I tried again:
At this point, I still see the same behavior. I get Am I doing something wrong here? |
Beta Was this translation helpful? Give feedback.
-
Except for the |
Beta Was this translation helpful? Give feedback.
-
Hi @bradleyharden @aitianshi
Another step you may miss is to switch to production branch as per guide.
|
Beta Was this translation helpful? Give feedback.
-
Either way, I will try using the |
Beta Was this translation helpful? Give feedback.
-
@bradleyharden If you can import some files from the outside to your internal network, you can try the solution there: #12. I had the same issue but I could build everything from a public network then import all images to my private network, suggested by @uniuuu . |
Beta Was this translation helpful? Give feedback.
-
@aitianshi, yes, I saw that suggestion in your issue. It could work for me, but it's also pretty easy for me to modify the Dockerfiles and rebuild. I would prefer that, if possible, so that I have a record and a way to reproduce things without manual intervention. |
Beta Was this translation helpful? Give feedback.
-
The pointed out issue that dev on your side doesn't work - is still okay as it's meant for development purpose and not production level deployment. That's understood that you want to build images. But the images you'll build won't guarantee their consistency unless at your side all is working, and no issues with getting dependencies. So you have to keep control over your build and ensure it wasn't impacted by your environment setup or limits. Anyway it's best practice to use prebuild and verified images. So i have made changes to production branch to avoid confusion by having dev docker-compose there. I am open to troubleshoot the image build failure. But for this you have provide details what do you modify in images exactly? And then also do provide output saved in file of the progress build of the images which has to be done by next command: Also I have added microk8s guide microk8s-installation and I encourage to switch from docker to k8s for better server handling experience. |
Beta Was this translation helpful? Give feedback.
-
@uniuuu, I won't be able to try anything until later today, but I wanted to clarify one thing now. In my last attempt, using the I will try with the pre-built images, but I think I've done that before and seen the same errors. I will try again to be certain. |
Beta Was this translation helpful? Give feedback.
-
Hi @bradleyharden @aitianshi |
Beta Was this translation helpful? Give feedback.
-
@uniuuu, sorry, I'm just very busy at the moment. I still want to figure this out. I will try to get back to you soon. Thanks for your help. |
Beta Was this translation helpful? Give feedback.
-
@uniuuu, I did as you asked and tried again using the pre-built containers. I just cloned a fresh copy, switched to the most recent To reiterate, I'm running on an Ubuntu 22.04 laptop connected to the open internet. I'm not behind an internal network. I'm also running in the Here is the output of
|
Beta Was this translation helpful? Give feedback.
-
I can also confirm that the suggestion by @aitianshi to change the |
Beta Was this translation helpful? Give feedback.
-
Thank you for the information provided. |
Beta Was this translation helpful? Give feedback.
-
@uniuuu, exposing port 9000 of the MinIO container is something I had tried on my own once before. That change removes the
I just confirmed that I still see this behavior. I updated my repo to |
Beta Was this translation helpful? Give feedback.
-
I will copy some lines from the logs that I think might be relevant:
|
Beta Was this translation helpful? Give feedback.
-
As a separate question, I noticed something else recently. The stream server repeatedly prints this line:
When the Zotero client was open, I used to see non-zero values for both connections and subscriptions. But lately, those values are always zero, whether the client is open or not. Is that the expected behavior? Is it relevant to this problem at all? |
Beta Was this translation helpful? Give feedback.
-
You may have changes with your IP and now the client cannot connect to the stream server. So try to rebuild client and ensure IP address set the same as VM's IP address. See below next my comment.
If you use VM you cannot use localhost setup. This is probably the root cause of the issue as it's confusing past in README.md.
If I got you right what you are trying to achieve is to add HTTPS (which will require SSL/TLS termination on all ports used).
Installing CA for each OS is not yet tested/supported. But I'll study this question what would be the best approach to add support for it.
When you do reinstall ZotPrime ensure the volumes all are deleted. A quintessential for this case would be that before you'll try to implement it your target production environment, first you need to try to setup in testing environment without doing any changes and do not use any restricted network or with policies that require to have TLS . And go with VM setup. Build client with setting IP address of VM (VM with bridged network). Attached is 3 min video showing steps deleting client's data, deleting server, creating a new server, initialization, connecting client. ZotPrime.mp4 |
Beta Was this translation helpful? Give feedback.
-
Hi @bradleyharden |
Beta Was this translation helpful? Give feedback.
-
Hi @bradleyharden |
Beta Was this translation helpful? Give feedback.
-
@uniuuu, sorry for the delay. I have a young baby, so I'm short on free time. It's a long weekend here in the US, so I have a little extra time now. First, I just want to emphasize that I really appreciate your work on Zotprime. And thank you for taking the time to help me figure out this issue. That being said, I'm a little frustrated. Although I am not a web developer, I do have some software development experience, and I would consider myself pretty technically proficient. I have read through the documentation several times. Many of the explanations and suggestions you have given me I already understand or have already tried. I keep trying to convince you of that, but you don't seem to believe me.
Yes, I understand what I am intentionally using the
Please don't remove the
I said this before, but I'll reiterate. I am no longer trying to build or modify your images. I am using the images pulled from DockerHub.
That sounds fine to me. But I will not try anything more advanced than the
Again, I'm no longer doing this and won't do this until I can get the simpler solution to work.
I thought I mentioned this, but maybe I didn't. Yes, I have been deleting all volumes every time I try a new configuration.
I was not aware of the
Yes, that's exactly what I've been trying to do with the
This is where I disagree. I don't really have another machine to test a VM configuration. If I wanted to do that, it would have to be on a company internal network, which would require some level of modification to the project. That's why I'm using the Let me ask a question of my own. Have you actually tried to reproduce this behavior exactly as described in the the documentation? Is there any chance that your development environment somehow gives different results? For example, maybe you're working from images that haven't yet been pushed to DockerHub? In the next post (which may not be immediate), I will try to provide an exact sequence of shell commands to reproduce the issue. Hopefully that will get both of us on the same page. |
Beta Was this translation helpful? Give feedback.
-
@uniuuu, here is a complete accounting of my actions. Please let me know if you see any problem with what I've done. As far as I can tell, I am completely clearing any state from previous attempts, and I am working from your unmodified code. # Show that there is no residual Zotero data
$ rm -r Zotero/ .zotero/
rm: remove 2 arguments recursively? y
rm: cannot remove 'Zotero/': No such file or directory
rm: cannot remove '.zotero/': No such file or directory
# Show that there is no residual Docker data
$ sudo docker image list
REPOSITORY TAG IMAGE ID CREATED SIZE
$ sudo docker container list -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
$ sudo docker volume list
DRIVER VOLUME NAME
$ sudo docker system prune
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
- all dangling images
- all dangling build cache
Are you sure you want to continue? [y/N] y
Total reclaimed space: 0B
# Freshly clone the repo
$ git clone --recursive https://github.com/uniuuu/zotprime.git
# ...
$ cd zotprime/
$ git switch production
M client/zotero-client
M stack/dataserver/dataserver
Branch 'production' set up to track remote branch 'production' from 'origin'.
Switched to a new branch 'production'
# We need to update the submodules after switching branches
$ git submodule update --recursive
warning: unable to rmdir 'pdf-reader': Directory not empty
Submodule path 'client/zotero-client': checked out '7e82cc5ffd82c695b1556b2ee25e86ddfbcb4e15'
Submodule path 'client/zotero-client/chrome/content/zotero/locale/csl': checked out 'a7c6f63e25323ac2f375943417d7f778f875f11c'
Submodule path 'client/zotero-client/chrome/content/zotero/xpcom/translate': checked out 'de2e270a37b9182c0b3017e54096b9b2d506926d'
Submodule path 'client/zotero-client/chrome/content/zotero/xpcom/translate/modules/utilities': checked out 'cccf1235a318c259345fc623d5e9d6770ba19df7'
Submodule path 'client/zotero-client/chrome/content/zotero/xpcom/translate/modules/utilities/resource/schema/global': checked out '1b12272d44134a652519e9192e5a936ac9fcd707'
Submodule path 'client/zotero-client/chrome/content/zotero/xpcom/utilities': checked out '9c89b23153ce621ed0f1d581a5e32248704c6fb7'
Submodule path 'client/zotero-client/note-editor': checked out 'e2e3009bbce0070488989c8678bb2da3e22d7514'
Submodule path 'client/zotero-client/pdf-worker': checked out 'a30d5cc8f5e0606e48433dfd02b4558881b667ab'
Submodule path 'client/zotero-client/pdf-worker/pdf.js': checked out '159a1d5612b803ca1d8b1f5d7498d5e84a58c284'
Submodule path 'client/zotero-client/pdf-worker/pdf.js/test/ttx/fonttools-code': checked out 'd8170131a3458ffbc19089cf33249777bde390e7'
Submodule path 'client/zotero-client/reader': checked out '79a1cd348d09e7f650e24074ff04bcc2fb8565a2'
Submodule path 'client/zotero-client/resource/SingleFile': checked out '0bca0227851348ef9bbaec780e88deb32b1cc03d'
Submodule path 'client/zotero-client/resource/schema/global': checked out '1f5331e902ed2b765a379b9586c65d1a192c151d'
Submodule path 'client/zotero-client/styles': checked out 'a791f0f2188a31dc9a025c6b8b404b06a1455165'
Submodule path 'client/zotero-client/translators': checked out 'f88a29b3f03136d3e42020b8579726dbf9b17652'
Submodule path 'stack/dataserver/dataserver': checked out '6a05549921cf18c9334439a2d0c9178bdae2c39d'
# Looks like that leaves behind some untracked files
$ git status
On branch production
Your branch is up to date with 'origin/production'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in submodules)
modified: client/zotero-client (untracked content)
no changes added to commit (use "git add" and/or "git commit -a")
# Let's delete them
$ rm -r client/zotero-client/pdf-reader/
rm: remove 1 argument recursively? y
# Now everything is clean
$ git status
On branch production
Your branch is up to date with 'origin/production'.
nothing to commit, working tree clean
# Check the Docker version, which is important for the next step
$ docker --version
Docker version 24.0.7, build afdd53b
# DOCKER_BUILDKIT=1 is not necessary for me
# From the Docker documentation: "If you are running a version of Docker Engine
# version earlier than 23.0, you can enable BuildKit either by setting an
# environment variable"
# The build_args aren't necessary either, since I am using the default values
# specified in client.Dockerfile
$ sudo docker build --progress=plain --file client.Dockerfile --output build .
# ...
# The files were built as root, so make them mine
$ sudo chown -R hardebj1:hardebj1 build
# Back to setting up the server
$ cp .env_example .env
# I like to see the logs, so I don't detach. Instead, I use tmux for another shell
$ sudo docker compose up
# After all images have been pulled and containers started, open a separate
# shell in tmux
$ ./bin/init.sh
# ...
# Start the client
$ ./build/Zotero_linux-x86_64/zotero At this point, I do things in the Zotero client GUI
Now to the browser
Finally, note that the Zotero client sync arrow never stopped spinning, even after the time I spent creating and editing this post. As a follow-up, I will show that the documents don't sync if I clear the data and try to pull from the server
|
Beta Was this translation helpful? Give feedback.
-
Hi @bradleyharden
Try next command |
Beta Was this translation helpful? Give feedback.
-
The issue:
Has been fixed in v2.8.3 |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm using the current
production
branch (2.7.0
), but I can't seem to get file syncing to work. I can sync entries in my library, but not files. In particular, I get a series of errors like this in the Zotero client:The client also never stops trying to sync. I can see repeated
POST
requests to theitems
path in thedataserver
logs, but when I open the MinIO browser, thezotero
andzotero-fulltext
buckets are completely empty.Interestingly, like @aitianshi, I also noticed that the
.env
fileS3HOST
points to10.5.5.1
instead of10.5.5.7
. However, I tried switching the IP to10.5.5.7
as well asminio
, but neither seems to affect the behavior.Finally, if I change the
S3HOST
tomy-vm-url:9000
and expose port 9000 of the MinIO container, I get a different behavior. With that setup, I do actually see files in the MinIO bucket. But I am only ever able to sync exactly two files: no more, no less. After that, thedataserver
starts issuing a series ofcurl error 7: couldn't connect to server
errors, and I get500
errors in the Zotero client.Am I doing something wrong? Should file syncing work? Or is it not supported yet?
Beta Was this translation helpful? Give feedback.
All reactions