Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

🐞 ERROR [2/2] RUN apt-get update && apt-get -y install git && #4

Closed
DevNadd opened this issue Apr 10, 2021 · 5 comments
Closed

🐞 ERROR [2/2] RUN apt-get update && apt-get -y install git && #4

DevNadd opened this issue Apr 10, 2021 · 5 comments
Labels
Bug - Fixed Issue has been resolved

Comments

@DevNadd
Copy link

DevNadd commented Apr 10, 2021

Hello
I had an error during installation, any hint please:

docker-compose pull
Pulling freqtrade ... done

docker-compose up --build
Building freqtrade
failed to get console mode for stdout: The handle is invalid.
[+] Building 1.0s (4/5)
=> [internal] load build definition from Dockerfile.technical 0.0s
[+] Building 1.1s (5/5) FINISHED
=> [internal] load build definition from Dockerfile.technical 0.0s
=> => transferring dockerfile: 42B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/freqtradeorg/freqtrade:develop 0.0s
=> [1/2] FROM docker.io/freqtradeorg/freqtrade:develop 0.1st && apt-get clean && pip install
=> ERROR [2/2] RUN apt-get update && apt-get -y install git && a 0.8s

[2/2] RUN apt-get update && apt-get -y install git && apt-get clean && pip install git+https://github.com/freqtrade/technical:
#5 0.224 Reading package lists...
#5 0.816 E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
#5 0.816 E: Unable to lock directory /var/lib/apt/lists/


ERROR: Service 'freqtrade' failed to build

@Rikj000
Copy link
Owner

Rikj000 commented Apr 10, 2021

Correct, I experienced this issue today too, I resolved it by doing the following 4 steps:

  • Download & the latest official Freqtrade docker folder & Dockerfile.'s that are within & replace the ones in MoniGoMani/docker/ with these.
  • Update your docker-compose.yml as following:
---
version: '3'
services:
  freqtrade:
    # image: freqtradeorg/freqtrade:stable
    image: freqtradeorg/freqtrade:develop
    # Use plotting image
    # image: freqtradeorg/freqtrade:develop_plot
    # Build step - only needed when additional dependencies are needed
    # build:
    #  context: .
    #  dockerfile: "./docker/Dockerfile.technical"
    restart: unless-stopped
    container_name: Freqtrade-MoniGoMani
    volumes:
      - "/etc/localtime:/etc/localtime:ro"
      - "./user_data:/freqtrade/user_data"
    # Expose api on port 8080 (localhost only)
    # Please read the https://www.freqtrade.io/en/latest/rest-api/ documentation
    # before enabling this.
    ports:
      - "127.0.0.1:8080:8080"
    # Default command used when running `docker compose up`
    command: >
      trade
      --logfile /freqtrade/user_data/logs/freqtrade.log
      --db-url sqlite:////freqtrade/user_data/tradesv3-MoniGoMani_v0.8.1.sqlite
      --config /freqtrade/user_data/config.json
      --config /freqtrade/user_data/config-private.json
      --strategy MoniGoManiHyperStrategy
  • Stop the container with docker-compose stop & delete your current Freqtrade-MoniGoMani container (find it with docker container ls -a, then delete it with docker container rm <Container ID>)
  • Do docker-compose pull & docker-compose --build --force-recreate

After that your problem should be resolved, these fixes will be included in v0.9.0 once it is complete.

@DevNadd
Copy link
Author

DevNadd commented Apr 10, 2021

hello Rikj000, thanks a lot, I did Above, error above has gone but I am receiving new one (log file not found), see the screen dump:
docker-compose up --build
Creating network "monigomaniv081_default" with the default driver
Creating Freqtrade-MoniGoMani ... done
Attaching to Freqtrade-MoniGoMani
Freqtrade-MoniGoMani | 2021-04-10 22:03:09,178 - freqtrade.worker - INFO - Starting worker docker-aaf9872e
Freqtrade-MoniGoMani | 2021-04-10 22:03:09,179 - freqtrade.configuration.configuration - INFO - Using config: /freqtrade/user_data/config.json ...
Freqtrade-MoniGoMani | 2021-04-10 22:03:09,183 - freqtrade.configuration.configuration - INFO - Using config: /freqtrade/user_data/config-private.json ...
Freqtrade-MoniGoMani | 2021-04-10 22:03:09,186 - freqtrade.commands.trade_commands - ERROR - [Errno 2] No such file or directory: '/freqtrade/user_data/logs/freqtrade.log'
Freqtrade-MoniGoMani | 2021-04-10 22:03:09,186 - freqtrade.commands.trade_commands - ERROR - Fatal exception!
Freqtrade-MoniGoMani | Traceback (most recent call last):
Freqtrade-MoniGoMani | File "/freqtrade/freqtrade/commands/trade_commands.py", line 18, in start_trading
Freqtrade-MoniGoMani | worker = Worker(args)
Freqtrade-MoniGoMani | File "/freqtrade/freqtrade/worker.py", line 35, in init
Freqtrade-MoniGoMani | self._init(False)
Freqtrade-MoniGoMani | File "/freqtrade/freqtrade/worker.py", line 49, in _init
Freqtrade-MoniGoMani | self._config = Configuration(self._args, None).get_config()
Freqtrade-MoniGoMani | File "/freqtrade/freqtrade/configuration/configuration.py", line 41, in get_config
Freqtrade-MoniGoMani | self.config = self.load_config()
Freqtrade-MoniGoMani | File "/freqtrade/freqtrade/configuration/configuration.py", line 99, in load_config
Freqtrade-MoniGoMani | self._process_logging_options(config)
Freqtrade-MoniGoMani | File "/freqtrade/freqtrade/configuration/configuration.py", line 131, in _process_logging_options
Freqtrade-MoniGoMani | setup_logging(config)
Freqtrade-MoniGoMani | File "/freqtrade/freqtrade/loggers.py", line 109, in setup_logging
Freqtrade-MoniGoMani | handler_rf = RotatingFileHandler(logfile,
Freqtrade-MoniGoMani | File "/usr/local/lib/python3.9/logging/handlers.py", line 153, in init
Freqtrade-MoniGoMani | BaseRotatingHandler.init(self, filename, mode, encoding=encoding,
Freqtrade-MoniGoMani | File "/usr/local/lib/python3.9/logging/handlers.py", line 58, in init
Freqtrade-MoniGoMani | logging.FileHandler.init(self, filename, mode=mode,
Freqtrade-MoniGoMani | File "/usr/local/lib/python3.9/logging/init.py", line 1146, in init
Freqtrade-MoniGoMani | StreamHandler.init(self, self._open())
Freqtrade-MoniGoMani | File "/usr/local/lib/python3.9/logging/init.py", line 1175, in _open
Freqtrade-MoniGoMani | return open(self.baseFilename, self.mode, encoding=self.encoding,
Freqtrade-MoniGoMani | FileNotFoundError: [Errno 2] No such file or directory: '/freqtrade/user_data/logs/freqtrade.log'
Freqtrade-MoniGoMani | 2021-04-10 22:03:12,111 - freqtrade.worker - INFO - Starting worker docker-aaf9872e
Freqtrade-MoniGoMani | 2021-04-10 22:03:12,111 - freqtrade.configuration.configuration - INFO - Using config: /freqtrade/user_data/config.json ...
Freqtrade-MoniGoMani | 2021-04-10 22:03:12,118 - freqtrade.configuration.configuration - INFO - Using config: /freqtrade/user_data/config-private.json ...
Freqtrade-MoniGoMani | 2021-04-10 22:03:12,120 - freqtrade.commands.trade_commands - ERROR - [Errno 2] No such file or directory: '/freqtrade/user_data/logs/freqtrade.log'
Freqtrade-MoniGoMani | 2021-04-10 22:03:12,121 - freqtrade.commands.trade_commands - ERROR - Fatal exception!
Freqtrade-MoniGoMani | Traceback (most recent call last):
Freqtrade-MoniGoMani | File "/freqtrade/freqtrade/commands/trade_commands.py", line 18, in start_trading
Freqtrade-MoniGoMani | worker = Worker(args)
Freqtrade-MoniGoMani | File "/freqtrade/freqtrade/worker.py", line 35, in init
Freqtrade-MoniGoMani | self._init(False)
Freqtrade-MoniGoMani | File "/freqtrade/freqtrade/worker.py", line 49, in _init
Freqtrade-MoniGoMani | self._config = Configuration(self._args, None).get_config()
Freqtrade-MoniGoMani | File "/freqtrade/freqtrade/configuration/configuration.py", line 41, in get_config
Freqtrade-MoniGoMani | self.config = self.load_config()
Freqtrade-MoniGoMani | File "/freqtrade/freqtrade/configuration/configuration.py", line 99, in load_config
Freqtrade-MoniGoMani | self._process_logging_options(config)
Freqtrade-MoniGoMani | File "/freqtrade/freqtrade/configuration/configuration.py", line 131, in _process_logging_options
Freqtrade-MoniGoMani | setup_logging(config)
Freqtrade-MoniGoMani | File "/freqtrade/freqtrade/loggers.py", line 109, in setup_logging
Freqtrade-MoniGoMani | handler_rf = RotatingFileHandler(logfile,
Freqtrade-MoniGoMani | File "/usr/local/lib/python3.9/logging/handlers.py", line 153, in init
Freqtrade-MoniGoMani | BaseRotatingHandler.init(self, filename, mode, encoding=encoding,
Freqtrade-MoniGoMani | File "/usr/local/lib/python3.9/logging/handlers.py", line 58, in init
Freqtrade-MoniGoMani | logging.FileHandler.init(self, filename, mode=mode,
Freqtrade-MoniGoMani | File "/usr/local/lib/python3.9/logging/init.py", line 1146, in init
Freqtrade-MoniGoMani | StreamHandler.init(self, self._open())
Freqtrade-MoniGoMani | File "/usr/local/lib/python3.9/logging/init.py", line 1175, in _open
Freqtrade-MoniGoMani | return open(self.baseFilename, self.mode, encoding=self.encoding,
Freqtrade-MoniGoMani | FileNotFoundError: [Errno 2] No such file or directory: '/freqtrade/user_data/logs/freqtrade.log'
Freqtrade-MoniGoMani exited with code 0

@DevNadd
Copy link
Author

DevNadd commented Apr 10, 2021

It is an access right issue ( I dont know how to elevate the privileges to be able to create the freqtrade/user_data/logs/freqtrade.log) so I changed the path of the logfile in docker-compose.yml to --logfile /tmp/freqtrade.log
And this solved the issue, the bit is up and running now.
PLease @Rikj000 if you know how to elevate the access right to allow to keep the log file in its place to share

with many thanks

@Rikj000
Copy link
Owner

Rikj000 commented Apr 11, 2021

Your 2nd issue should already have been resolved with this commit on the main branch of MoniGoMani & the fix will also be included in v0.9.0 when it comes out.
All that should be needed to resolve your 2nd issue is creating an empty MoniGoMani/user_data/logs/freqtrade.logfile.

@DevNadd
Copy link
Author

DevNadd commented Apr 11, 2021

Brilliant, thanks Rikj000

@DevNadd DevNadd closed this as completed Apr 11, 2021
@Rikj000 Rikj000 added the Bug - Fixed Issue has been resolved label Jun 1, 2021
@Rikj000 Rikj000 changed the title ERROR [2/2] RUN apt-get update && apt-get -y install git && 🐞 ERROR [2/2] RUN apt-get update && apt-get -y install git && Sep 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug - Fixed Issue has been resolved
Projects
None yet
Development

No branches or pull requests

2 participants