uberfastman / fantasy-football-metrics-weekly-report

Command line application to create weekly reports (containing stats, metrics, and rankings) for Fantasy Football leagues on the following platforms: Yahoo, Fleaflicker, Sleeper, ESPN.
GNU General Public License v3.0
176 stars 43 forks source link

Unable to setup v17 of the app #205

Closed bdf0506 closed 7 months ago

bdf0506 commented 7 months ago

Description of Issue

I went ahead and tried the newly released version 17 of the app, but unable to complete setup.

Additional Information as Applicable

Fantasy Football Platform

ESPN

Operating System

Linux

Other

Logs:

root@unraid:/mnt/user/appdata/fantasy-football-metrics-weekly-report# docker exec -it fantasy-football-metrics-weekly-report-app-1 python main.py
Local ".env" file not found. Do you wish to create one? (y/n) -> y
For which fantasy football platform are you generating a report? (yahoo/espn/sleeper/fleaflicker/cbs) -> espn
What is your league ID? -> <redacted>
For which NFL season (starting year of season) are you generating reports? -> 2023
What is the current week of the NFL season? (week following the last complete week) -> 13
Traceback (most recent call last):
  File "/opt/ffmwr/main.py", line 16, in <module>
    from integrations.drive_integration import GoogleDriveUploader
  File "/opt/ffmwr/integrations/drive_integration.py", line 16, in <module>
    from utilities.settings import settings
  File "/opt/ffmwr/utilities/settings.py", line 472, in <module>
    settings = get_app_settings_from_env_file()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/ffmwr/utilities/settings.py", line 356, in get_app_settings_from_env_file
    return create_env_file_from_settings(env_fields, env_file_path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/ffmwr/utilities/settings.py", line 452, in create_env_file_from_settings
    with open(env_file_path, "w") as ef:
         ^^^^^^^^^^^^^^^^^^^^^^^^
IsADirectoryError: [Errno 21] Is a directory: '/opt/ffmwr/.env'

Appears that it creates a directory of .env rather than a file.

root@unraid:/mnt/user/appdata/fantasy-football-metrics-weekly-report# ls -a
./             .git/       LICENSE     calculate/          dao/           main.py               requirements.txt
../            .github/    README.md   compose.build.yaml  docker/        output/               resources/
.dockerignore  .gitignore  RELEASE.md  compose.dev.yaml    integrations/  report/               tests/
.env/          .venv       auth/       compose.yaml        logs/          requirements-dev.txt  utilities/
root@unraid:/mnt/user/appdata/fantasy-football-metrics-weekly-report/.env# ls -a
./  ../
tockreativ commented 7 months ago

Just tried to setup with a Sleeper league and am running into the same error.

uberfastman commented 7 months ago

@bdf0506 and @tockreativ my apologies, my latest change from using .ini files to .env files for the app configuration lead to an issue where when running the app in the docker container, if you didn't already have a .env file it would mount a directory into the container, so when the automated process ran to create a fresh .env file, it would fail because that empty directory called .env was mounted into the container. I updated the docker compose.yaml file in 1fcdb9a2eac08fa9f9325525356a6789bc5bda14 and pushed the changes out in v17.0.2, which should take care of this problem.

Let me know if there are any other issues!

tockreativ commented 7 months ago

Thank you for the quick response and fix!