how can I add firebase to pwa project - firebase

I am new in pwa.I want to use firebase on my project. I use these commands to init firebase :
npm install -g firebase-tools
firebase login
firebase init
but firebase init not show my projects!!
Error: Failed to list Firebase projects. See firebase-debug.log for more info.
and this is firebase-debug-log file
You're about to initialize a Firebase project in this directory:
E:\pwa\pwagram
[info]
=== Project Setup
[info]
[info] First, let's associate this project directory with a Firebase project.
[info] You can create multiple project aliases by running firebase use --add,
[info] but for now we'll just set up a default project.
[info]
[debug] [2020-04-10T07:10:34.248Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects?pageSize=100
[debug] [2020-04-10T07:10:34.840Z] <<< HTTP RESPONSE 403 {"content-type":"text/html; charset=UTF-8","referrer-policy":"no-referrer","content-length":"1595","date":"Fri, 10 Apr 2020 07:10:34 GMT","alt-svc":"quic=\":443\"; ma=2592000; v=\"46,43\",h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000"}
[debug] [2020-04-10T07:10:34.840Z] <<< HTTP RESPONSE BODY <!DOCTYPE html>
<html lang=en>
<meta charset=utf-8>
<meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
<title>Error 403 (Forbidden)!!1</title>
<style>
*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}#media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}#media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}#media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
</style>
<a href=//www.google.com/><span id=logo aria-label=Google></span></a>
<p><b>403.</b> <ins>That’s an error.</ins>
<p>Your client does not have permission to get URL <code>/v1beta1/projects</code> from this server. <ins>That’s all we know.</ins>
[debug] [2020-04-10T07:10:34.841Z] HTTP Error: 403, Unknown Error
[debug] [2020-04-10T07:10:35.437Z] FirebaseError: HTTP Error: 403, Unknown Error
at module.exports (C:\Users\PZHR.DESKTOP-9L7JS1Q\AppData\Roaming\npm\node_modules\firebase-tools\lib\responseToError.js:38:12)
at Request._callback (C:\Users\PZHR.DESKTOP-9L7JS1Q\AppData\Roaming\npm\node_modules\firebase-tools\lib\api.js:40:35)
at Request.self.callback (C:\Users\PZHR.DESKTOP-9L7JS1Q\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\request\request.js:185:22)
at Request.emit (events.js:310:20)
at Request.EventEmitter.emit (domain.js:482:12)
at Request.<anonymous> (C:\Users\PZHR.DESKTOP-9L7JS1Q\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\request\request.js:1154:10)
at Request.emit (events.js:310:20)
at Request.EventEmitter.emit (domain.js:482:12)
at IncomingMessage.<anonymous> (C:\Users\PZHR.DESKTOP-9L7JS1Q\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\request\request.js:1076:12)
at Object.onceWrapper (events.js:416:28)
at IncomingMessage.emit (events.js:322:22)
at IncomingMessage.EventEmitter.emit (domain.js:482:12)
at endReadableNT (_stream_readable.js:1187:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
[error]
[error] Error: Failed to list Firebase projects. See firebase-debug.log for more info.
whats wrong with me?

First you need to create a firebase project at https://console.firebase.google.com/
then you will get credentials for that app
then install npm package for firebase -
npm i firebase
then use below lines to initialise firebase in your app
import * as firebase from 'firebase';
const config = {
apiKey: "ENTER YOURS HERE",
authDomain: "ENTER YOURS HERE",
databaseURL: "ENTER YOURS HERE",
projectId: "ENTER YOURS HERE",
storageBucket: "ENTER YOURS HERE",
messagingSenderId: "ENTER YOURS HERE"
}
firebase.initializeApp(config);
you need not to add global configuration for firebase or any cli commands;
for more just follow - https://firebase.google.com/docs/web/setup

Related

Error when deploying to AWS lambda, yarn serverless nextjs monorepo

I currently have a monorepo setup with serverless and it builds alright, when I try a custom deploy script, I get the following error
DEBUG ─ Executing the template's components graph.
error:
Error: Command failed with ENOENT: node_modules/.bin/next build
spawn node_modules/.bin/next ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
at onErrorNT (internal/child_process.js:470:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn node_modules/.bin/next',
path: 'node_modules/.bin/next',
spawnargs: [ 'build' ],
originalMessage: 'spawn node_modules/.bin/next ENOENT',
shortMessage: 'Command failed with ENOENT: node_modules/.bin/next build\n' +
'spawn node_modules/.bin/next ENOENT',
command: 'node_modules/.bin/next build',
escapedCommand: '"node_modules/.bin/next" build',
exitCode: undefined,
signal: undefined,
signalDescription: undefined,
stdout: '',
stderr: '',
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}
4s › web › Error: Command failed with ENOENT: node_modules/.bin/next build
spawn node_modules/.bin/next ENOENT
I tried to set next.config.js with
const nextConfig = {
experimental: {
externalDir: true,
},
};
export default nextConfig;
Still the error persist.
my deploy script is "deploy": "AWS_SDK_LOAD_CONFIG=1 AWS_PROFILE=projec1 yarn components-v1 --debug"

SequelizeConnectionRefusedError - Trying to access my deployed web app with Firebase/Google Cloud SQL

I set-up a web app with Firebase and Google Cloud SQL but I always get the same error. Can you help me?
{ SequelizeConnectionRefusedError: connect ECONNREFUSED /cloudsql/pet-hotel-275016:us-central1:pet-hotel/.s.PGSQL.5432
at connection.connect.err (/srv/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:116:24)
at Connection.connectingErrorHandler (/srv/node_modules/pg/lib/client.js:140:14)
at emitOne (events.js:116:13)
at Connection.emit (events.js:211:7)
at Socket.reportStreamError (/srv/node_modules/pg/lib/connection.js:71:10)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:66:8)
at _combinedTickCallback (internal/process/next_tick.js:139:11)
at process._tickDomainCallback (internal/process/next_tick.js:219:9)
message: 'connect ECONNREFUSED /cloudsql/pet-hotel-275016:us-central1:pet-hotel/.s.PGSQL.5432',
locations: [ { line: 2, column: 3 } ],
path: [ 'settingsFind' ] }
Here's what the console looks like
Console looks like this

Oracle PGX on Yarn - 404 on WebService

I'm running Yarn on Oracle BDA X7-2, specs:
Cloudera Enterprise 5.14.3
Java 1.8.0_171
PGX 2.7.1
I'm trying to run PGX on Yarn following this manual:
https://docs.oracle.com/cd/E56133_01/2.5.0/tutorials/yarn.html
Managed to run the installation script, completed the config file provided by it with the following:
{
"pgx_yarn_jar_hdfs_path": "hdfs:/user/pgx/pgx-yarn-2.7.1.jar",
"pgx_war_hdfs_path": "hdfs:/user/pgx/pgx-webapp-2.7.1.war",
"pgx_conf_hdfs_path": "hdfs:/user/pgx/pgx.conf",
"pgx_log4j_conf_hdfs_path": "hdfs:/user/pgx/log4j2.xml",
"pgx_dist_log4j_conf_hdfs_path": "hdfs:/user/pgx/dist_log4j.xml",
"pgx_cluster_host_hdfs_path": "hdfs:/user/pgx/cluster-host.tgz",
"zookeeper_connect_string": "bda1node05,bda1node06,bda1node07",
"standard_library_path": "/usr/lib64/gcc/4.8.2",
"min_heap_size": "512m",
"max_heap_size": "12g",
"container_cores": 9,
"container_memory": 0,
"container_priority": 0,
"num_machines": 1
}
Yarn has a pgx-service application in RUNNING state, no errors in stderr, the log shows me the service is running in the address:
http://bda1node06:7007
And the linux Java process is running with the following command:
/usr/java/default/bin/java -Xms512m -Xmx12g oracle.pgx.yarn.PgxService bda1node06 /u11/hadoop/yarn/nm/usercache/root/appcache/application_1539869144089_2070/container_e22_1539869144089_2070_01_000002/pgx-server.war 7007 bda1node05,bda1node06,bda1node07 /pgx-8eef44e2-1657-403a-8193-0102f5266680
And after the execution of the PGX client for testing purposes:
$PGX_HOME/bin/pgx --base_url http://bda1node06:7007
I get:
java.util.concurrent.ExecutionException: java.lang.IllegalStateException: cannot connect to server; requested http://bda1node06:7007/version?extendedInfo=true and expected status 200, got 404 instead; response body = ""
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
at oracle.pgx.api.PgxFuture.get(PgxFuture.java:99)
at oracle.pgx.api.ServerInstance.createSession(ServerInstance.java:559)
at oracle.pgx.shell.Console.initSession(Console.java:280)
at oracle.pgx.shell.Console.(Console.java:153)
at oracle.pgx.shell.Console.main(Console.java:296)
Caused by: java.lang.IllegalStateException: cannot connect to server; requested http://bda1node06:7007/version?extendedInfo=true and expected status 200, got 404 instead; response body = ""
at oracle.pgx.api.ClientApiProvider.lambda$versionCheck$2(ClientApiProvider.java:189)
at oracle.pgx.client.RemoteUtils.lambda$asyncRequest$5(RemoteUtils.java:278)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
I have no idea of how to debug and check if there's any extra path needed in the connection URL.
How may I proceed to debug?
Thanks in advance!
By default, PGX has a base path of /pgx, which means you should connect as follows:
$PGX_HOME/bin/pgx --base_url http://bda1node06:7007/pgx
I'll do a little follow up here.
We've managed to start a pgx server and manipulate hbase graph! :D
PGX "Hello World"
We wrote a small code to insert vertices, edgex, instantiate pgx and run a simple example, this is it:
cfg = GraphConfigBuilder.forPropertyGraphHbase().setName('sinapse').setZkQuorum('bda1node05').build()
opg = OraclePropertyGraph.getInstance(cfg)
​
a = opg.addVertex()
a.setProperty('nome', 'Felipe')
​
b = opg.addVertex()
b.setProperty('nome', 'Rhenan')
​
c = opg.addVertex()
c.setProperty('nome', 'Hugo')
​
opg.addEdge(a, b, 'Pai de')
opg.addEdge(b, c, 'Pai de')
opg.addEdge(a, c, 'Avo de')
opg.commit()
​
session = Pgx.createSession('sinapsepgx')
analyst = session.createAnalyst()
pgxGraph = session.readGraphWithProperties(opg.getConfig(), true)
analyst.countTriangles(pgxGraph, true)
And that worked just fine!
Client - Server architecture
The next step, we moved to a client/server mode, starting the start-server script.
We managed to do that just fine too!
This is our config files:
server.conf
{
"port": 7007,
"enable_tls": false,
"enable_client_authentication": false
}
pgx.conf
{
"allow_idle_timeout_overwrite": true,
"allow_local_filesystem": false,
"allow_task_timeout_overwrite": true,
"enable_gm_compiler": true,
"enterprise_scheduler_config": {
"analysis_task_config": {
"priority": "MEDIUM",
"weight": 12,
"max_threads": 12
},
"fast_analysis_task_config": {
"priority": "HIGH",
"weight": 1,
"max_threads": 12
},
"num_io_threads_per_task": 12
},
"preload_graphs": [
{"path": "graphs/sinapse_conf.json",
"name": "sinapse"}
],
"max_active_sessions": 1024,
"max_queue_size_per_session": -1,
"max_snapshot_count": 0,
"memory_cleanup_interval": 600,
"path_to_gm_compiler": null,
"release_memory_threshold": 0.85,
"session_idle_timeout_secs": 0,
"session_task_timeout_secs": 0,
"strict_mode": true,
"tmp_dir": "/tmp"
}
sinapse_conf.json
{
"edge_props": [
{
"name": "relacao",
"type": "string"
}
],
"db_engine": "HBASE",
"vertex_props": [
{
"name": "nome",
"type": "string"
},
{
"name": "cpf",
"type": "string"
}
],
"format": "pg",
"name": "sinapse",
"error_handling": {},
"vertex_id_type": "long",
"attributes": {},
"loading": {},
"zk_quorum": "bda1node05,bda1node06,bda1node07"
}
start-script ran just fine with that, preloaded our hbase graph, works like a charm.
Connected to the server using the pgx client:
./bin/pgx -b http://localhost:7007
And managed to do the same we did in the groovy shell.
That's awesome.
PGX on Yarn
Well, now we are back in our challenge: run and manage PGX on Yarn.
We've copied our pgx.conf file to the hdfs, like this:
hdfs://user/pgx/pgx.conf
{
"allow_idle_timeout_overwrite": true,
"allow_local_filesystem": false,
"allow_task_timeout_overwrite": true,
"enable_gm_compiler": true,
"enterprise_scheduler_config": {
"analysis_task_config": {
"priority": "MEDIUM",
"weight": 12,
"max_threads": 12
},
"fast_analysis_task_config": {
"priority": "HIGH",
"weight": 1,
"max_threads": 12
},
"num_io_threads_per_task": 12
},
"preload_graphs": [
{"path": "graphs/sinapse_conf.json",
"name": "sinapse"}
],
"max_active_sessions": 1024,
"max_queue_size_per_session": -1,
"max_snapshot_count": 0,
"memory_cleanup_interval": 600,
"path_to_gm_compiler": null,
"release_memory_threshold": 0.85,
"session_idle_timeout_secs": 0,
"session_task_timeout_secs": 0,
"strict_mode": true,
"tmp_dir": "/tmp"
}
/opt/oracle/oracle-spatial-graph/property_graph/pgx/yarn/conf/yarn.conf
{
"pgx_yarn_jar_hdfs_path": "hdfs://mpmapas-ns/user/pgx/pgx-yarn-2.7.1.jar",
"pgx_war_hdfs_path": "hdfs://mpmapas-ns/user/pgx/pgx-webapp-2.7.1.war",
"pgx_conf_hdfs_path": "hdfs://mpmapas-ns/user/pgx/pgx.conf",
"pgx_log4j_conf_hdfs_path": "hdfs://mpmapas-ns/user/pgx/log4j2.xml",
"pgx_dist_log4j_conf_hdfs_path": "hdfs://mpmapas-ns/user/pgx/dist_log4j.xml",
"pgx_cluster_host_hdfs_path": "hdfs://mpmapas-ns/user/pgx/cluster-host.tgz",
"zookeeper_connect_string": "bda1node05.pgj.rj.gov.br,bda1node06.pgj.rj.gov.br,bda1node07.pgj.rj.gov.br",
"standard_library_path": "/usr/lib64/gcc/4.8.2",
"min_heap_size": "512m",
"max_heap_size": "12g",
"container_cores": 9,
"container_memory": 0,
"container_priority": 0,
"num_machines": 1
}
Also, #albert recomended us to remove the log4j2.xml from the server/shared-mem/pgx-webapp-2.7.1.war file so we may handle log4j logging using only the file placed on our hdfs folder.
So we've unpacked, removed, repacked the war file, edited the log4j2.xml file on hdfs like this:
hdfs://user/pgx/log4j2.xml
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss,SSS} %p %C{1} - %m%n"/>
</Console>
<File name="LogFile" fileName="file:/tmp/pg_trace.log">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
</File>
</Appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="LogFile"/>
</Root>
<Logger name="oracle.pgx.engine.admin.Ctrl" level="debug">
<AppenderRef ref="LogFile"/>
</Logger>
<Logger name="pgx.dist.cluster_host" level="debug">
<AppenderRef ref="LogFile"/>
</Logger>
</Loggers>
</Configuration>
And finally ran the yarn start server command, just like this:
yarn jar yarn/pgx-yarn-2.7.1.jar yarn/conf/yarn.conf
And we get the bottom of the logfile that seems realy nice!:
18/12/11 16:25:03 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/tmp
18/12/11 16:25:03 INFO zookeeper.ZooKeeper: Client environment:java.compiler=<NA>
18/12/11 16:25:03 INFO zookeeper.ZooKeeper: Client environment:os.name=Linux
18/12/11 16:25:03 INFO zookeeper.ZooKeeper: Client environment:os.arch=amd64
18/12/11 16:25:03 INFO zookeeper.ZooKeeper: Client environment:os.version=4.1.12-124.14.1.el7uek.x86_64
18/12/11 16:25:03 INFO zookeeper.ZooKeeper: Client environment:user.name=root
18/12/11 16:25:03 INFO zookeeper.ZooKeeper: Client environment:user.home=/root
18/12/11 16:25:03 INFO zookeeper.ZooKeeper: Client environment:user.dir=/opt/oracle/oracle-spatial-graph/property_graph/pgx
18/12/11 16:25:03 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=bda1node05.pgj.rj.gov.br,bda1node06.pgj.rj.gov.br,bda1node07.pgj.rj.gov.br sessionTimeout=10000 watcher=oracle.pgx.yarn.ClientZkClient#32da97fd
18/12/11 16:25:03 INFO zookeeper.ClientCnxn: Opening socket connection to server bda1node07.pgj.rj.gov.br/192.168.8.7:2181. Will not attempt to authenticate using SASL (unknown error)
18/12/11 16:25:03 INFO zookeeper.ClientCnxn: Socket connection established, initiating session, client: /192.168.8.5:33299, server: bda1node07.pgj.rj.gov.br/192.168.8.7:2181
18/12/11 16:25:03 INFO zookeeper.ClientCnxn: Session establishment complete on server bda1node07.pgj.rj.gov.br/192.168.8.7:2181, sessionid = 0x3668759ae4553df, negotiated timeout = 10000
18/12/11 16:25:05 INFO yarn.StartService: waiting for PGX service (yarn appId == 'application_1539869144089_2555') to come up ...
18/12/11 16:25:10 INFO yarn.StartService: retrieved PGX host: http://bda1node07.pgj.rj.gov.br:7007
18/12/11 16:25:10 INFO yarn.StartService: to connect a remote shell to this host, run '$PGX_HOME/bin/pgx --base_url http://bda1node07.pgj.rj.gov.br:7007'
18/12/11 16:25:10 INFO yarn.StartService: to shut the PGX service down, run 'yarn application -kill application_1539869144089_2555'
18/12/11 16:25:10 INFO zookeeper.ZooKeeper: Session: 0x3668759ae4553df closed
18/12/11 16:25:10 INFO zookeeper.ClientCnxn: EventThread shut down
But connecting to it still returns 404 ;(
The last intel I may give you is the yarn stderr log, wich also informs that we are not using log4j correctly:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/cloudera/parcels/CDH-5.14.2-1.cdh5.14.2.p0.3/jars/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/u09/hadoop/yarn/nm/filecache/890/pgx-yarn-2.7.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'log4j2.debug' to show Log4j2 internal initialization logging.
18/12/11 16:25:06 INFO yarn.AppMaster: register app
18/12/11 16:25:06 INFO yarn.AppMaster: RM response = [queue=root.users.root,maxCap=<memory:65536, vCores:9>]
18/12/11 16:25:06 INFO yarn.AppMaster: max capability of cluster: <memory:65536, vCores:9>
18/12/11 16:25:06 INFO yarn.AppMaster: attempting to allocate 1 containers
18/12/11 16:25:06 INFO yarn.AppMaster: attempt 1: got 0 containers. Available: <memory:194560, vCores:180>
18/12/11 16:25:06 INFO yarn.AppMaster: attempt 2: got 0 containers. Available: <memory:194560, vCores:180>
18/12/11 16:25:06 INFO yarn.AppMaster: attempt 3: got 1 containers. Available: <memory:129024, vCores:171>
18/12/11 16:25:06 INFO yarn.AppMaster: copy hdfs://mpmapas-ns/user/pgx/pgx-yarn-2.7.1.jar into pgx-yarn.jar
18/12/11 16:25:06 INFO yarn.AppMaster: copy hdfs://mpmapas-ns/user/pgx/pgx-webapp-2.7.1.war into pgx-server.war
18/12/11 16:25:06 INFO yarn.AppMaster: copy hdfs://mpmapas-ns/user/pgx/pgx.conf into conf/pgx.conf
18/12/11 16:25:06 INFO yarn.AppMaster: copy hdfs://mpmapas-ns/user/pgx/log4j2.xml into conf/log4j2.xml
18/12/11 16:25:07 INFO yarn.AppMaster: server env = {CLASSPATH=conf:pgx-server/WEB-INF/lib/*:pgx-yarn.jar:$HADOOP_CONF_DIR}
18/12/11 16:25:07 INFO yarn.AppMaster: server command = $JAVA_HOME/bin/java -Xms512m -Xmx12g oracle.pgx.yarn.PgxService bda1node07.pgj.rj.gov.br $PWD/pgx-server.war 7007 bda1node05.pgj.rj.gov.br,bda1node06.pgj.rj.gov.br,bda1node07.pgj.rj.gov.br /pgx-37a121ce-e028-432c-8761-104027126c3b 1><LOG_DIR>/stdout 2><LOG_DIR>/stderr;
18/12/11 16:25:07 INFO yarn.AppMaster: check for completion
18/12/11 16:25:08 INFO yarn.AppMaster: check for completion
18/12/11 16:25:08 INFO yarn.AppMaster: check for completion
18/12/11 16:25:09 INFO yarn.AppMaster: check for completion
18/12/11 16:25:09 INFO yarn.AppMaster: check for completion
18/12/11 16:25:10 INFO yarn.AppMaster: check for completion
18/12/11 16:25:10 INFO yarn.AppMaster: check for completion
18/12/11 16:25:11 INFO yarn.AppMaster: check for completion
18/12/11 16:25:11 INFO yarn.AppMaster: check for completion
18/12/11 16:25:12 INFO yarn.AppMaster: check for completion
.
.
.
This is the farthest we've managed to go.
We can start our work now! That's realy exciting.
Now I know how to properly start a service, preload, insert, manage data, and we will import our existing graph database to it and do some experimentation.
Would be lovely to have this running on Yarn at the production level.
Thank you all for the extreme dedication and attention.

Firebase Cloud Function Error To Generate Thumbnail: spawn convert ENOENT

The cloud function was working good before updating it. This is the code where the error occurs now:
return spawn('convert' ,[tempLocalFile, '-thumbnail', `${THUMB_MAX_WIDTH}x${THUMB_MAX_HEIGHT}`, tempLocalThumbFile], {capture: ['stdout', 'stderr']});
Below is the detail of the error:
generateThumbnail Error: {
Error: spawn convert ENOENT at _errnoException
(util.js:1022:11) at Process.ChildProcess._handle.onexit
(internal/child_process.js:190:19) at onErrorNT
(internal/child_process.js:372:16) at _combinedTickCallback
(internal/process/next_tick.js:138:11) at process._tickDomainCallback
(internal/process/next_tick.js:218:9)
code: 'ENOENT',
errno: 'ENOENT',
syscall: 'spawn convert',
path: 'convert',
spawnargs: [
'/tmp/images/E32NIXQKgVUxjUGDmPkr_aaaa',
'-thumbnail',
'400x220',
'/tmp/images/thumb_E32NIXQKgVUxjUGDmPkr_aaaa'
]
}
Is I'm doing something wrong or Is this the firebase cloud error?
For local development : brew install imagemagick

Error deploying firebase security rules

I am trying to deploy this:
firestore.rules file:
service cloud.firestore {
match /databases/{database}/documents {
match /documents/{document} {
// must be authenticated to view or create doc
allow create, read: if request.auth != null;
// must be your own doc to update
allow update, delete: if request.auth.uid == resource.data.uid;
}
}
}
with firebase deploy --only firestore:rules
but I am getting an ungooglable error.
Here is my firebase-debug.log:
[debug] [2018-02-25T14:55:55.801Z] ----------------------------------------------------------------------
[debug] [2018-02-25T14:55:55.803Z] Command: /Users/swyx/.nvm/versions/node/v8.5.0/bin/node /Users/swyx/.nvm/versions/node/v8.5.0/bin/firebase deploy --only firestore:rules
[debug] [2018-02-25T14:55:55.803Z] CLI Version: 3.14.0
[debug] [2018-02-25T14:55:55.804Z] Platform: darwin
[debug] [2018-02-25T14:55:55.804Z] Node Version: v8.5.0
[debug] [2018-02-25T14:55:55.804Z] Time: Sun Feb 25 2018 09:55:55 GMT-0500 (EST)
[debug] [2018-02-25T14:55:55.804Z] ----------------------------------------------------------------------
[debug]
[debug] [2018-02-25T14:55:55.818Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2018-02-25T14:55:55.818Z] > authorizing via signed-in user
[debug] [2018-02-25T14:55:55.819Z] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"]
[debug] [2018-02-25T14:55:55.820Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token { refresh_token: '1/redacted',
client_id: '563584335869-redacted.apps.googleusercontent.com',
client_secret: 'redacted',
grant_type: 'refresh_token',
scope: 'email https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloudplatformprojects.readonly https://www.googleapis.com/auth/firebase openid' }
Sun Feb 25 2018 09:55:55 GMT-0500 (EST)
[debug] [2018-02-25T14:55:55.935Z] <<< HTTP RESPONSE 200
[debug] [2018-02-25T14:55:55.943Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/testfirepup1
Sun Feb 25 2018 09:55:55 GMT-0500 (EST)
[debug] [2018-02-25T14:55:56.224Z] <<< HTTP RESPONSE 200
[debug] [2018-02-25T14:55:56.225Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/database/testfirepup1/tokens
Sun Feb 25 2018 09:55:56 GMT-0500 (EST)
[debug] [2018-02-25T14:55:56.699Z] <<< HTTP RESPONSE 200
[info] 1
[info]
[info] === Deploying to 'testfirepup1'...
[info]
[info] i deploying firestore
[info] i firestore: checking firestore.rules for compilation errors...
[debug] [2018-02-25T14:55:56.917Z] >>> HTTP REQUEST POST https://firebaserules.googleapis.com/v1/projects/testfirepup1:test { source: { files: [ [Object] ] } }
Sun Feb 25 2018 09:55:56 GMT-0500 (EST)
[debug] [2018-02-25T14:55:57.103Z] <<< HTTP RESPONSE 200
[info] ✔ firestore: rules file firestore.rules compiled successfully
[info] i firestore: uploading rules firestore.rules...
[debug] [2018-02-25T14:55:57.105Z] >>> HTTP REQUEST POST https://firebaserules.googleapis.com/v1/projects/testfirepup1/rulesets { source: { files: [ [Object] ] } }
Sun Feb 25 2018 09:55:57 GMT-0500 (EST)
[debug] [2018-02-25T14:55:57.416Z] <<< HTTP RESPONSE 200
[debug] [2018-02-25T14:55:57.416Z] [rules] created ruleset projects/testfirepup1/rulesets/6e8dfacc-8c69-4fd6-95b4-a28593bdb8c1
[debug] [2018-02-25T14:55:57.417Z] [rules] releasing cloud.firestore with ruleset projects/testfirepup1/rulesets/6e8dfacc-8c69-4fd6-95b4-a28593bdb8c1
[debug] [2018-02-25T14:55:57.417Z] >>> HTTP REQUEST PUT https://firebaserules.googleapis.com/v1/projects/testfirepup1/releases/cloud.firestore { name: 'projects/testfirepup1/releases/cloud.firestore',
rulesetName: 'projects/testfirepup1/rulesets/6e8dfacc-8c69-4fd6-95b4-a28593bdb8c1' }
Sun Feb 25 2018 09:55:57 GMT-0500 (EST)
[debug] [2018-02-25T14:55:57.525Z] <<< HTTP RESPONSE 404
[debug] [2018-02-25T14:55:57.526Z] <<< HTTP RESPONSE BODY <!DOCTYPE html>
<html lang=en>
<meta charset=utf-8>
<meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
<title>Error 404 (Not Found)!!1</title>
<style>
*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}#media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}#media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}#media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
</style>
<a href=//www.google.com/><span id=logo aria-label=Google></span></a>
<p><b>404.</b> <ins>That’s an error.</ins>
<p>The requested URL <code>/v1/projects/testfirepup1/releases/cloud.firestore</code> was not found on this server. <ins>That’s all we know.</ins>
[debug] [2018-02-25T14:55:57.527Z] TypeError: Cannot create property 'error' on string '<!DOCTYPE html>
<html lang=en>
<meta charset=utf-8>
<meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
<title>Error 404 (Not Found)!!1</title>
<style>
*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}#media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}#media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}#media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
</style>
<a href=//www.google.com/><span id=logo aria-label=Google></span></a>
<p><b>404.</b> <ins>That’s an error.</ins>
<p>The requested URL <code>/v1/projects/testfirepup1/releases/cloud.firestore</code> was not found on this server. <ins>That’s all we know.</ins>
'
at module.exports (/Users/swyx/.nvm/versions/node/v8.5.0/lib/node_modules/firebase-tools/lib/responseToError.js:11:16)
at Request._callback (/Users/swyx/.nvm/versions/node/v8.5.0/lib/node_modules/firebase-tools/lib/api.js:43:25)
at Request.self.callback (/Users/swyx/.nvm/versions/node/v8.5.0/lib/node_modules/firebase-tools/node_modules/request/request.js:186:22)
at emitTwo (events.js:125:13)
at Request.emit (events.js:213:7)
at Request.<anonymous> (/Users/swyx/.nvm/versions/node/v8.5.0/lib/node_modules/firebase-tools/node_modules/request/request.js:1163:10)
at emitOne (events.js:115:13)
at Request.emit (events.js:210:7)
at IncomingMessage.<anonymous> (/Users/swyx/.nvm/versions/node/v8.5.0/lib/node_modules/firebase-tools/node_modules/request/request.js:1085:12)
at Object.onceWrapper (events.js:314:30)
[error]
[error] Error: An unexpected error has occurred.
[debug] [2018-02-25T14:56:50.487Z] ----------------------------------------------------------------------
[debug] [2018-02-25T14:56:50.489Z] Command: /Users/swyx/.nvm/versions/node/v8.5.0/bin/node /Users/swyx/.nvm/versions/node/v8.5.0/bin/firebase deploy --only firestore:rules
[debug] [2018-02-25T14:56:50.490Z] CLI Version: 3.14.0
[debug] [2018-02-25T14:56:50.490Z] Platform: darwin
[debug] [2018-02-25T14:56:50.490Z] Node Version: v8.5.0
[debug] [2018-02-25T14:56:50.491Z] Time: Sun Feb 25 2018 09:56:50 GMT-0500 (EST)
[debug] [2018-02-25T14:56:50.491Z] ----------------------------------------------------------------------
[debug]
[debug] [2018-02-25T14:56:50.505Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2018-02-25T14:56:50.505Z] > authorizing via signed-in user
[debug] [2018-02-25T14:56:50.507Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/testfirepup1
Sun Feb 25 2018 09:56:50 GMT-0500 (EST)
[debug] [2018-02-25T14:56:51.081Z] <<< HTTP RESPONSE 200
[debug] [2018-02-25T14:56:51.082Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/database/testfirepup1/tokens
Sun Feb 25 2018 09:56:51 GMT-0500 (EST)
[debug] [2018-02-25T14:56:51.586Z] <<< HTTP RESPONSE 200
[info] 1
[info]
[info] === Deploying to 'testfirepup1'...
[info]
[info] i deploying firestore
[info] i firestore: checking firestore.rules for compilation errors...
[debug] [2018-02-25T14:56:51.847Z] >>> HTTP REQUEST POST https://firebaserules.googleapis.com/v1/projects/testfirepup1:test { source: { files: [ [Object] ] } }
Sun Feb 25 2018 09:56:51 GMT-0500 (EST)
[debug] [2018-02-25T14:56:52.036Z] <<< HTTP RESPONSE 200
[info] ✔ firestore: rules file firestore.rules compiled successfully
[info] i firestore: uploading rules firestore.rules...
[debug] [2018-02-25T14:56:52.038Z] >>> HTTP REQUEST POST https://firebaserules.googleapis.com/v1/projects/testfirepup1/rulesets { source: { files: [ [Object] ] } }
Sun Feb 25 2018 09:56:52 GMT-0500 (EST)
[debug] [2018-02-25T14:56:52.331Z] <<< HTTP RESPONSE 200
[debug] [2018-02-25T14:56:52.331Z] [rules] created ruleset projects/testfirepup1/rulesets/e1d12cdc-2551-42eb-957a-25e7a9aa7bca
[debug] [2018-02-25T14:56:52.332Z] [rules] releasing cloud.firestore with ruleset projects/testfirepup1/rulesets/e1d12cdc-2551-42eb-957a-25e7a9aa7bca
[debug] [2018-02-25T14:56:52.332Z] >>> HTTP REQUEST PUT https://firebaserules.googleapis.com/v1/projects/testfirepup1/releases/cloud.firestore { name: 'projects/testfirepup1/releases/cloud.firestore',
rulesetName: 'projects/testfirepup1/rulesets/e1d12cdc-2551-42eb-957a-25e7a9aa7bca' }
Sun Feb 25 2018 09:56:52 GMT-0500 (EST)
[debug] [2018-02-25T14:56:52.444Z] <<< HTTP RESPONSE 404
[debug] [2018-02-25T14:56:52.444Z] <<< HTTP RESPONSE BODY <!DOCTYPE html>
<html lang=en>
<meta charset=utf-8>
<meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
<title>Error 404 (Not Found)!!1</title>
<style>
*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}#media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}#media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}#media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
</style>
<a href=//www.google.com/><span id=logo aria-label=Google></span></a>
<p><b>404.</b> <ins>That’s an error.</ins>
<p>The requested URL <code>/v1/projects/testfirepup1/releases/cloud.firestore</code> was not found on this server. <ins>That’s all we know.</ins>
[debug] [2018-02-25T14:56:52.446Z] TypeError: Cannot create property 'error' on string '<!DOCTYPE html>
<html lang=en>
<meta charset=utf-8>
<meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
<title>Error 404 (Not Found)!!1</title>
<style>
*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}#media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}#media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}#media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
</style>
<a href=//www.google.com/><span id=logo aria-label=Google></span></a>
<p><b>404.</b> <ins>That’s an error.</ins>
<p>The requested URL <code>/v1/projects/testfirepup1/releases/cloud.firestore</code> was not found on this server. <ins>That’s all we know.</ins>
'
at module.exports (/Users/swyx/.nvm/versions/node/v8.5.0/lib/node_modules/firebase-tools/lib/responseToError.js:11:16)
at Request._callback (/Users/swyx/.nvm/versions/node/v8.5.0/lib/node_modules/firebase-tools/lib/api.js:43:25)
at Request.self.callback (/Users/swyx/.nvm/versions/node/v8.5.0/lib/node_modules/firebase-tools/node_modules/request/request.js:186:22)
at emitTwo (events.js:125:13)
at Request.emit (events.js:213:7)
at Request.<anonymous> (/Users/swyx/.nvm/versions/node/v8.5.0/lib/node_modules/firebase-tools/node_modules/request/request.js:1163:10)
at emitOne (events.js:115:13)
at Request.emit (events.js:210:7)
at IncomingMessage.<anonymous> (/Users/swyx/.nvm/versions/node/v8.5.0/lib/node_modules/firebase-tools/node_modules/request/request.js:1085:12)
at Object.onceWrapper (events.js:314:30)
[error]
[error] Error: An unexpected error has occurred.
I can't tell what's wrong so I have no idea what to fix. Please help!
The OP indicated in a comment that the failure was the result was not having the latest version of the Firebase CLI. To see the installed version number, use firebase -V.
Because features are continuously being added in new versions of the Firebase CLI, the documentation recommends frequently updating to ensure you have the latest version:
In many cases, new features and bug fixes are available only with the
latest version of the Firebase CLI and the firebase-functions SDK.
It's a good practice to frequently update both the Firebase CLI and
the SDK with these commands inside the functions folder of your
Firebase project:
npm install firebase-functions#latest firebase-admin#latest --save
npm install -g firebase-tools
For reference, the Firebase CLI is open-source and is available here.
It was solved by updating the firebase-tools version. breaking change from 3.14 to 3.17 :( Thank you very much #bob snyder.

Resources