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

[error] Failed to initiate database #1

Closed
mizzunet opened this issue Feb 8, 2021 · 23 comments
Closed

[error] Failed to initiate database #1

mizzunet opened this issue Feb 8, 2021 · 23 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request

Comments

@mizzunet
Copy link

mizzunet commented Feb 8, 2021

I'm trying to host passed server for testing purpose, so if I could, I would try to make Heroku deployment. But it returns this error, can you help me on that? How do I set up a local database and I'm also thinking of trying this https://stackoverflow.com/questions/23550453/golang-how-to-open-a-remote-mysql-connection for Heroku as it needs separate DB
Screenshot_20210209-001607~01

@gargakshit
Copy link
Member

Currently box only supports sqlite, and to use sqlite you need disk write access which heroku doesn't provide. I will add support for mysql and postgres next week

@gargakshit gargakshit added bug Something isn't working enhancement New feature or request labels Feb 8, 2021
@mizzunet
Copy link
Author

mizzunet commented Feb 8, 2021

Currently box only supports sqlite, and to use sqlite you need disk write access which heroku doesn't provide. I will add support for mysql and postgres next week

Yeah, but this isn't ain't Heroku. I have disk access. And glad to hear MySQL support info :)

@gargakshit
Copy link
Member

Yeah, but this isn't ain't Heroku. I have disk access.

Oh sorry! It happens when the data directory does not exist. You can solve it by running mkdir -pv data/uploads in the directory where you are running the binary. I will add those directories with an empty .gitkeep file to prevent further issues like this

@mizzunet
Copy link
Author

mizzunet commented Feb 8, 2021

Yeah, but this isn't ain't Heroku. I have disk access.

Oh sorry! It happens when the data directory does not exist. You can solve it by running mkdir -pv data/uploads in the directory where you are running the binary. I will add those directories with an empty .gitkeep file to prevent further issues like this

Thanks, that seems fixed the issue. BTW sorry it sounds dumb, I'm just noob :D, what should be LISTEN_ADDRESS value. I just put 0.0.0.0:3000, what should I enter "Server URL" in the app?

@mizzunet
Copy link
Author

mizzunet commented Feb 8, 2021

Screenshot_20210209-003619~01

@gargakshit
Copy link
Member

Yeah, but this isn't ain't Heroku. I have disk access.

Oh sorry! It happens when the data directory does not exist. You can solve it by running mkdir -pv data/uploads in the directory where you are running the binary. I will add those directories with an empty .gitkeep file to prevent further issues like this

Thanks, that seems fixed the issue. BTW sorry it sounds dumb, I'm just noob :D, what should be LISTEN_ADDRESS value. I just put 127.0.0.1:5000, what should I enter "Server URL" in the app?

127.0.0.1 will listen the server on the loopback only, so you need a reverse proxy if you are accessing it outside localhost. If you want to access if from outside without a reverse proxy, you can listen on 0.0.0.0:5000. The server URL in that case would be your_server_ip:5000. So if your server's IP is 1.2.3.4, the Server URL will be 1.2.3.4:5000.

PS: Running without a reverse proxy is not recommended outside local networks as you need a reverse proxy to add HTTPS.

@gargakshit gargakshit added the documentation Improvements or additions to documentation label Feb 8, 2021
@mizzunet
Copy link
Author

mizzunet commented Feb 8, 2021

Yeah, but this isn't ain't Heroku. I have disk access.

Oh sorry! It happens when the data directory does not exist. You can solve it by running mkdir -pv data/uploads in the directory where you are running the binary. I will add those directories with an empty .gitkeep file to prevent further issues like this

Thanks, that seems fixed the issue. BTW sorry it sounds dumb, I'm just noob :D, what should be LISTEN_ADDRESS value. I just put 127.0.0.1:5000, what should I enter "Server URL" in the app?

127.0.0.1 will listen the server on the loopback only, so you need a reverse proxy if you are accessing it outside localhost. If you want to access if from outside without a reverse proxy, you can listen on 0.0.0.0:5000. The server URL, in that case, would be your_server_ip:5000. So if your server's IP is 1.2.3.4, the Server URL will be 1.2.3.4:5000.

PS: Running without a reverse proxy is not recommended outside local networks as you need a reverse proxy to add HTTPS.

I put LISTEN_ADDRESS as 0.0.0.0:5000
Ran server
Put server_ip:5000 in URL textbox, but it says URL is not valid :(
Screenshot_20210209-004531~01

@gargakshit
Copy link
Member

You need to put it as http://ip:5000. That was a mistake on my side. I will fix it in the next release

@gargakshit
Copy link
Member

Current validator requires explicit mentioning of the protocol, be http or https

@mizzunet
Copy link
Author

mizzunet commented Feb 8, 2021

Screenshot_20210209-005140
Most probably I might have did something dumb. The IP should be "curl ifconfig.me" returns right?

@mizzunet
Copy link
Author

mizzunet commented Feb 8, 2021

Can I give you any logs or something for more info?

@gargakshit
Copy link
Member

Yep the IP should be that. But did you check if your server allows port 5000 through its firewall.

Can I give you any logs or something for more info?

A logcat dump using adb would be useful

@mizzunet
Copy link
Author

mizzunet commented Feb 8, 2021

Yep the IP should be that. But did you check if your server allows port 5000 through its firewall.
Let me check

Can I give you any logs or something for more info?

A logcat dump using adb would be useful
Please wait a minute

@gargakshit
Copy link
Member

I see you are using azure. Azure's firewall blocks 5000 by default. You would need to allow 5000 through the firewall.

@mizzunet
Copy link
Author

mizzunet commented Feb 8, 2021

A logcat dump using adb would be useful

Screenshot_20210209-005818
Just clipboard errors

@gargakshit
Copy link
Member

I think its a firewall issue as I can't reach port 5000

image

@mizzunet
Copy link
Author

mizzunet commented Feb 8, 2021

I see you are using azure. Azure's firewall blocks 5000 by default. You would need to allow 5000 through the firewall.

I'm using this https://github.com/Area69Lab/Ubuntu-SSH for testing purpose

@gargakshit
Copy link
Member

Ah I am suspecting that incoming traffic on port 5000 is blocked as I can't reach it

@mizzunet
Copy link
Author

mizzunet commented Feb 8, 2021

Ah I am suspecting that incoming traffic on port 5000 is blocked as I can't reach it

I followed this and tried, still the same.
https://www.digitalocean.com/community/questions/flask-port-5000-blocked

@gargakshit
Copy link
Member

ufw is a firewall tied to the VM, but they can still block ports at the network level using hardware firewalls or routers or stuff like that. in most cases, ufw isn't even activated by default as hardware firewall does the job

@mizzunet
Copy link
Author

mizzunet commented Feb 8, 2021

ufw is a firewall tied to the VM, but they can still block ports at the network level using hardware firewalls or routers or stuff like that. in most cases, ufw isn't even activated by default as hardware firewall does the job

Oh. Then I might gonna wait till you implement Heroku deployment, hopefully looking forward it :)

@mizzunet
Copy link
Author

mizzunet commented Feb 15, 2021

By this repo which helps to host Bit Warden_rs instance into Heroku https://github.com/davidjameshowell/bitwarden_rs_heroku

@gargakshit
Copy link
Member

gargakshit commented Feb 18, 2021

Closing this issue as

  1. Documentation is a lot better than before
  2. I have create a separate issue for psql and mysql support ([database] Add support for mysql and psql #5)
  3. Data directory bug has been fixed (commit 6cf454f)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants