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

Zypper Outgoing/Local Port Number #364

Closed
radumamy opened this issue Dec 11, 2020 · 16 comments
Closed

Zypper Outgoing/Local Port Number #364

radumamy opened this issue Dec 11, 2020 · 16 comments

Comments

@radumamy
Copy link

Good Afternoon,

Could you please advise if Zypper can use an user defined outgoing/local port number as opposed to default 80/443?

For example when using curl, I can specify a specific local port to connect to a remote host on port 80/443.

Thank you.

`localhost:~ # curl -v --local-port 40443 https://google.co.uk

  • Trying 216.58.204.227:443... * Local port: 40443
  • Connected to google.co.uk (216.58.204.227) port 443 (#0)`
@mlandres
Copy link
Member

Sorry @radumamy, there's no support for specifying the local port.

@radumamy
Copy link
Author

Thank you @mlandres. Could this be added as a feature in the future? Or is simply not possible?

@mlandres
Copy link
Member

It depends on the backend and on what you want to achieve. The default 'multicurl' backend e.g. supports metalink. If you connect to download.opensuse.org to retrieve a repo, the server sends back a list or mirrors and the backend will use multiple connections to download different parts of the file from different mirrors in parallel. Local port could affect the initial connection, but not the parallel downloads from the mirrors.

The old plain curl backend would use just a single connection per file, so defining a local port would indeed affect the whole file download.

But in both cases it would fail if we try to download 2 files from the same repo in parallel. Actually we want to do even more in parallel, so we're reluctant to introduce something that would enforce us to serialize the request.

@radumamy
Copy link
Author

@mlandres I don't know how things work in the background.

I'm using Proot to chroot openSUSE into another existing environment. I have installed Plex inside openSUSE and it works fine, but I cannot get zypper to update. It appears that protected ports are an issue.

I've thought if I can define the local port number in zypper or a range of high ports I could get it working.

Would parallel downloads work if zypper would bind to a range of ports? Like if we could specify use ports above 30000?

Thanks.

@mlandres
Copy link
Member

Can't you update the chroot from the outside usingzypper --root...?

I don't think we would implement such a kind of port management inside libzypps media backend. But if you like, you can mail me the /var/log/zypper.log after a failed attempt to update (best running ZYPP_MEDIA_CURL_DEBUG=2 zypper ...). Maybe the log reveals a simpler solution.

@mlandres
Copy link
Member

mlandres commented Jan 4, 2021

Closing it.

@mlandres mlandres closed this as completed Jan 4, 2021
@radumamy
Copy link
Author

radumamy commented Jan 21, 2021

zypper.log
Good Afternoon @mlandres, I'm so sorry I couldn't get this to you a lot quicker. I've tried a zypper ref and it just hangs. Please let me know if you require anything else. Thank you.

@mlandres
Copy link
Member

@radumamy could you please run it as 'ZYPP_MEDIA_CURL_DEBUG=2 zypper ref'? So I can see more of libcurls actions.

From the log so far I'd say it hangs when disconnecting, which would is pretty strange. If zypper hangs, please wait a few minutes before aborting it.

@radumamy
Copy link
Author

radumamy commented Jan 22, 2021

zypper.log
Thank you @mlandres , please see attached. I've run the command and sent the job in the background for 20+ minutes, unfortunately same result. :(

@mlandres
Copy link
Member

@radumamy would you do me one more favor? Please make sure you have strace installed and run strace -s 128 -o /tmp/zypper.strace.log zypper ref. (gzip /tmp/zypper.strace.log if it is too big). Thank you.

@radumamy
Copy link
Author

zypper.strace.log.zip
Thanks @mlandres . Please see attached.

@mlandres
Copy link
Member

Still stumbling in the dark. It's obviously stuck in an endless loop and I suspect in libcurls curl_easy_cleanup. Maybe we can get a stacktrace out of libzypp:

  • run zypper ref until it hangs
  • get zyppers PID (e.g.cat /run/zypp.pid)
  • Call kill -11 PID
  • Check the end of the zypper.log. If we're lucky the sigsegvHandler wrote the stacktrace to the log:
[zypp] ZYppFactory.cc(sigsegvHandler):54 Error: signal 11
[zypp] ZYppFactory.cc(sigsegvHandler):54 [hd]: (-3) /usr/local/lib64/libzypp.so.1722 : zypp::dumpBacktrace...
....more lines from ZYppFactory.cc(sigsegvHandler)...

If it did, please send the log (the stacktrace and 10 loglines preceding it will do).

Thanks.

@radumamy
Copy link
Author

Good Afternoon @mlandres .
Please see attached. I hope this helps. Thank you.
zypper.log

@mlandres
Copy link
Member

@radumamy the stacktrace confirms that it hangs in libcurl in a __poll below curl_easy_cleanup. Before I'm going to file a bugreport for libcurl, please try: ZYPP_MULTICURL=0 zypper ref
This will fall back to the older plain libcurl backend. It may very well be that it shows the same issue, but we should at least try it out.

Please run zypper se -si curl and send the exact curl/liburl versions you're using.

@radumamy
Copy link
Author

radumamy commented Jan 27, 2021

zypper.log
zypper2.log
@mlandres , please see attached. First log shows ZYPP_MULTICURL=0 zypper ref and when I tried to run zypper se -si curl, zypper hanged again - this is showing in the 2nd log. Thank you very much.

@mlandres
Copy link
Member

@radumamy I created a bugreport for libcurl at bugzilla.suse.com.
Maybe you want to joint it.

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

No branches or pull requests

2 participants