devfake / flox

Self Hosted Movie, Series and Anime Watch List
https://flox-demo.pyxl.dev/
MIT License
1.29k stars 190 forks source link

No Username or Password #195

Open cupanoodles opened 1 year ago

cupanoodles commented 1 year ago

Fresh install in docker container (olofvndrhr/flox-dockerized), there is no username and password for login page. Added environment variables for user and password and admin password, modified .env file, created docker-compose.yml. Nothing is working. Checked db with sqlite and see users database contains no data. What do I do?

AuthorShin commented 1 year ago

You wanna have specific username and password set or default admin/admin will do you good? If the default is okay you don't need to add any environment variables for that, just after deploying the container login with admin/admin.

cupanoodles commented 1 year ago

You wanna have specific username and password set or default admin/admin will do you good? If the default is okay you don't need to add any environment variables for that, just after deploying the container login with admin/admin.

I would like the login to work in any way possible.

After a fresh install with only the base environment variables of flox_db_init and tmdb_api_key, it will not allow me to log in using admin/admin. This is why I went down a long troubleshooting journey to figure out why I am not able to log in and began experimenting with username environment variables and inspecting the users database. I just want the damn thing to work. lol

Any guidance will be greatly appreciated. I am clueless as what to do next.

AuthorShin commented 1 year ago

What about container logs, can you share them here?

cupanoodles commented 1 year ago

What about container logs, can you share them here?

Here you go: https://pastebin.com/Bky4yPd2

Thank you for helping me. 🙏

AuthorShin commented 1 year ago

It's weird cause now I installed the Flox on a new VPS and got the same problem as you, logs are the same but not with the working one so I'm assuming it's got something to do with docker and it's recent updates. I will look into the change-logs of docker to see if there's something related to this.

Working Flox logs:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-set-timezone: executing... 
WARNING:  is not a valid time zone.
[cont-init.d] 10-set-timezone: exited 0.
[cont-init.d] 11-fix-attrs: executing... 
Fixing permissions in /etc/cont-init.d
Fixing permissions in /etc/services.d
Fixing permissions in /etc/cron.d
[cont-init.d] 11-fix-attrs: exited 0.
[cont-init.d] 12-setuid: executing... 
usermod: no changes

-------------------------------------------------
       __     __    _                        _____
  ____/ /__  / /_  (_)___ _____        _____/ ___/
 / __  / _ \/ __ \/ / __ `/ __ \______/ ___/ __ \
/ /_/ /  __/ /_/ / / /_/ / / / /_____(__  ) /_/ /
\__,_/\___/_.___/_/\__,_/_/ /_/     /____/\____/

Source: git.44net.ch/44net-assets/docker-baseimages-build
Source GitHub: github.com/olofvndrhr/docker-baseimages

-------------------------------------------------
GID/UID
-------------------------------------------------
User uid:    4444
User gid:    4444
-------------------------------------------------

[cont-init.d] 12-setuid: exited 0.
[cont-init.d] 20-setenv: executing... 
[cont-init.d] 20-setenv: exited 0.
[cont-init.d] 50-init: executing... 
Lock file present. Not copying files
[cont-init.d] 50-init: exited 0.
[cont-init.d] 51-prepare: executing... 
[cont-init.d] 51-prepare: exited 0.
[cont-init.d] 52-migrate: executing... 
Migrating database
[cont-init.d] 52-migrate: exited 0.
[cont-init.d] 80-fix-perms: executing... 
[cont-init.d] 80-fix-perms: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.

Problematic Flox logs:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-set-timezone.sh: executing... 
Setting Timezone: Europe/Zurich
[cont-init.d] 10-set-timezone.sh: exited 0.
[cont-init.d] 11-fix-attrs.sh: executing... 
Fixing permissions in /etc/cont-init.d/
Fixing permissions in /etc/services.d/
Fixing permissions in /etc/cron.d/
[cont-init.d] 11-fix-attrs.sh: exited 0.
[cont-init.d] 12-setuid.sh: executing... 
usermod: no changes

-------------------------------------------------
       __     __    _                        _____
  ____/ /__  / /_  (_)___ _____        _____/ ___/
 / __  / _ \/ __ \/ / __ `/ __ \______/ ___/ __ \
/ /_/ /  __/ /_/ / / /_/ / / / /_____(__  ) /_/ /
\__,_/\___/_.___/_/\__,_/_/ /_/     /____/\____/

Source: git.44net.ch/44net-assets/docker-baseimages-build
Source GitHub: github.com/olofvndrhr/docker-baseimages

-------------------------------------------------
S6 Version: v2.2.0.3
Build Version: debian-s6:1.3.6
-------------------------------------------------
User UID: 4444
User GID: 4444
-------------------------------------------------

[cont-init.d] 12-setuid.sh: exited 0.
[cont-init.d] 20-setenv: executing... 
[cont-init.d] 20-setenv: exited 0.
[cont-init.d] 50-init: executing... 
Lock file present. Not copying files
[cont-init.d] 50-init: exited 0.
[cont-init.d] 51-prepare: executing... 
[cont-init.d] 51-prepare: exited 0.
[cont-init.d] 52-migrate: executing... 
Migrating database
[cont-init.d] 52-migrate: exited 0.
[cont-init.d] 80-fix-perms: executing... 
[cont-init.d] 80-fix-perms: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
cupanoodles commented 1 year ago

At a quick glance between those two logs you provided, I notice no discrepancies. If it is some kind of docker compatibility issue, that is outside of my scope, as I am new to docker. I guess I can install the service at the OS layer and bypass containerization. Just kind of a pain when it comes to service management, as I have everything in portainer and would have to remember that this service is running outside of that environment and manage it in a separate ssh session.

A side note: if you provide me any direction on what to look for and where to look, I can try to support troubleshoot efforts.

As always, I appreciate all of your support thus far. 🙏

AuthorShin commented 1 year ago

@cupanoodles So I found a solution for you. I created a backup of the working Flox directory, the one that is bound to /flox on the container side, and installed Flox on another server and it wasn't working (same login problem). Then I stopped the container and moved the backup file to the new server and replaced it with new ones and after I started the container again I was able to login and everything seemed to be working perfectly.

You can download the backup file from here: http://212.90.103.100:6514/file/floxbackup.tgz

You can extract it with tar xvf /floxbackup.tgz -C /

P.S. I might delete the file later so download it ASAP.

cupanoodles commented 1 year ago

@cupanoodles So I found a solution for you. I created a backup of the working Flox directory, the one that is bound to /flox on the container side, and installed Flox on another server and it wasn't working (same login problem). Then I stopped the container and moved the backup file to the new server and replaced it with new ones and after I started the container again I was able to login and everything seemed to be working perfectly.

You can download the backup file from here: http://212.90.103.100:6514/file/floxbackup.tgz

You can extract it with tar xvf /floxbackup.tgz -C /

P.S. I might delete the file later so download it ASAP.

I downloaded your archive and replaced the files in the /flox directory as you instructed and this did not resolve the problem for me.

According to what I am reading per your description, I believe your troubleshoot approach was to run a non-containerized and functional version of flux then copy and overwrite the container data directory with the data from the functioning application. I thought to myself that perhaps I could replicate this process by just deleting all files in the /flox folder then pulling a fresh repo into the directory. I did this and ran the container and this did not solve the missing login credentials issue either. The issue keeps pointing to some process failing to populate the database with the user data on initialization.

I then read through and followed the instructions for a non container install in accordance to: https://github.com/devfake/flox. While walking through this process, I found out that composer wasn't installed && that flox requires PHP 7.2 while my environment runs on 8.1.2. I installed composer and tried modifying the composer file to use 8.1 and got stuck on laravel 6.8 refusing to work with php 8.1. At this point I don't want to modify my environment any further, because I have way too many services running on the current configuration. I guess I am unable to use flox in my environment due to its outdated PHP requirements.

I am sorry that I did not have the time to walk through this process before so that I did not waste any of your time. I assumed it would have been an easy fix, but determined otherwise. As always, I appreciate all of your attempts to help me. 😊

AuthorShin commented 1 year ago

@cupanoodles Why you make it hard for yourself? :D First of all I should say it was a containerized Flox (do not touch the non-containerized one), then I think you just miss place the files that's all.

Okay I'm gonna say it more clearly this time which might help you to place it correctly.

The file I gave you containing of a folder called flox with all the thing you need

First install it like this:

docker run -p '8551:80' --volume '/floxtest/test1/<flox-directory-that-I-sent-you>/:/flox/' -e tmdb_api_key=<key> -e flox_db_init=true --name flox olofvndrhr:flox-dockerized:latest

Then stop the container and delete the flox folder and then copy paste the flox folder I send you and then start the container again.

cupanoodles commented 1 year ago

@AuthorShin thank you so much! 🥳

I am always busy doing many things, so my head wasn't clear when I made things difficult on myself. Thank you for taking the time to give me that clear instruction. I got it working. 😁

Let me know if I can buy you a cup of coffee to thank you 😊

AuthorShin commented 1 year ago

You're very welcome :) @cupanoodles I'm happy that worked out for you. 🥳