Giter VIP home page Giter VIP logo

Comments (22)

Guiorgy avatar Guiorgy commented on May 19, 2024 16

I don't understand what the fix is here. I have a default filebrowser installation and keeps giving me this healtcheck error too:

curl: (3) URL rejected: Bad hostname

  1. Execute an interactive shell inside the container
    docker exec -it -u root [CONTAINER_NAME] ash
  2. Install nano (or another editor of your choice):
    apk add --no-cache nano
  3. Edit healthcheck.sh:
    nano healthcheck.sh
  4. Add the -r or --raw-output flag to the jq command:
    Change ADDRESS=${FB_ADDRESS:-$(jq .address /.filebrowser.json)} to ADDRESS=${FB_ADDRESS:-$(jq -r .address /.filebrowser.json)}

from filebrowser.

Guiorgy avatar Guiorgy commented on May 19, 2024 7

@mapxn and future readers, the problem has been identidied and fixed (see #3087), no need to spam report. Either wait for the next release, or use one of the optiones above to temporarily fix it yourself.

from filebrowser.

Zulux91 avatar Zulux91 commented on May 19, 2024 5

Guess this wont work for me, as it repulls the image in portainer when i change my compose to run as root (otherwise i cant edit healtcheck). I need a new docker image build :-(

I fixed mine by doing a cat to the healthcheck (docker exec -it filebrowser cat healthcheck.sh) to get its content. Made a copy outside of the container since you have the /srv mounted to some place inside the machine, keeping the same name. Edited the script to add the -r flag and copied back the edited file, replacing the old one.

Here's a one line command as a temp fix:

docker exec -it [CONTAINER_NAME] sed -i 's/\(jq .address \/.filebrowser\.json\)/\1 -r/' healthcheck.sh

from filebrowser.

jinks avatar jinks commented on May 19, 2024 4

If fixing a typo that makes the default docker image unusable takes more than two weeks, that doesn't really instill confidence in the project.

from filebrowser.

Guiorgy avatar Guiorgy commented on May 19, 2024 3

FYI, the fix has been merged (#3130), so just wait for the next release 😁

from filebrowser.

Guiorgy avatar Guiorgy commented on May 19, 2024 2

@jinks If you think you can do better, why don't you fork this project and maintain it better instead. Don't forget that this project is maintained by unpaid volunteers with their own lives, and no obligations to any of us.

from filebrowser.

Guiorgy avatar Guiorgy commented on May 19, 2024 1

@Tuumke You don't have to run the container as root. If you are using Portainer, you can execute a shell from the webui (select /bin/ash), and there you can specify the user, type root inside:

image
image

PS. Fixed my comment above

from filebrowser.

CorySanin avatar CorySanin commented on May 19, 2024 1

Needs to get merged first.

from filebrowser.

smgsmagus avatar smgsmagus commented on May 19, 2024

same here:
fileb

from filebrowser.

CorySanin avatar CorySanin commented on May 19, 2024

Ah, you're correct. The double quotes are introduced by executing jq without the -r (--raw-output) flag. I didn't realize there was already logic in healthcheck.sh intended to fallback to "localhost".

Not sure why yours wasn't falling back to localhost though. Adding the -r flag is all I needed.

from filebrowser.

Zulux91 avatar Zulux91 commented on May 19, 2024

Ah, you're correct. The double quotes are introduced by executing jq without the -r (--raw-output) flag. I didn't realize there was already logic in healthcheck.sh intended to fallback to "localhost".

Not sure why yours wasn't falling back to localhost though. Adding the -r flag is all I needed.

Oh yes, you're right. Only -r is needed. Just tested on a fresh container and it works fine.

from filebrowser.

Tuumke avatar Tuumke commented on May 19, 2024

I don't understand what the fix is here. I have a default filebrowser installation and keeps giving me this healtcheck error too:

curl: (3) URL rejected: Bad hostname

from filebrowser.

Zulux91 avatar Zulux91 commented on May 19, 2024

I don't understand what the fix is here. I have a default filebrowser installation and keeps giving me this healtcheck error too:

curl: (3) URL rejected: Bad hostname

Were you able to inspect the pull request? That might make it clear. There's a healthcheck.sh script inside the container that needs to be changed to incorporate the mentioned -r parameter.

from filebrowser.

Tuumke avatar Tuumke commented on May 19, 2024

I don't understand what the fix is here. I have a default filebrowser installation and keeps giving me this healtcheck error too:
curl: (3) URL rejected: Bad hostname

1. Execute an interactive shell inside the container
   ```shell
   docker exec -it [CONTAINER_NAME] ash
   ```

2. Install nano (or another editor of your choice):
   ```shell
   apk add --no-cache nano
   ```

3. Edit `healthcheck.sh`:
   ```shell
   nano healthcheck.sh
   ```

4. Add the `-r` or `--raw-output` flag to the jq command:
   Change `ADDRESS=${FB_ADDRESS:-$(jq .address /.filebrowser.json)}` to `ADDRESS=${FB_ADDRESS:-$(jq -r .address /.filebrowser.json)}`

Guess this wont work for me, as it repulls the image in portainer when i change my compose to run as root (otherwise i cant edit healtcheck). I need a new docker image build :-(

from filebrowser.

mapxn avatar mapxn commented on May 19, 2024

Have the same issue.

image

from filebrowser.

seppeel avatar seppeel commented on May 19, 2024

Guess this wont work for me, as it repulls the image in portainer when i change my compose to run as root (otherwise i cant edit healtcheck). I need a new docker image build :-(

I fixed mine by doing a cat to the healthcheck (docker exec -it filebrowser cat healthcheck.sh) to get its content. Made a copy outside of the container since you have the /srv mounted to some place inside the machine, keeping the same name. Edited the script to add the -r flag and copied back the edited file, replacing the old one.

Here's a one line command as a temp fix:

docker exec -it [CONTAINER_NAME] sed -i 's/\(jq .address \/.filebrowser\.json\)/\1 -r/' healthcheck.sh

Thanks for your workaround!

If your container does not run as root, just add "-u root".

docker exec -it -u root [CONTAINER_NAME] sed -i 's/\(jq .address \/.filebrowser\.json\)/\1 -r/' healthcheck.sh

from filebrowser.

lustrant avatar lustrant commented on May 19, 2024

healthechk.sh shoudl be changed to:

#!/bin/sh PORT=${FB_PORT:-$(jq -r .port /.filebrowser.json)} ADDRESS=${FB_ADDRESS:-$(jq -r .address /.filebrowser.json)} ADDRESS=${ADDRESS:-localhost} curl -f http://$ADDRESS:$PORT/health || exit 1

-r needs to be added in order to give just the strings and not "strings", i.e. the address is
http://filebrowser:431/health
and not
http://"filebrowser":431/health

from filebrowser.

Guiorgy avatar Guiorgy commented on May 19, 2024

@lustrant Already has been (see #3087)

from filebrowser.

Tuumke avatar Tuumke commented on May 19, 2024

But when can we see this fixed in the docker image? :O
Been a while now, surely this is pushed easy into a new image?

from filebrowser.

jinks avatar jinks commented on May 19, 2024

@Guiorgy Because I don't care enough to maintain a project long-term.

The question remains, why pushing a 2-letter fix to Docker Hub remains such a chore. It's not even part of the core code. Unless there is something seriously wrong with the release process, I would imagine pushing the fix to Docker should be less work than this thread has already consumed.

from filebrowser.

Guiorgy avatar Guiorgy commented on May 19, 2024

@jinks As I said, they have their lives, maybe they have something more urgent going on. And it's not like the container is completely broken, or hard to manually workaround.

from filebrowser.

ying001ch avatar ying001ch commented on May 19, 2024

I'm running into this issue as well, and my workaround is to add an environment variable FB_ADDRESS: 0.0.0.0 so that the command jq .address /.filebrowser.json doesn't work

from filebrowser.

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.