Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Container hangs, on startup #37

Open
YouveGotMeowxy opened this issue Jan 18, 2025 · 26 comments
Open

Container hangs, on startup #37

YouveGotMeowxy opened this issue Jan 18, 2025 · 26 comments

Comments

@YouveGotMeowxy
Copy link

I'm trying to give this app a try but having no luck. It always gets to this line:

Downloading spatie/laravel-feed (4.4.0)

hangs for quite awhile, then the container crashes/stops. Here's my compose, any ideas?

``
discount-bandit:
hostname: 'discount-bandit'
image: 'cybrarist/discount-bandit'
environment:
APP_TIMEZONE: 'America/Chicago'
APP_PORT: '80'
APP_URL: 'http://discount-bandit:80'
ASSET_URL: 'http://discount-bandit:80'
APP_ENV: 'production'
APP_DEBUG: 'false'
DB_CONNECTION: 'mysql'
DB_HOST: 'mariadb'
DB_DATABASE: 'discountbandit'
DB_PORT: '3306'
DB_USERNAME: 'bandit'
DB_PASSWORD: 'redacted'
MYSQL_ROOT_PASSWORD: 'redacted' # Why?
DEFAULT_USER: 'KC'
DEFAULT_EMAIL: '[email protected]'
DEAFULT_PASSWORD: 'redacted'
APPRISE_URL: 'apprise'
networks:
- 'misc'
- 'security'
- 'swag'
labels:
swag.uptime-kuma.enabled: "true"
swag.uptime-kuma.monitor.name: "Discount Bandit"
swag.uptime-kuma.monitor.url: "https://discountbandit.domain.rocks"
swag.uptime-kuma.monitor.description: "Best Price Finder"
swag.uptime-kuma.monitor.parent: "SHOPPING"
deploy:
mode: 'replicated'
replicas: 1
placement:
constraints:
- 'node.labels.Cloud == true'
restart_policy:
condition: 'any'

@Cybrarist
Copy link
Owner

Hi @YouveGotMeowxy,

it seems that it gets stuck while downloading some packages, can you make sure you have enough space, also check is it timing out or just crashes.

some extra points :

  • you don't need to pass port 80 to app_url and asset_url as it's the default for http.
  • 'MYSQL_ROOT_PASSWORD' is not needed, where did you get it from ?

@YouveGotMeowxy
Copy link
Author

Tyvm for such a fast response :)

it seems that it gets stuck while downloading some packages, can you make sure you have enough space

Plenty of space; I have a 12 TB HDD.

also check is it timing out or just crashes.

Is there another way for me to be able to tell? All I see in the log is this:

^--- etc.

  - Downloading spatie/laravel-health (1.31.0)
  - Downloading shuvroroy/filament-spatie-laravel-health (v2.3.1)
  - Downloading spatie/laravel-feed (4.4.0)
    Container stopped

  • 'MYSQL_ROOT_PASSWORD' is not needed, where did you get it from ?

Ok , ty for letting me know. I didn't understand why, since I was already adding the values for the specific database. The is where I saw that, though, right down in the docker compose example:

https://hubgw.docker.com/r/cybrarist/discount-bandit

some extra points :

  • you don't need to pass port 80 to app_url and asset_url as it's the default for http.

ok, I just also saw that in the example from the link above. I mostly did a copy/paste of the config and just tweaked my system's unique settings.

@YouveGotMeowxy
Copy link
Author

Another quick question; does this container accept docker secrets in it's compose?

@YouveGotMeowxy
Copy link
Author

YouveGotMeowxy commented Jan 19, 2025

Update: I got it! :D

Turned out my modem needed a reboot because it was downloading super slow. I've never had that happen before.

I think i may have identified a bug though? my email user name has a plus sign in it, and even though it matches exactly with what I have in my config, it tells me it doesn't recognize it. "These credentials do not match our records."

UPDATE: I guess not. I deleted that user from the db, and created a new one in the environment variable without the plus sign, and for some reason I still can't login with it. I could login with the test@ account though?

A couple more questions:

I also keep seeing this in the log, does it mean anything, or would it help improve anything by setting it in my compose?

WARN Please adjust the OCTANE_SERVER environment variable.

and 2.6 GB is a lot of memory for a container to eat up, is there a way to trim it down? Maybe adjust the number of laravel workers or something, via an environment variable?

@YouveGotMeowxy
Copy link
Author

Also, sorry for so many comments, but while messing with all this I noticed something. Is this logo size intended to be so small? I removed the size restriction and it looks so much better, lol.

Image

@YouveGotMeowxy
Copy link
Author

aaaaaand DISABLE_AUTH: 1 isn't working ...

I still get the login form.

@Cybrarist
Copy link
Owner

Cybrarist commented Jan 19, 2025

hi @YouveGotMeowxy

https://hubgw.docker.com/r/cybrarist/discount-bandit

yea it shouldn't be there, i'll remove it.

Another quick question; does this container accept docker secrets in it's compose?

i didn't try tbh so i guess not.

I think i may have identified a bug though? my email user name has a plus sign in it, and even though it matches exactly with what I have in my config, it tells me it doesn't recognize it. "These credentials do not match our records."

yea, i guess it might cause an issue since i add the user as command, didn't really think someone might use + in email, but i'll add a fix for it as i think wrapping it with "" should be enough.

https://github.com/Cybrarist/Discount-Bandit/blob/a91a9ba86a583c8ef21fb0e29584799802e90204/docker/entrypoint.sh#L35C78-L35C86

I also keep seeing this in the log, does it mean anything, or would it help improve anything by setting it in my compose?

i'll investigate further to see if there's a way i can get rid of it.

and 2.6 GB is a lot of memory for a container to eat up

yes, please disable all stores that you don't need from the the system, then restart the container, so the container won't create supervisors for the stores that are disabled.

i thought i have put this info on the website, but apparently i didn't, so i will add it later. but that should reduce the ram usage.

Is this logo size intended to be so small?

yea this is the default, so it doesn't really matter to me tbh. it's just a logo in the end :D

DISABLE_AUTH: 1 isn't working ...

hmmm, i assume you restarted the container after you passed the env or after you edited it, right ? and of course you are using the latest.

@YouveGotMeowxy
Copy link
Author

hmmm, i assume you restarted the container after you passed the env or after you edited it, right ? and of course you are using the latest.

Yes, the latest, and I've restarted the container several times and it still shows up. I also still can't login, even when I remove the plus sign from my email address. Any idea on that?

For shits n grins I optimized the logo as well if you want to use it. trimmed off about 12kb

Image

@Cybrarist
Copy link
Owner

ok, i'll double check it.

can you send me the log you are getting when you start the container with the email that doesn't contain '+' please

@YouveGotMeowxy
Copy link
Author

YouveGotMeowxy commented Jan 20, 2025

@Cybrarist Here's the entire log I have (the email is on line 87): https://pastebin.com/s7rgUF94

the pw doesn't seem to matter. For a test case I even just set it to 1234567890.

Here's the entire compose I'm using:

Expand
  discount-bandit:
  hostname: 'discount-bandit'
  image: 'cybrarist/discount-bandit'
  environment:
    APP_TIMEZONE: 'America/Chicago'
    APP_PORT: '443'
    APP_URL: 'https://discount-bandit.domain.rocks'
    ASSET_URL: 'https://discount-bandit.domain.rocks'
    APP_ENV: 'production'
    APP_DEBUG: 'false'
    DB_CONNECTION: 'mysql'
    DB_HOST: 'mariadb'
    DB_DATABASE: 'discountbandit'
    DB_PORT: '3306'
    DB_USERNAME: 'bandit'
    DB_PASSWORD: 'redacted'
    DEFAULT_USER: 'KC'
    DEFAULT_EMAIL: '[email protected]'
    DEAFULT_PASSWORD: '1234567890'
    THEME_COLOR: 'Stone'
    #DISABLE_AUTH: 1 # For Authelia/Authentik (doesn't work)
    APPRISE_URL: 'apprise'
  networks:
    - 'mariadb'
    - 'misc'
    - 'security'
    - 'swag'
  labels:
    swag.uptime-kuma.enabled: "true"
    swag.uptime-kuma.monitor.name: "Discount Bandit"
    swag.uptime-kuma.monitor.url: "https://discountbandit.domain.rocks"
    swag.uptime-kuma.monitor.description: "Best Price Finder"
    swag.uptime-kuma.monitor.parent: "SHOPPING"
  deploy:
    mode: 'replicated'
    replicas: 1
    placement:
      constraints:
        - 'node.labels.Cloud == true'
    restart_policy:
      condition: 'any'

It's definitely creating the info in the db:

Image

Another question: the very first time I created a container it auto-added a "[email protected]" account that worked, but since then it never does? Even when I drop all tables and restart the container so it re-seeds everything. I was going to try just logging into that account and changing everything, but can't.

@Cybrarist
Copy link
Owner

'DEAFULT_PASSWORD' can you double check this one please, it should be DEFAULT_PASSWORD.

[email protected] is created when environment is local, so i can test it. but it's not recommended to be there if the website is public facing.

@Cybrarist
Copy link
Owner

#DISABLE_AUTH: 1 # For Authelia/Authentik (doesn't work)

i have just noticed this one, if you login locally without authentik, does it work ? i tested it for both images and it works fine for me, but i didn't try it with authentik tbh.

@YouveGotMeowxy
Copy link
Author

OOOO MMMMM GGGGGGG!!! I feel like a huuuuge idiot right now! lolll

It worked and I'm an idiot for not seeing that stupid typo! I'm so sorry for all of this. I guess my eyes are just burnt out and needed a fresh pair of eyes. Thank you for spotting it! :)

@Cybrarist
Copy link
Owner

dw, it was a typo from my side on the docker hub description. I fixed it.

in regarding to login without authentication, is it working for you ? locally or through authentik ?

@YouveGotMeowxy
Copy link
Author

in regarding to login without authentication, is it working for you ? locally or through authentik ?

the DISABLE_AUTH: 1 still doesn't do anything, whether in local or production mode; I still always get the login form.

Some other issues I've noticed:

  • I deleted a bunch of stores, restarted the container, and it's still showing 2.7GB memory being used; did I misunderstand?
  • There are 2 eBay items in the list that "seem" like dupes; they don't say where they're at. The rest say what country, but not these 2:

Image

  • After deleting all unwanted stores and restarting the container it re-seeds all those stores right back.
  • It would be most excellent if there were check boxes next to each store in the list, and we could delete all the checked ones in one
    click of the Delete button. ;)
    Twice now I've manually had to load each store's page to click it's delete button, for every store not in the U.S.
    I'm dreading having doing it a 3rd time now after another container restart, lol.
  • I found a real easy way to crash the app on startup; instead of a theme name, just add a hex color (i.e. #ffffff). I was wondering if we could add our own custom color so tried it out and viola. Any chance of adding that ability? I like Nord colors myself.

@Cybrarist
Copy link
Owner

I deleted a bunch of stores, restarted the container, and it's still showing 2.7GB memory being used; did I misunderstand?

After deleting all unwanted stores and restarting the container it re-seeds all those stores right back.

don't delete the stores, you need to change their status to disabled.

There are 2 eBay items in the list that "seem" like dupes; they don't say where they're at. The rest say what country, but not these 2

i'll fix this, but one of them is for USA and the other for germany

It would be most excellent if there were check boxes next to each store in the list, and we could delete all the checked ones in one

you are right, i will make the status change to be from outside, and also as bulked action.

Twice now I've manually had to load each store's page to click it's delete button, for every store not in the U.S.

i can add countries to stores so user can filter them based on that, and then disable the one he doesn't want.

I found a real easy way to crash the app on startup; instead of a theme name, just add a hex color (i.e. #ffffff). I was wondering if we could add our own custom color so tried it out and viola. Any chance of adding that ability? I like Nord colors myself.

sadly this option is not a custom color, because the package i am using supports custom preset of colors, you can check the available colors from the following links

https://discount-bandit.cybrarist.com/environments.html#change-the-theme-color

@Cybrarist Cybrarist reopened this Jan 23, 2025
@YouveGotMeowxy
Copy link
Author

don't delete the stores, you need to change their status to disabled.

Out of curiosity, why is there the ability to delete a store if it/they just get re-added on container startup?

sadly this option is not a custom color, because the package i am using supports custom preset of colors, you can check the available colors from the following links

It's not a huge deal at all, since the colors only really affect a small handful of things. I'd actually like to do a whole CSS facelift to the UI, lol. I'm a bit of a style freak.

Down the road are there already plans to let us be able to add in more stores to the list? Like Home Depot, Menards, Old Navy, etc.?

@Cybrarist
Copy link
Owner

Out of curiosity, why is there the ability to delete a store if it/they just get re-added on container startup?

it comes by default, but probably i should change it to disable in the upcoming update.

It's not a huge deal at all, since the colors only really affect a small handful of things. I'd actually like to do a whole CSS facelift to the UI, lol. I'm a bit of a style freak.

if you want to do a whole facelift, you can always clone the repo. then check the following link to change whatever you want
https://filamentphp.com/docs/3.x/panels/themes

Down the road are there already plans to let us be able to add in more stores to the list? Like Home Depot, Menards, Old Navy, etc.?

sadly, no. that'll be a lot of work to create an "engine" that allows all different options available for store to be crawled. as some websites requires multiple steps too. so each store must be done manually by someone.

but you can always make a PR for a store and i will happily merge it, and if you need any help regarding PR, feel free to dm on discord too.

@Cybrarist
Copy link
Owner

i have been testing DISABLE_AUTH and it seems working fine for me.

can you try to run the following in the running container and check if it works.

php artisan optimize:clear

@YouveGotMeowxy
Copy link
Author

i have been testing DISABLE_AUTH and it seems working fine for me.

can you try to run the following in the running container and check if it works.

php artisan optimize:clear

ok, I'm trying but ran into another issue. lol

I was logged into my user, tried clicking the logout item and it took me here:

Image

clicked "send anyway" and got this:

Image

ran the command anyway:

Image

restarted the container, loaded up https://discount-bandit.mydomain.com, and it redirected me to: https://discount-bandit.mydomain.com/login


Curious, how does your app know which user's items/stuff to use when disable login is set to true/1?

@YouveGotMeowxy
Copy link
Author

Also, it's not saving my "per page" choices between container restarts. Can that be fixed so it remembers those?

@Cybrarist
Copy link
Owner

I was logged into my user, tried clicking the logout item and it took me here:

probably the issue is the following:
i can see the url is https while the app_url is http, so when you logout, the app sends a post request using http which causes chrome to show the security error page, then you press 'send anyway', and i think it sends the request as GET instead of POST and this is why you get the 405 error.

Curious, how does your app know which user's items/stuff to use when disable login is set to true/1?

it doesn't, the app is meant to be used by one user, you can add other users but all have access to everything. there are no roles, no restrictions, nothing.

Also, it's not saving my "per page" choices between container restarts. Can that be fixed so it remembers those?

not sure what you mean by that

as for disable auth, i have no idea why it's not working, i need to investigate it more tbh.

@YouveGotMeowxy
Copy link
Author

Curious, how does your app know which user's items/stuff to use when disable login is set to true/1?

it doesn't, the app is meant to be used by one user, you can add other users but all have access to everything. there are no roles, no restrictions, nothing.

Are there plans on making it so individual users get their own stuff? I was hoping to add my mom for her own account to manage her own stuff. :)

Also, it's not saving my "per page" choices between container restarts. Can that be fixed so it remembers those?

not sure what you mean by that

This:

Image

2 more new questions :)

Is this supposed to look like this?

Image

and, is there a way we can test our apprise settings? Like, send a test notification via DB?

@Cybrarist
Copy link
Owner

Are there plans on making it so individual users get their own stuff? I was hoping to add my mom for her own account to manage her own stuff. :)

not really since you're the first who requested it :D , but i'll add it to my todo list.

not sure what you mean by that

this is managed by the package i am using, i will see if there's a way to make it persistent or make it a cookie at least.

Is this supposed to look like this?

no, that was a bug from the package responsible, it's fixed in 3.4, but if you want a quick fix, run 'composer update' then 'php artisan optimize:clear'.

and, is there a way we can test our apprise settings? Like, send a test notification via DB?

yes, you can run 'php artisan discount:test-notify'

@YouveGotMeowxy
Copy link
Author

YouveGotMeowxy commented Jan 27, 2025

no, that was a bug from the package responsible, it's fixed in 3.4, but if you want a quick fix, run 'composer update' then 'php artisan optimize:clear'.

Didn't work, lol.

Untitled.Project.mp4

@Cybrarist
Copy link
Owner

hmm that's weird, that's how i fixed it on my instance.

no issues, just give me some time until i push 3.4 and then it should be fine hopefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants