Jekyll Serve error. Browser does not display page - jekyll

After following installation steps for Jekyll I ran
jekyll serve --verbose
I then go to the browser type: 127.0.0.1:4000 (which gives me a The 127.0.0.1 page isn’t working
127.0.0.1 didn’t send any data.
ERR_EMPTY_RESPONSE)
I get the following response from the server log:
2016-09-12 00:59:27] INFO WEBrick 1.3.1
[2016-09-12 00:59:27] INFO ruby 2.2.2 (2015-04-13) [x86_64-darwin14]
[2016-09-12 00:59:27] DEBUG WEBrick::HTTPServlet::FileHandler is mounted on /.
[2016-09-12 00:59:27] DEBUG unmount .
[2016-09-12 00:59:27] DEBUG Jekyll::Commands::Serve::Servlet is mounted on .
Server address: http://127.0.0.1:4000/
[2016-09-12 00:59:27] INFO WEBrick::HTTPServer#start: pid=64929 port=4000
Server running... press ctrl-c to stop.
[2016-09-12 01:00:18] DEBUG accept: 127.0.0.1:56926
[2016-09-12 01:00:18] DEBUG accept: 127.0.0.1:56927
[2016-09-12 01:00:19] DEBUG Jekyll::Commands::Serve::Servlet is invoked.
[2016-09-12 01:00:40] DEBUG close: 127.0.0.1:56927
[2016-09-12 01:00:49] DEBUG close: 127.0.0.1:56926
[2016-09-12 01:00:51] DEBUG accept: 127.0.0.1:56984
[2016-09-12 01:00:51] DEBUG Jekyll::Commands::Serve::Servlet is invoked.
[2016-09-12 01:01:21] DEBUG close: 127.0.0.1:56984
[2016-09-12 01:09:44] DEBUG accept: 127.0.0.1:57192
[2016-09-12 01:09:44] DEBUG Jekyll::Commands::Serve::Servlet is invoked.
Any opinions, ideas ?

Related

Running fastapi app using uvicorn on ubuntu server

I am dealing with the project deposition made on FastAPI to a remote ubuntu server. I'll try to run the project from terminal (using SSH connection) by the command
gunicorn -k uvicorn.workers.UvicornWorker main:app
The output is
gunicorn -k uvicorn.workers.UvicornWorker main:app
[2020-07-14 15:24:28 +0000] [23102] [INFO] Starting gunicorn 20.0.4
[2020-07-14 15:24:28 +0000] [23102] [INFO] Listening at: http://127.0.0.1:8000 (23102)
[2020-07-14 15:24:28 +0000] [23102] [INFO] Using worker: uvicorn.workers.UvicornWorker
[2020-07-14 15:24:28 +0000] [23104] [INFO] Booting worker with pid: 23104
[2020-07-14 15:24:28 +0000] [23104] [INFO] Started server process [23104]
[2020-07-14 15:24:28 +0000] [23104] [INFO] Waiting for application startup.
[2020-07-14 15:24:28 +0000] [23104] [INFO] Application startup complete.
But I need the project to be available at the IP address of the server. If I try smth like
uvicorn main:app --host 66.226.247.55 --port 8000
I get
INFO: Started server process [23308]
INFO: Waiting for application startup.
INFO: Connected to database postgresql://recognition:********#localhost:5432/reco
INFO: Application startup complete.
ERROR: [Errno 99] error while attempting to bind on address ('66.226.247.55', 8000): cannot assign requested address
INFO: Waiting for application shutdown.
INFO: Disconnected from database postgresql://recognition:********#localhost:5432/reco
INFO: Application shutdown complete.
Where 66.226.247.55 - external IP adress from google cloud platform instances
How do I start a project so that it can be accessed via IP?
The --host should be the local address of your GCP server.
uvicorn main:app --host 0.0.0.0 --port 8000
and now access the application by http://66.226.247.55:8000
Note: You should open your 8000 port of GCP server.
If you're using nginx server
create a file in /etc/nginx/sites-enabled/
create file touch fastapi_nginx
copy code into file and adjust accordingly
server{
listen 80;
server_name "your public ip";
location / {
proxy_pass http://127.0.0.1:8000; #localhost
}
}
This should reroute to your public ip
You cannot launch your fast api app on your local to your remote server in GCP.
You must deploy your app to GCP. In other words you need to run that command on a remote server not your localhost.

