pm2 time logging - can't see time, only date - datetime

Maybe someone could help, why having this configuration:
pm2 start npm --name simple-app --log-date-format "YYYY-DD-MM HH:mm:ss.SSS" -- start
I see only date of logs? I can't see exact time:
Binding this server to an open connection can result in compromising your application or
computer. Using a different host than the one passed to the "--host" flag might result in
websocket connection issues. You might need to use "--disableHostCheck" if that's the
case.2022-22-11:
2022-22-11: Warning: Running a server with --disable-host-check is a security risk. See https://medium.com/webpack/webpack-dev-server-middleware-security-issues-1489d950874a for more information.2022-22-11:
2022-22-11:
Compiling #angular/core : es2015 as esm2015
version of pm2 - 5.2.2, but I noticed the same on older version in my case.

Related

jupyterhub fails to spawn server with systemdspawner

I am trying to run jupyterhub on an Ubuntu 20.04 LTS server. My idea is to run python/jupyterhub in a conda virtual environment as a system service. As I want to be able to limit the resources available to individual users I installed the systemdspawner.
After installing everything and starting the jupyterhub service I can login through my web browser. However, when trying to start the server the spawner stucks and after a while I get an error message saying "Spawn failed: Timeout"
in journalctl I can see the following messages:
User logged in: me 302 POST /hub/login?next= -> /hub/spawn (me#::ffff:[my IP address]) 59.42ms
Adding role server to token: <APIToken('93c8...', user='me', client_id='jupyterhub')
Creating oauth client jupyterhub-user-me
pam_loginuid(login:session): Error writing /proc/self/loginuid: Operation not permitted
pam_loginuid(login:session): set_loginuid failed
pam_unix(login:session): session opened for user me by (uid=0)
Failed to open PAM session for me: [PAM Error 14] Cannot make/remove an entry for the specified session
Disabling PAM sessions from now on. user:me
Unit jupyter-me-singleuser in a failed state. Resetting state.
Disclaimer: My Jupyter/Python installation is replacing an former installation that was setup by someone else and got messed up a bit during time. I tried to remove everything related and start with a clean installation from scratch. However, as I had very little documentation about the old setup there is a certain risk that there might be some left-overs of the previous installation that may cause trouble.
Any ideas?
Solved it out myself. In the end the PAM related messages seem to be non-critical and were not related to the timeout at all. Instead I found a mistake in /etc/systemd/system/jupyterhub.service, where the PATH variable was not including the bin directory of my miniconda installation.

Grakn Error; trying to load schema for "phone calls" example

I am trying to run the example grakn migration "phone_calls" (using python and JSON files).
Before reaching there, I need to load the schema, but I am having trouble with getting the schema loaded, as shown here: https://dev.grakn.ai/docs/examples/phone-calls-schema
System:
-Mac OS 10.15
-grakn-core 1.8.3
-python 3.7.3
The grakn server is started. I checked and the 48555 TCP port is open, so I don't think there is any firewall issue. The schema file is in the same folder (phone_calls) as where the json data files is, for the next step. I am using a virtual environment. The error is below:
(project1_env) (base) tiffanytoor1#MacBook-Pro-2 onco % grakn server start
Storage is already running
Grakn Core Server is already running
(project1_env) (base) tiffanytoor1#MacBook-Pro-2 onco % grakn console --keyspace phone_calls --file phone_calls/schema.gql
Unable to create connection to Grakn instance at localhost:48555
Cause: io.grpc.StatusRuntimeException
UNKNOWN: Could not reach any contact point, make sure you've provided valid addresses (showing first 1, use getErrors() for more: Node(endPoint=/127.0.0.1:9042, hostId=null, hashCode=5f59fd46): com.datastax.oss.driver.api.core.connection.ConnectionInitException: [JanusGraph Session|control|connecting...] init query OPTIONS: error writing ). Please check server logs for the stack trace.
I would appreciate any help! Thanks!
Nevermind -- I found the solution, in case any one else runs into a similar problem. The server configuration file needs to be edited: point the data directory to your project data files (here: the phone_calls data files) & change the server IP address to your own.

undefined symbol in psycopg only when using uwsgi

I have an application built on CherryPy. I've been using the CherryPy built-in HTTP server but now want to move to uWSGI (and nginx).
On my workstation this works fine and the change was simple enough to make.
However on my test server I get the following error.
File "./validator/dbtools.py", line 3, in <module>
import psycopg2
File "/home/apiuser/API25/env/lib64/python3.5/site-packages/psycopg2/__init__.py", line 50, in <module>
from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: /home/apiuser/API25/env/lib64/python3.5/site-packages/psycopg2/_psycopg.cpython-35m-x86_64-linux-gnu.so: undefined symbol: lo_truncate64
unable to load app 0 (mountpoint='') (callable not found or import error)
The test server is different (CentOS 7 vs an Ubuntu based distribution on my workstation). When I google the error I see reports from similar errors but in different libraries. The psycopg library didn't change, in fact the two versions of the app (CherryPy / uWSGI version) runs from the same VirtualEnv. Running it as a CherryPy service works still fine.
I'm new to all of this so any help will be appreciated!
EDIT -- In response to the Question by Piotr: I star the app with a small bash script like this:
#!/bin/bash
. env/bin/activate
uwsgi --socket 127.0.0.1:8030 --protocol=http --wsgi-file wsgi.py --callable wsgiapp
Two other things I have picked up:
1. I set up a new test server running CentOs. On this new server the uwsgi app starts without the undefined symbol error. I would still like to know what causes it as a matter of learning about this.
2. Some of the API endpoints include some functions launched into background threads. Those work fine when running the app behind CherryPy's default server. When running the app using uWSGI the background threads doesn't execute but appears to get queued up. When I terminate the app (Control-C on the console) those threads suddenly run and those tasks (particularly push notifications) will go through.

inconsistent behavior in RSelenium

On Linux, the RSelenium/Selenium seems to be behaving erratically. I start the server manually and it seems to start up fine. Sometimes I am able to connect to it from my R session and other times I get an error. I cannot yet pinpoint the cause: the same script seems to work sometimes and not other times. Any ideas?
Here is the output from starting the server:
12:41:25.811 INFO - Launching a standalone server
12:41:26.102 INFO - Java: Sun Microsystems Inc. 11.0-b16
12:41:26.102 INFO - OS: Linux 2.6.32-431.17.1.el6.x86_64 amd64
12:41:26.157 INFO - v2.44.0, with Core v2.44.0. Built from revision 76d78cf
12:41:26.492 INFO - Default driver org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: registration capabilities Capabilities [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}] does not match with current platform: LINUX
12:41:26.589 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
12:41:26.589 INFO - Version Jetty/5.1.x
12:41:26.590 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
12:41:26.590 INFO - Started HttpContext[/selenium-server,/selenium-server]
12:41:26.590 INFO - Started HttpContext[/,/]
12:41:36.597 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler#2993a66f
12:41:36.598 INFO - Started HttpContext[/wd,/wd]
12:41:36.601 INFO - Started SocketListener on 0.0.0.0:4444
12:41:36.601 INFO - Started org.openqa.jetty.jetty.Server#6f507fb2
The error I receive in my R session:
Couldnt connect to host on http://localhost:4444/wd/hub.
Please ensure a Selenium server is running.Error in queryRD(paste0(serverURL, "/session"), "POST", qdata = toJSON(serverOpts))
Other times, running the exact same script everything proceeds successfully. It could be a difference of what computer node actually executes the script but I cannot tell what the problem is when it will not connect.
library(RCurl)
library(RJSONIO)
library(XML)
# running selenium
system("java -jar selenium-server-standalone-2.44.0.jar")
I faced same issue and try to run above code. Finally know that there only support 1.7 but not 1.8 as time being. You might try to download jre7 and jdk7.
I faced the same error in Mac, but I noticed that due to security settings the system does not let me to run the file with that piece of code. I downloaded the selenium standalone file and using control key I single-clicked the file and then from the menu I chose the open. Then the problem get solved.

Couchbase 2.2 - Cannot connect to console after installation

I have installed Couchbase 2.2.0 for Windows 7 64 bits. I installed it using the default options. The service gets installed and I can stop/start or restart it without errors. However, I cannot connect to the management console on port 8091.
I've found some posts on how to deal with this but they all relate to older versions of couchbase and reference files/options I can't find in version 2.2 (for example this post : Unable to connect to http://localhost:8091/index.html).
When I try netstat -an -p tcp I can't see any service listening on port 8091 so I suspect something goes wrong during startup.
Looking in the couchbase log in /var/lib/couchbase/logs I can see some errors but they don't make sense to me.
[error_logger:error,2014-02-11T17:13:16.536,babysitter_of_ns_1#127.0.0.1:error_logger<0.6.0>:ale_error_logger_handler:log_msg:76]** Generic server <0.233.0> terminating
** Last message in was {die,{abnormal,3}}
** When Server state == {state,ns_server,5000,
{1392,135189,391066},
undefined,infinity}
** Reason for termination ==
** {abnormal,3}
[ns_server:debug,2014-02-11T17:13:16.536,babysitter_of_ns_1#127.0.0.1:<0.235.0>:supervisor_cushion:init:39]starting ns_port_server with delay of 5000
[error_logger:error,2014-02-11T17:13:16.536,babysitter_of_ns_1#127.0.0.1:error_logger<0.6.0>:ale_error_logger_handler:log_report:72]
=========================CRASH REPORT=========================
crasher:
initial call: supervisor_cushion:init/1
pid: <0.233.0>
registered_name: []
exception exit: {abnormal,3}
in function gen_server:terminate/6
ancestors: [child_ns_server_sup,ns_babysitter_sup,<0.58.0>]
messages: []
links: [<0.73.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 2584
stack_size: 24
reductions: 2365
neighbours:
The windows firewall is running but, since I installed the same version of couchbase on another machine with the same Windows version without troubles I can't imagine that the firewall is causing this trouble.
I'm out of options though, I have no idea why I can't get this to work.
In the meantime, I have uninstalled 2.2 and tried falling back to 2.1 (with the same result) and moving forward to 2.5 (with the same result). In all cases I turned of antivirus software and stopped the Windows firewall to eliminate this cause.
Thanks to the nice people at Couchbase.com, the problem has been solved.
Please refer to :
https://www.couchbase.com/issues/browse/MB-10245
https://www.couchbase.com/issues/browse/MB-8760
The solution is to reinstall couchbase in a location without spaces in the path. Due to a bug, spaces in the installation path lead to trouble.

Resources