Giter Site home page Giter Site logo

Comments (18)

ryleu avatar ryleu commented on May 14, 2024 1

I'll give it a try once I get home.

from distrobox.

ryleu avatar ryleu commented on May 14, 2024 1

That's a good idea, give me a sec.

from distrobox.

ryleu avatar ryleu commented on May 14, 2024

It could be that Fedora has some weird env vars that Ubuntu doesn't support?

from distrobox.

ryleu avatar ryleu commented on May 14, 2024

dbresult.txt

Okay, here's the verbose output. The formatting is a bit weird, but it has all of the info. One issue I can see right off the bat is that it's also moving env vars like these:

++ echo '--env="SSH_CONNECTION=10.25.25.52"'
++ echo '--env="SSH_CLIENT=10.25.25.52"'
++ echo '--env="SSH_TTY=/dev/pts/0"'

Maybe some sort of env var whitelist would make sense? This could be an unrelated issue though.

from distrobox.

ryleu avatar ryleu commented on May 14, 2024

It seems like it's detecting an env var named declare -f. I ran echo $declare\ -f and got nothing. I would recommend running cat dbresult.txt | grep 'declare -f to highlight where it shows up.

from distrobox.

89luca89 avatar 89luca89 commented on May 14, 2024

Mhh i see in the logs it picked up these envs

++ for i in $(printenv)
++ echo '--env="SSH_CONNECTION=10.25.25.52"'
++ for i in $(printenv)
++ echo '--env="56492"'
++ for i in $(printenv)
++ echo '--env="10.25.25.76"'
++ for i in $(printenv)
++ echo '--env="22"'
++ for i in $(printenv)

Which are invallid (not in NAME=VALUE format)

EDIT:

in particular I've found that it is this part it's giving errors

'--env="${which_declare}"'

which probably is set to declare -f for whatever reason, let's see if the new patch fixes this

I'll check a better solution to pass the entire env to the container

from distrobox.

89luca89 avatar 89luca89 commented on May 14, 2024

@ryleu I've worked a version that does not try to parse the env but just uses a temp file and the --env-file flag instead of multiple single --env flags

it is in the fix_env_passing branch and it's this file:

https://raw.githubusercontent.com/89luca89/distrobox/fix_env_passing/distrobox-enter

Can you try with this file? If it does work I'll open a new PR to address this issue

from distrobox.

89luca89 avatar 89luca89 commented on May 14, 2024

@ryleu seems to be a regression I've introduced in commit: enter: simplify env passing

I've reverted the commit and added an additional filter to remove lines containing spaces (which are the problem for env)

I've tested again on fedora 35 and it was giving me the same error, with this version is working as intended.
Culprit was this env variable which is oddly formatted:

BASH_FUNC_which%%=() {  ( alias;
 eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot "$@"
}

from distrobox.

ryleu avatar ryleu commented on May 14, 2024

Now it seems to be unable to connect to networking. Everything is working perfectly on the host system...

ryleu@riley-fedora ~> podman logs -f ubuntu-20-04
+ HOST_LINKS=/etc/host.conf /etc/hosts /etc/resolv.conf /etc/localtime /etc/timezone
+ rm -f /etc/host.conf
+ ln -s /run/host/etc/host.conf /etc/host.conf
+ rm -f /etc/hosts
+ ln -s /run/host/etc/hosts /etc/hosts
+ rm -f /etc/resolv.conf
+ ln -s /run/host/etc/resolv.conf /etc/resolv.conf
+ rm -f /etc/localtime
+ ln -s /run/host/etc/localtime /etc/localtime
+ rm -f /etc/timezone
+ ln -s /run/host/etc/timezone /etc/timezone
+ basename /bin/bash
+ shell_pkg=bash
+ command -v mount
/usr/bin/mount
+ command -v passwd
/usr/bin/passwd
+ command -v sudo
+ command -v apk
+ command -v apt-get
/usr/bin/apt-get
+ apt-get update
Err:1 http://security.ubuntu.com/ubuntu focal-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Err:2 http://archive.ubuntu.com/ubuntu focal InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Reading package lists...
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
+ apt-get install -y --no-install-recommends sudo apt-utils passwd procps util-linux bash
Reading package lists...
Building dependency tree...
Reading state information...
Package apt-utils is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  apt

E: Unable to locate package sudo
E: Package 'apt-utils' has no installation candidate
+ [ 100 -ne 0 ]
An error occurred
+ echo An error occurred

from distrobox.

ryleu avatar ryleu commented on May 14, 2024

Oh yeah, it also uses apt-utils instead of apt for whatever reason.

Unrelated: do you have a Discord or something to make communication faster?

from distrobox.

ryleu avatar ryleu commented on May 14, 2024

image
πŸ€”

from distrobox.

89luca89 avatar 89luca89 commented on May 14, 2024

image thinking

Yea probably I need a better "loading" screen πŸ˜„

Oh yeah, it also uses apt-utils instead of apt for whatever reason.

Unrelated: do you have a Discord or something to make communication faster?

No I don't have one yet
apt-utils is being installed, not used

Err:1 http://security.ubuntu.com/ubuntu focal-security InRelease
Temporary failure resolving 'security.ubuntu.com'
Err:2 http://archive.ubuntu.com/ubuntu focal InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Temporary failure resolving 'archive.ubuntu.com'
Reading package lists...
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease Temporary failure resolving 'security.ubuntu.com'

This seems a dns resolution failure, I've just tested on Fedora 35 host and ubuntu 20.04 container and it works
Probably you need to recreate the container (podman rm -f ubuntu-20-04) or simply stop it and restart it (podman kill -s 9 ubuntu-20-04 and then redo distrobox-enter)

from distrobox.

ryleu avatar ryleu commented on May 14, 2024

Okay, I'll see if I set up SSH on my phone properly and give it a shot.

from distrobox.

ryleu avatar ryleu commented on May 14, 2024

Same issue... I'm going to try 21.10.

from distrobox.

89luca89 avatar 89luca89 commented on May 14, 2024

If it's still the DNS problem let's open a separate issue for it so it's more clear it's another problem ok?

from distrobox.

89luca89 avatar 89luca89 commented on May 14, 2024

Marking the env one as solved

from distrobox.

ryleu avatar ryleu commented on May 14, 2024

Sounds good, I'll let you know if the issue comes back once we get the DNS thing sorted.

from distrobox.

89luca89 avatar 89luca89 commented on May 14, 2024

This one should be ok, if the podman command launches at all it means the env issue is resolved πŸ˜„

from distrobox.

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.