Cannot run github pages locally

I'm trying to run a basic GitHub page locally on macOS.
Here is my Gemfile:
$cat Gemfile
source 'https://rubygems.org'
gem 'github-pages', group: :jekyll_plugins
Then I install the dependencies:
$bundle install --path vendor/bundle
As a result, it installs Jekyll 3.8.5.
But when I build the site with bundle exec jekyll build --verbose I get the next error:
Logging at level: debug
Configuration file: /Users/user/personal/my_user_name.github.io/_config.yml
Theme: jekyll-theme-midnight
Theme source: /Users/user/personal/my_user_name.github.io/vendor/bundle/ruby/2.6.0/gems/jekyll-theme-midnight-0.1.1
Invalid theme folder: _includes
GitHub Pages: github-pages v203
GitHub Pages: jekyll v3.8.5
Theme: jekyll-theme-midnight
Theme source: /Users/user/personal/my_user_name.github.io/vendor/bundle/ruby/2.6.0/gems/jekyll-theme-midnight-0.1.1
Invalid theme folder: _includes
Requiring: jekyll-seo-tag
Requiring: jekyll-coffeescript
Requiring: jekyll-commonmark-ghpages
Requiring: jekyll-gist
jekyll 3.8.5 | Error: uninitialized constant Faraday::Error::ClientError
Did you mean? Faraday::ClientError
My machine details:
$sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.2
BuildVersion: 19C57
How can I fix the issue?
P.S.
If I create a jekyll directory from scratch with
$jekyll new myblog
$cd myblog
$jekyll serve
It runs correctly. The only difference I see is that it uses Jekyll 4.0.0
UPDATE:
I have changed the Gemfile to this:
$cat Gemfile
source 'https://rubygems.org'
#gem 'github-pages', group: :jekyll_plugins
gem 'github-pages'
After I run bundle exec jekyll serve --verbose I see:
Logging at level: debug
Configuration file: /Users/user/personal/my_user_name.github.io/_config.yml
Logging at level: debug
Theme: jekyll-theme-midnight
Theme source: /Users/user/personal/my_user_name.github.io/vendor/bundle/ruby/2.6.0/gems/jekyll-theme-midnight-0.1.1
Invalid theme folder: _includes
Requiring: jekyll-seo-tag
Source: /Users/user/personal/my_user_name.github.io
Destination: /Users/user/personal/my_user_name.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating...
EntryFilter: excluded /Gemfile
EntryFilter: excluded /Gemfile.lock
EntryFilter: excluded /vendor/bundle/ruby
Rendering: assets/css/style.scss
Pre-Render Hooks: assets/css/style.scss
Rendering Markup: assets/css/style.scss
Writing: /Users/user/personal/my_user_name.github.io/_site/assets/css/style.css
done in 0.099 seconds.
Requiring: jekyll-watch
Watcher: Ignoring (?-mix:^_config\.yml)
Watcher: Ignoring (?-mix:^_site\/)
Watcher: Ignoring (?-mix:^Gemfile)
Watcher: Ignoring (?-mix:^Gemfile\.lock)
Watcher: Ignoring (?-mix:^vendor\/bundle\/)
Auto-regeneration: enabled for '/Users/user/personal/my_user_name.github.io'
[2020-01-01 17:52:58] INFO WEBrick 1.4.2
[2020-01-01 17:52:58] INFO ruby 2.6.5 (2019-10-01) [x86_64-darwin19]
[2020-01-01 17:52:58] DEBUG WEBrick::HTTPServlet::FileHandler is mounted on /.
[2020-01-01 17:52:58] DEBUG unmount .
[2020-01-01 17:52:58] DEBUG Jekyll::Commands::Serve::Servlet is mounted on .
Server address: http://127.0.0.1:4000
[2020-01-01 17:52:58] INFO WEBrick::HTTPServer#start: pid=65841 port=4000
Server running... press ctrl-c to stop.
[2020-01-01 17:53:27] DEBUG accept: 127.0.0.1:53546
[2020-01-01 17:53:27] DEBUG accept: 127.0.0.1:53547
[2020-01-01 17:53:27] DEBUG Jekyll::Commands::Serve::Servlet is invoked.
[2020-01-01 17:53:30] DEBUG Jekyll::Commands::Serve::Servlet is invoked.
[2020-01-01 17:53:31] DEBUG Jekyll::Commands::Serve::Servlet is invoked.
[2020-01-01 17:53:34] DEBUG Jekyll::Commands::Serve::Servlet is invoked.
[2020-01-01 17:53:35] DEBUG Jekyll::Commands::Serve::Servlet is invoked.
[2020-01-01 17:53:42] DEBUG close: 127.0.0.1:53547
^C[2020-01-01 17:53:55] DEBUG close TCPSocket(127.0.0.1, 4000)
[2020-01-01 17:53:55] INFO going to shutdown ...
[2020-01-01 17:53:56] DEBUG close: 127.0.0.1:53546
[2020-01-01 17:53:56] INFO WEBrick::HTTPServer#start done.
But when I open it in browser I see just a list of directories but not the blog
It looks due to the latest update of faraday - a gem depended by github-pages.
Try this workaround temporarily.
Add the following line to your Gemfile.
gem 'faraday', '~> 0'
Use command bundle update to update the gem(s) with Gemfile.
You may see outputs below:
Fetching faraday 0.17.3 (was 1.0.0)
Installing faraday 0.17.3 (was 1.0.0)
That means gem faraday in ./vendor/bundle has been updated to the latest compatible version with the github-pages.
You can check the version history of faraday at this page on rubygems.org.
Try bundle exec jekyll again.
If it doesn't work yet, try bundle pristine.

