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

Troubleshooting Failbooru after fresh install (probs very basic error) #4096

Closed
GlassedSilver opened this issue Jun 24, 2019 · 10 comments
Closed
Labels

Comments

@GlassedSilver
Copy link
Contributor

Preface: creating a second issue for this (sorry if this is not the correct way to go about it), because a) this seems like a very different kind of issue than my previous one and b) the old one's not gotten attention for over a week. NO hard feelings at all, I'm overly grateful for all the support I received so far


Alright so in my endevor to troubleshoot the Failbooru page I tried to launch the rails console using "rails c" and alternatively "rails console" but apparently it's not installed? Does rails really not have a console ready to go by default or am I missing something here (yet again)?

I looked up a bunch of tutorials for rails console and apparently the whole world launches the console just fine using either of the commands I mentioned except my VM seems to know nothing about rails console.

(so far successfully tested the database using psql)

Originally posted by @GlassedSilver in #4089 (comment)

@kdoshere
Copy link

Work kept me pretty busy (?)

Well, regarding your rails issue, try to run rails in any terminal, do you get anything?

For example:
TC danbooru]$ rails
The most common rails commands are:
generate Generate new code (short-cut alias: "g")
...

If you get this, you just need to go to the danbooru project folder and run:
bundle exec rails console

Or even just:
rails console

And then you'll need to see if there's any error or warning that is preventing your booru from running.

@r888888888
Copy link
Collaborator

In general, most gem commands should be accessible underneath bin so you can run bin/rails console and see if that works.

@GlassedSilver
Copy link
Contributor Author

GlassedSilver commented Jun 28, 2019

Okay so I was able to launch the console from the project directory. Thanks for the input you guys. :)

I issued Post.count and that worked nicely. Completed in 1.6ms and returned (as expected) 0 entries.

Still getting Failbooru. :/ Not quite sure what to do next, because Rails can connect to db and nginx can serve the Failbooru, so it too should work?

I also don't get any errors in the rails console, unless I'm supposed to run some commands other than Post.count to verify it's working. Wouldn't know which?

And sorry kdoshere, I definitely didn't mean to sound impatient, I myself am quite busy with uni and work as you might be able to tell given how I now replied days later myself.

Edit: Is it normal that /var/www/danbooru/current/public doesn't contain an index.html? Just to compare, what does everyone's folder look like there?

Also I don't know if it means anything, but if I try to load /maintenance.html I get a 404 error. If I try to load /fantasynamewhatever.html I get "something broke".

@kdoshere
Copy link

kdoshere commented Jul 1, 2019

@GlassedSilver Nah, don't worry its fine :)

Regarding your question, no, theres no index.html in the public folder.

And to tell you the truth I'm kind of surprised that it doesn't work for you, I mean, just now I did a deploy from 0 using a new VM with a fresh Ubuntu installation just with this changes and script: https://github.com/kdoshere/booru/commit/b913158202b0b5c85b4e13f39de3d6ae3f32cb7b

And it deployed successfully, so I can only thing that it should be something about the nginx configuration or some detail that we overlooked.

But right know I can't think about what it should be, lets hope someone else sees this and they might give you some advice about this.

Now if you don't feel particulary attached to that VM you could also try to start over again and see if there's any chance or error message that you missed.

@GlassedSilver
Copy link
Contributor Author

@GlassedSilver Nah, don't worry its fine :)

Regarding your question, no, theres no index.html in the public folder.

And to tell you the truth I'm kind of surprised that it doesn't work for you, I mean, just now I did a deploy from 0 using a new VM with a fresh Ubuntu installation just with this changes and script: kdoshere@b913158

And it deployed successfully, so I can only thing that it should be something about the nginx configuration or some detail that we overlooked.

But right know I can't think about what it should be, lets hope someone else sees this and they might give you some advice about this.

Now if you don't feel particulary attached to that VM you could also try to start over again and see if there's any chance or error message that you missed.

That might be the way to go about it. It shouldn't matter that I access my server using the IP instead of host name right? I commented out the part about blocking access from non-whitelisted areas.

Generally I find it weird that my Ubuntu won't properly work with the host name I assigned to it.

When I use it to access the site or ssh into it it's not working. The whole VM seems jank.

Time to nuke the VM and start anew.

Before I do, would it be theoretically possible to store the bulk of data (so basically the images and gifs and whatever else I submit to my booru) on a network share?

I don't wanna end up with a dozens or hundreds of GBs large VM at some point. I mean if I have to that's alright, just plain backup-wise (and for cloning the VM for testing) it'd be hella nice to have a relatively small VM.

I'll go ahead and deploy normally though, would be cool to learn how I would go about doing a bit of bulk and meta/db separation. As long as it's supported at least. I don't wanna introduce too much friction. :)

