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

504 Timeout when trying to open expose.mydomain.com/users #18

Closed
goellner opened this issue Jun 17, 2020 · 21 comments
Closed

504 Timeout when trying to open expose.mydomain.com/users #18

goellner opened this issue Jun 17, 2020 · 21 comments

Comments

@goellner
Copy link

server is running on Laravel Forge.
php 7.3

expose.mydomain.com, /sites and /settings is working, but when clicking the users tab, there is a 504 timeout and a generic nginx error page.

@mpociot
Copy link
Member

mpociot commented Jun 17, 2020

Can you try modifying the database configuration key?
Also, try and see if the database file exists.

When clicking the user link, expose is trying to connect to the SQLite database.

@filipac
Copy link

filipac commented Jun 17, 2020

@mpociot so it seems that running expose from supervisor is having this problem and it does not seem to load the right configuration file (i deleted a comma from ~/.expose/config.php to check if startup fails). When running /usr/bin/php /home/forge/.composer/vendor/bin/expose serve from forge user it works as expected, it even fails if i delete that comma (loads the ~/.expose/config.php file). Any idea why supervisor might be broken? Here is my config:

directory=/home/forge
command=/usr/bin/php /home/forge/.composer/vendor/bin/expose serve local.filipac.net
numprocs=1
autostart=true
autorestart=true
user=forge

@filipac
Copy link

filipac commented Jun 17, 2020

I did try to change database key from config and work when running manually, but when running in supervisor the config is ignored.

@filipac
Copy link

filipac commented Jun 17, 2020

There is no way to specify the config file as a CLI argument or --option right?

@filipac
Copy link

filipac commented Jun 17, 2020

What worked for me now: ln -s .expose/config.php .expose.php in /home/forge as that is the working directory for supervisord

@goellner
Copy link
Author

Can confirm, that when running with supervisord it is not working, but when starting it directly everything works as expected. I also had to change my startup command to command=/usr/bin/php /home/forge/.composer/vendor/bin/expose serve mydomain.com

@dasraab
Copy link

dasraab commented Jun 17, 2020

same problem here. also changed my supervisor command like @goellner did. running without supervisor works ...

@ahmedash95
Copy link
Contributor

ahmedash95 commented Jun 17, 2020

I was able to solve this through these steps

1 - $COMPOSER/vendor/beyondcode/expose/condig/expose.php to home directory -in my case- /home/forge/.expose.php

2 - open the file and change database to a custom path

'database' => '/home/forge/expose-db/expose.db',

3 - run expose serve

4 - /users should work for you as expose should be able to create db file

@goellner
Copy link
Author

ended up using PM2 (https://pm2.keymetrics.io/) and everything worked right away. I created this file: /home/forge/.expose.php

@edalzell
Copy link

edalzell commented Jun 19, 2020

@ahmedash95 can you share how you set it up on Forge?

@ahmedash95
Copy link
Contributor

ahmedash95 commented Jun 19, 2020

@ahmedash95 can you share how you set it up on Forge?

I'll write an article once I solve my last error but here is a quick recipe

First, create an empty repo then create a site from this repo. once you do that ssh to your forge server and find the nginx config for that domain and change it's content to be like that https://beyondco.de/docs/expose/server/ssl . and just replace the /location part as Forge taking care of all other stuff

ssh to your forge server and install expose globally

composer global require beyondcode/expose

then copy the config file to home directory

 cp /home/forge/.config/composer/vendor/beyondcode/expose/config/expose.php /home/forge/.expose.php

modify the database path at.expose.php like below (make sure expose-db directory exists as expose will not create it)

'database' => '/home/forge/expose-db/expose.db',

then run expose serve and make sure users tab is working
image

Now everything should be fine apart from this bug I've right here
#31

@edalzell
Copy link

Run it how? Via a daemon or manually?

@ahmedash95
Copy link
Contributor

Run it how? Via a daemon or manually?

as you want. can be manually like

/home/forge/.config/composer/vendor/bin/expose serve share.yourdomain.com --port 8085

or daemon using forge. but make sure to set the path to home directory
image

@SamuelNitsche
Copy link

Run it how? Via a daemon or manually?

as you want. can be manually like

/home/forge/.config/composer/vendor/bin/expose serve share.yourdomain.com --port 8085

or daemon using forge. but make sure to set the path to home directory
image

Yep, that works. Thank you!

@ahmedash95
Copy link
Contributor

Happy to help!

@edalzell
Copy link

Hero status for @ahmedash95

@edalzell
Copy link

I still cannot get it to work, how frustrating. I have installed it locally in my Forge site: (composer require...).

Laravel Forge | dl-sites 2020-06-19 07-34-39

I have this in /home/forge:
image

And it is reading the config file (I had a typo in there the first time and got an error).

I have this in my nginx conf:

    location / {
        proxy_pass             http://127.0.0.1:8080;
        proxy_read_timeout     60;
        proxy_connect_timeout  60;
        proxy_redirect         off;

        # Allow the use of websockets
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }

I have SSL on w/ wildcards:
image

When I go to my expose url I get
image

But I can't get to the admin page nor any share, even though the share seems to work.
image

Lastly my config:

    'admin' => [
        'database' => '/home/forge/.expose/expose.db',
        'subdomain' => 'admin',

So, what silly thing did I miss?

@ahmedash95
Copy link
Contributor

ahmedash95 commented Jun 19, 2020

@edalzell can you make sure the server's nginx config file has . as prefix of server name
image

that way we are telling nginx to redirect any subdomain.(your expose domain) to expose so you can get the proper response

@edalzell
Copy link

Turns out it was a DNS issue, I forgot to add the wildcard DNS entry. @ahmedash95's instructions went perfect

@goellner
Copy link
Author

Just to add to @edalzell comment, if someone has the same problem:

You have to have a wildcard A record in your DNS settings:

*.mydomain.com -> 123.123.123.123 (your server ip)

@enzolarosa
Copy link

I solve the issue following the @ahmedash95 instructions

thank you

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

8 participants