java.net.socketTimeout.Exception:Read Timed Out

Even after successfully connecting to host I am getting the following error:
.............................................................................
DEBUG: setDebug: JavaMail version 1.5.5
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle]
DEBUG SMTP: need username and password for authentication
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "smtp.mail.yahoo.com", port 587, isSSL false
220 smtp.mail.yahoo.com ESMTP ready
DEBUG SMTP: connected to host "smtp.mail.yahoo.com", port: 587
DEBUG SMTP: exception reading response, THROW:
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:124)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:92)
at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:2331)
at com.sun.mail.smtp.SMTPTransport.ehlo(SMTPTransport.java:1620)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:703)
................................................................................
I am using javamail 1.5.5 jar. I took the code from github https://github.com/FoulerBenny/SampleProject/blob/master/src/main/java/com/genericLibraries/EmailAttachmentSender.java
My intent is to use SSL but first of all trying this way as SSL was taking too long to respond
.

baasbox on openshift error 503

I have a small problem, i'am trying to install the mbaas "baasbox" on openshift and i'am getting 503 page, what does it could be??
here is the tutorial that i followed here
the rhc tail give me
[2014-04-11 01:13:50] INFO WEBrick 1.3.1
[2014-04-11 01:13:50] INFO ruby 1.8.7 (2011-06-30) [x86_64-linux]
[2014-04-11 01:13:50] INFO WEBrick::HTTPServer#start: pid=398035 port=8080
127.8.255.129 - - [11/Apr/2014:01:14:27 EDT] "GET / HTTP/1.1" 200 39915
-> / 127.8.255.129 - - [11/Apr/2014:01:54:06 EDT] "GET / HTTP/1.1" 304 0
-> / [2014-04-11 01:57:39] INFO going to shutdown ... [2014-04-11 01:57:39] INFO WEBrick::HTTPServer#start done.
and here is the content of the start file
BASEDIR=$(dirname $0)
$BASEDIR/stop
rm $OPENSHIFT_REPO_DIR/bin/RUNNING_PID
nohup java -Dorient.baasbox.path=$OPENSHIFT_DATA_DIR/baasbox -Dorient.baasbox.admin_password=admin -Dapplication.code=1234567890 -Dhttp.port=$OPENSHIFT_DIY_PORT -Dhttp.address=$OPENSHIFT_DIY_IP $* -cp "$OPENSHIFT_REPO_DIR/bin/lib/*" play.core.server.NettyServer $OPENSHIFT_REPO_DIR/bin $OPENSHIFT_DIY_LOG_DIR/baasbox.log > $OPENSHIFT_DIY_LOG_DIR/nohup.log 2>&1 &
there was a problem in the baasbox start file.
here is the complete issue https://github.com/baasbox/baasbox/issues/303
the start file was updated in the baasbox repo, this is the new one.
BASEDIR=$(dirname $0)
$BASEDIR/stop
rm $OPENSHIFT_REPO_DIR/bin/RUNNING_PID
nohup java -Dorient.baasbox.path=$OPENSHIFT_DATA_DIR/baasbox -Dorient.baasbox.admin_password=admin -Dapplication.code=1234567890 -Dhttp.port=$OPENSHIFT_DIY_PORT -Dhttp.address=$OPENSHIFT_DIY_IP $* -cp "$OPENSHIFT_REPO_DIR/bin/lib/*" play.core.server.NettyServer $OPENSHIFT_REPO_DIR/bin $OPENSHIFT_DIY_LOG_DIR/baasbox.log &

unknown error: Chrome failed to start: exited abnormally (Driver info: chromedriver=2.8.undefined

When running selenium test from jenkins, I get this error:
org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.8.undefined,platform=Linux 3.13-1-686-pae x86) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 20.54 seconds
Build info: version: '2.33.0', revision: '4ecaf82108b2a6cc6f006aae81961236eba93358', time: '2013-05-22 12:00:17'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '3.13-1-686-pae', java.version: '1.6.0_45'
Driver info: org.openqa.selenium.chrome.ChromeDriver
and further in the stack trace:
DEBUG - Sending request: POST /session HTTP/1.1DEBUG - >> "POST /session HTTP/1.1[\r][\n]"DEBUG - >> "Accept: application/json, image/png[\r][\n]"DEBUG - >> "Content-Type: application/json; charset=utf-8[\r][\n]"DEBUG - >> "Content-Length: 143[\r][\n]"DEBUG - >> "Host: localhost:30992[\r][\n]"DEBUG - >> "Connection: Keep-Alive[\r][\n]"DEBUG - >> "[\r][\n]"DEBUG - >> POST /session HTTP/1.1DEBUG - >> Accept: application/json, image/pngDEBUG - >> Content-Type: application/json; charset=utf-8DEBUG - >> Content-Length: 143DEBUG - >> Host: localhost:30992DEBUG - >> Connection: Keep-AliveDEBUG - >> "{"desiredCapabilities":{"platform":"ANY","browserName":"chrome","chromeOptions":{"args":[],"extensions":[]},"version":"","chrome.switches":[]}}"DEBUG - << "HTTP/1.1 200 OK[\r][\n]"DEBUG - << "Content-Length:218[\r][\n]"DEBUG - << "Content-Type:application/json; charset=utf-8[\r][\n]"DEBUG - << "Connection:close[\r][\n]"DEBUG - << "[\r][\n]"DEBUG - Receiving response: HTTP/1.1 200 OKDEBUG - << HTTP/1.1 200 OKDEBUG - << Content-Length:218DEBUG - << Content-Type:application/json; charset=utf-8DEBUG - << Connection:closeDEBUG - << "{"sessionId":"a272d037ff7f0bff2cfb2a49e052c02a","status":13,"value":{"message":"unknown error: Chrome failed to start: exited abnormally\n (Driver info: chromedriver=2.8.undefined,platform=Linux 3.13-1-686-pae x86)"}}"DEBUG - Connection shut down
I am not using selenium grid.
The strange thing is that I am able to launch chrome when sending commands to chromedriver directly as in the following command:
curl -X POST -H "Content-Type: application/json; charset=utf-8" -d "{\"desiredCapabilities\":{\"platform\":\"ANY\",\"browserName\":\"chrome\",\"chromeOptions\":{\"args\":[],\"extensions\":[]},\"version\":\"\",\"chrome.switches\":[]}}" localhost:9515/session
A Chromimum window opens here.
I am using Debian jessie (testing) with chromimum and chromedriver installed with aptitude. This is to get homogeneous versions.
$ google-chrome -version
Chromium 33.0.1750.152 Debian jessie/sid
./chromedriver -v
Starting ChromeDriver (v2.8.undefined) on port 9515
I have also created an other issue with a previous version of Debian, you could read to know more what I tried before. unknown error: Chrome failed to start: exited abnormally (Driver info: chromedriver=2.9
At least on a linux machine, I think chrome needs an X11 display in order to start up. You can provide that as a regular display (when you run it as a normal user on a desktop environment), as a connection through a network to a normal remote or local display (e.g. through vnc server) or through a virtual apparatus like X virtual framebuffer.
For your purposes (testing) I'd say that Xvfb is probably the best option. See here for an example using it for testing.