Giter Site home page Giter Site logo

Port 7878 closed(???) [Fixed] about flexo HOT 11 CLOSED

nroi avatar nroi commented on June 19, 2024
Port 7878 closed(???) [Fixed]

from flexo.

Comments (11)

nroi avatar nroi commented on June 19, 2024

I guess you're just a bit impatient: Flexo performs latency test at the first start, so it does not immediately listen on the port. Could you try after maybe 3 minutes or so? You should then see messages like the following in the log:

Dec 05 17:51:04 archWS flexo[21332]: [2020-12-05T16:51:04.531Z INFO  flexo] Primary mirror: "https://archlinux.mailtunnel.eu/"
Dec 05 17:51:04 archWS flexo[21332]: [2020-12-05T16:51:04.610Z INFO  flexo::mirror_flexo] Retrieved 5085 files with a total size of 18.08 GiB from local file system.

The next start of Flexo should be speedier, because after the first latency test, only a select few mirrors are tested because Flexo only considers mirrors from those locations that were fast during the first latency test.

I guess I could somehow improve this from a usability perspective. Even if it "works as intended", it's understandable that users are puzzled if nothing happens after the first startup for a minute or so.

from flexo.

nroi avatar nroi commented on June 19, 2024

Or maybe there's something else going on… Could you please post the output of:

pacman -Qi flexo-git

from flexo.

cmsigler avatar cmsigler commented on June 19, 2024

Hi,

Me, impatient? ... How did you know? ;D OK, first --

$ pacman -Qi flexo-git
Name : flexo-git
Version : 1.0.7.r2.g2a2df95-1
Description : A central pacman cache
Architecture : x86_64
URL : https://github.com/nroi/flexo
Licenses : MIT
Groups : None
Provides : flexo
Depends On : curl
Optional Deps : None
Required By : None
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 2.25 MiB
Packager : Unknown Packager
Build Date : Sat 05 Dec 2020 09:41:00 AM EST
Install Date : Sat 05 Dec 2020 09:42:44 AM EST
Install Reason : Explicitly installed
Install Script : Yes
Validated By : None

Well, now I see there's a problem. The process seems to die then auto-restart (I'm not an expert on systemd) --

$ systemctl status -n 50 flexo | cat
● flexo.service - central pacman cache
Loaded: loaded (/usr/lib/systemd/system/flexo.service; disabled; vendor preset: disabled)
Active: activating (auto-restart) (Result: exit-code) since Sat 2020-12-05 12:14:15 EST; 404ms ago
Process: 71971 ExecStart=/usr/bin/flexo (code=exited, status=1/FAILURE)
Main PID: 71971 (code=exited, status=1/FAILURE)

This seems to happen over and over again. After I stop flexo I see this --

Dec 05 12:15:51 vagente595 systemd[1]: Started central pacman cache.
Dec 05 12:15:51 vagente595 flexo[72177]: [2020-12-05T17:15:51.928Z INFO flexo] Will switch mirror if download speed falls below 1.20 MiB/s
Dec 05 12:15:56 vagente595 flexo[72177]: [2020-12-05T17:15:56.066Z ERROR flexo] Unable to find remote mirrors that match the selected criteria.
Dec 05 12:15:56 vagente595 systemd[1]: flexo.service: Main process exited, code=exited, status=1/FAILURE
Dec 05 12:15:56 vagente595 systemd[1]: flexo.service: Failed with result 'exit-code'.
Dec 05 12:15:59 vagente595 systemd[1]: flexo.service: Scheduled restart job, restart counter is at 79.
Dec 05 12:15:59 vagente595 systemd[1]: Stopped central pacman cache.
Dec 05 12:15:59 vagente595 systemd[1]: Started central pacman cache.
Dec 05 12:15:59 vagente595 flexo[72195]: [2020-12-05T17:15:59.178Z INFO flexo] Will switch mirror if download speed falls below 1.20 MiB/s
Dec 05 12:16:03 vagente595 flexo[72195]: [2020-12-05T17:16:03.914Z ERROR flexo] Unable to find remote mirrors that match the selected criteria.
Dec 05 12:16:03 vagente595 systemd[1]: flexo.service: Main process exited, code=exited, status=1/FAILURE
Dec 05 12:16:03 vagente595 systemd[1]: flexo.service: Failed with result 'exit-code'.
Dec 05 12:16:07 vagente595 systemd[1]: flexo.service: Scheduled restart job, restart counter is at 80.
Dec 05 12:16:07 vagente595 systemd[1]: Stopped central pacman cache.

80 restarts :\ I did nothing but use yay to build and install flexo-git, then add low_speed_limit to flexo.toml. I didn't screw around with any file permissions under /var/cache/flexo, or anything else like that :(

I have even tried logging out and back in again in case it had to do with /etc/passwd, /etc/group.

I would be very happy to help debug, please let me know how I can help :) And thank you for everything!

Clemmitt

from flexo.

nroi avatar nroi commented on June 19, 2024

Could you first upgrade Flexo and try again? I pushed a new version just a few minutes before you have opened this issue. pacman -Qi flexo-git should show the following:

Version         : 1.0.8.r0.g9a02658-1

from flexo.

cmsigler avatar cmsigler commented on June 19, 2024

Hi,

OK, with the new version flexo is no longer loop crashing. Here's systemctl status --

$ systemctl status -n 50 flexo | cat
● flexo.service - central pacman cache
Loaded: loaded (/usr/lib/systemd/system/flexo.service; disabled; vendor preset: disabled)
Active: active (running) since Sat 2020-12-05 12:31:33 EST; 3min 37s ago
Main PID: 83760 (flexo)
Tasks: 1 (limit: 35952)
Memory: 2.3M
CGroup: /system.slice/flexo.service
└─83760 /usr/bin/flexo

Dec 05 12:31:33 vagente595 systemd[1]: Started central pacman cache.
Dec 05 12:31:35 vagente595 flexo[83760]: [2020-12-05T17:31:35.504Z INFO flexo] No cached latency test results available. Continue to run latency tests on all mirrors.
Dec 05 12:32:06 vagente595 flexo[83760]: [2020-12-05T17:32:06.005Z INFO flexo] Primary mirror: "https://mirror.osbeck.com/archlinux/"
Dec 05 12:32:06 vagente595 flexo[83760]: [2020-12-05T17:32:06.006Z INFO flexo::mirror_flexo] Retrieved 0 files with a total size of 0.00 B from local file system.

TCP port 7878 is open now. But "0 files from local file system" seems strange because my local /var/cache/pacman/pkg/ is 16 GiB in size.

I can now run pacman with the flexo proxy cache.... I've got a /var/cache/flexo/state/latency_test_results.json file, but it didn't seem to proxy cache anything although 4 pkgs were upgraded --

$ find /var/cache/flexo/ ! -type d -print | sort
/var/cache/flexo/state/latency_test_results.json

I'm afraid I'm being stupid again. My first Server line in mirrorlist is --

Server = http://localhost:7878/$repo/os/$arch

Please let me know if PEBKAC :\

Clemmitt

Edit: Removed unneeded word

from flexo.

cmsigler avatar cmsigler commented on June 19, 2024

Hi again nroi,

Perhaps this issue should be closed as fixed since the TCP port issue is solved. I will flag for closing with this comment.

I will open a new issue if flexo isn't proxy caching. Again, thank you for your timely support :)

Clemmitt

from flexo.

nroi avatar nroi commented on June 19, 2024

It looks like you previously ran into this bug: #23
I'm glad this works now.

I think you're mixing up two different directories: Pacman uses the CacheDir configured in /etc/pacman.conf. All files that are downloaded by pacman are stored in this directory. If a file already exists in this directory, pacman isn't going to download it again. Flexo on the other hand uses the cache_directory configured in /etc/flexo/flexo.toml. It doesn't care about pacman's CacheDir.

So the message Retrieved 0 files with a total size of 0.00 B from local file system. initially appears because no files are present in Flexo's cache_directory, which is different from /var/cache/pacman/pkg.

You can try the following:

  1. Follow the log with journalctl -f --unit=flexo
  2. Download a package that you haven't downloaded before, e.g. pacman -S --downloadonly cowsay. If this works as intended, you should now see something like Attempt to create file: "/var/cache/flexo/pkg/extra/os/x86_64/cowsay-3.04-2-any.pkg.tar.zst" in your log. This means that Flexo has downloaded the file from a remote mirror.
  3. Remove the file from you pacman's CacheDir (not the flexo cache directory). By default, this is /var/cache/pacman/pkg/. This way, pacman has no way to facilitate its own cache, so it has to make an HTTP request to download the package.
  4. Download the same file again with pacman -S --downloadonly cowsay. If this also works as intended, then you should see something like the following in your log: Request served: "extra/os/x86_64/cowsay-3.04-2-any.pkg.tar.zst", but you shouldn't see the message Attempt to create file: […] appear a second time in the log, because it has already been created. This means Flexo has served the file from its cache.

from flexo.

cmsigler avatar cmsigler commented on June 19, 2024

Hi one last time,

Just to follow up, flexo is now working for me as intended :) Yes, after I posted that reply I wondered if that message was referencing files under /var/cache/flexo/pkg. So, once I did things correctly the newly installed ffmpeg pkg is cached as /var/cache/flexo/pkg/extra/os/x86_64/ffmpeg-2:4.3.1-3-x86_64.pkg.tar.zst

Downloading that pkg was very slow :( Perhaps I need to edit flexo.toml to set 'mirror_selection_method = "predefined"' and populate the 'mirrors_predefined = []' list(?). I'm spoiled because I use yay with powerpill on my boxes and have an excellent mirrorlist produced via rankmirrors.

Thank you again for your nearly instantaneous support :)

Clemmitt

from flexo.

nroi avatar nroi commented on June 19, 2024

Downloading that pkg was very slow :(

Have you tried increasing the low_speed_limit setting?

Perhaps I need to edit flexo.toml to set 'mirror_selection_method = "predefined"' and populate the 'mirrors_predefined = []' list(?).

This could also solve your problem, but this would be more of a workaround than a fix. You would have to manually edit this list when a mirror is put offline. The low_speed_limit is used to handle the case when you got unlucky and have selected a slow mirror, so maybe try that first.

from flexo.

cmsigler avatar cmsigler commented on June 19, 2024

Hi again,

The low_speed_limit is used to handle the case when you got unlucky and have selected a slow mirror, so maybe try that first.

Aha! OK, that makes sense. I will go forth and do :) Again, many thanks!

Clemmitt

from flexo.

nroi avatar nroi commented on June 19, 2024

If the downloads are still slow even with low_speed_limit set to an appropriate value, then I consider this a bug, so feel free to open a new issue in case that happens.

from flexo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.