And again, I cannot express how grateful I am that you guys are so patient with me.

@GlassedSilver
Copy link
Contributor Author

GlassedSilver commented Jul 2, 2019

Failbooru again after starting anew and applying some changes to the files I found in your compare that I didn't have that aren't specific to the setup...

At this point I'm just banging my head against a wall.

Maybe it's time I mention what my VM is running on:

QEMU version 3.1.0 (rev 2) patched pcie link speed and width support
Host OS: unRAID 6.7
Settings:

  • 4 cores, 4GB RAM, 50GB disk (will resize once deployment is successful and more becomes necessary)
  • machine: Q35-3.1
  • BIOS: OVMF
  • network bridge: br0

Or maybe someone could also check out my repo? Maybe I'm too blind to see a typo somewhere.

nginx is serving stuff again like /images/rails.png. So all that's broken is the link to uhm.... unicorn maybe? ponders Sorry, don't know unicorn one bit, not sure if that question even makes sense.

@r888888888
Copy link
Collaborator

If console is working, you should enable the logging for both Rails (in config/environments/production.rb:56, change to :debug), Unicorn (in config/unicorn/production.rb:21, change to a log file path), and Nginx (in /etc/nginx/sites-enabled/danbooru.conf:6, change to a log file path). Restart everything and debug.

@GlassedSilver
Copy link
Contributor Author

GlassedSilver commented Jul 28, 2019

production.log
is an empty file.

Unicorn
log is not even created.

Nginx
log seems pretty clean?

192.168.2.106 - - [28/Jul/2019:16:40:54 +0000] "GET / HTTP/1.1" 502 373 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0"
192.168.2.106 - - [28/Jul/2019:16:40:54 +0000] "GET /assets/application.css HTTP/1.1" 502 373 "http://192.168.2.192/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0"
192.168.2.106 - - [28/Jul/2019:16:40:54 +0000] "GET /favicon.ico HTTP/1.1" 200 1406 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0"
192.168.2.106 - - [28/Jul/2019:16:40:57 +0000] "GET / HTTP/1.1" 502 373 "http://192.168.2.192/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0"
192.168.2.106 - - [28/Jul/2019:16:40:57 +0000] "GET /assets/application.css HTTP/1.1" 502 373 "http://192.168.2.192/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0"

My user account's mail
is a bit wonky... I'm getting constant (every full hour) permission errors for /var/log/whenever.log (Permission denied)

Subject: Cron <danbooru@ahri-vm-danbooru> /bin/bash -l -c 'cd /var/www/danbooru/releases/20190702024442 && RAILS_ENV=production bundle exec rake maintenance:hourly --silent >> /var/log/whenever.log 2>&1'
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/danbooru>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=danbooru>
Content-Length: 52

/bin/bash: /var/log/whenever.log: Permission denied

I tried changing the permissions of that file once after touching it to even generate it....

Didn't seem to help.

Now I even went a step further on the permissions ladder and chmodded it to 777, maybe that'll fix it. I'll check after the next full hour.


I made these observations weeks ago already and didn't want to get cracking on what seems like a harder task than anticipated since I wanted to concentrate on uni in the last weeks before my holidays - now I have time for any shenanigans again haha (I expected at least valuable log messages, but I might just not have found the message yet...)

I might just consider ditching Ubuntu and trying with classic Debian? Then it's probably time to rewrite the script yet again and do a lot of fumbling around...

If it's not too much to ask for, maybe someone could generate a server image for me to drop into my server (QEMU compatible) and I can just adjust the hostname/IP by hand and see if I can rule out the VM software? Honestly I'm baffled and feel terrible for occupying you all like this. :(

@evazion
Copy link
Member

evazion commented Aug 1, 2019

@GlassedSilver try this:

cd ~/danbooru
bin/bundle install
bin/yarn install
RAILS_ENV=development bin/rails server -b 0.0.0.0 -p 9000

Then connect to http://10.0.0.1:9000 (replacing 10.0.0.1 with your VM's actual IP address).

cap production deploy is meant for automating deployment to a remote server. It does a lot of stuff you can do without for a personal booru. For personal use, it's easier to just run bin/rails server.

If it's not too much to ask for, maybe someone could generate a server image for me to drop into my server (QEMU compatible) and I can just adjust the hostname/IP by hand and see if I can rule out the VM software? Honestly I'm baffled and feel terrible for occupying you all like this. :(

There are some config files for generating a Docker image under config/docker, but there are no readymade VM images. It would be nice to have, but it's just not something that anyone has invested any time into doing.

@stale
Copy link

stale bot commented Oct 30, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 30, 2019
@stale stale bot closed this as completed Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants