ember firebase deploy -- events.js:85 -- throw er; // Unhandled 'error' event -- Error: spawn - ember.js

I'm following the directions from Here to set up a new firebase hosted app. I get to the end of the instructions and the 'ember firebase deploy' command fails. Here are the steps I'm taking:
C:\workspace\npm install -g firebase-tools
C:\workspace\cd dashdash
C:\workspace\dashdash\firebase login
C:\workspace\dashdash\npm install --save-dev ember-cli-firebase-hosting
C:\workspace\dashdash\ember generate firebase-hosting
C:\workspace\dashdash\ember firebase deploy
It works fine up until the last step. Instead of getting a success message and the URL of my app, I get the following:
C:\workspace\dashdash>ember firebase deploy
version: 1.13.8
Built project successfully. Stored in "dist".
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn C:\workspace\dashdash\node_modules\ember-cli-firebase-hosting\node_modules\firebase-tools\bin\firebase ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
at child_process.js:1144:20
at process._tickCallback (node.js:355:11)
I haven't changed the app in any way when I get to that step, and I can serve it successfully to http://localhost:4200/ and get the "Welcome to Ember" message.
I'm running Windows 7 Professional (SP1) and using Windows PowerShell (run as administrator) to give the commands. I've also tried in PHPStorm's terminal.
I'm just learning about Ember, so if I've left something out (I probably have,) let me know. I'm more than happy to gather any necessary information. Any help/advice will be much appreciated.

After emailing Firebase support, I was able to get the app deployed using "firebase deploy" rather than "ember firebase deploy."

Related

Logstash Google Pubsub Input Plugin fails to load file and pull messages

I'm getting this error when trying to run Logstash pipeline with a configuration that is using google_pubsub on a docker container running in my production env:
2021-09-16 19:13:25 FATAL runner:135 - The given configuration is invalid. Reason: Unable to configure plugins: (PluginLoadingError) Couldn't find any input plugin named 'google_pubsub'. Are you sure this is correct? Trying to load the google_pubsub input plugin resulted in this error: Problems loading the requested plugin named google_pubsub of type input. Error: RuntimeError
you might need to reinstall the gem which depends on the missing jar or in case there is Jars.lock then resolve the jars with `lock_jars` command
no such file to load -- com/google/cloud/google-cloud-pubsub/1.37.1/google-cloud-pubsub-1.37.1 (LoadError)
2021-09-16 19:13:25 ERROR Logstash:96 - java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit
This seems to randomly happen when re-installing the plugin. I thought it's a proxy issue but I have the google domain enabled in the whitelist. Might be the wrong one / missing something. Still, doesn't explain the random failures.
Also, when I run the pipeline in my machine I get GCP events, but when I do it on a VM - no Pubsub messages are being pulled. Could it be a firewall rule blocking them?
The error message suggests there is a problem in loading the ‘google_pubsub’ input plugin. This error generally occurs when the input Pub/Sub plugin is not installed properly. Kindly ensure that you are installing the Logstash Plugin for Pub/Sub correctly.
For example, installing Logstash Plugin for Pub/Sub in a VM :
sudo -u root sudo -u logstash bin/logstash-plugin install logstash-input-google_pubsub
For a detailed demo refer to this community tutorial.

How do i continue working with Amplify on a new machine?

I'm using react native for my project. On my old machine, when i ran amplify status, i had Auth, Api and Storage services listed.
I moved to my new machine, installed node, watchman, brew etc... and then navigated to my react native project and ran: react-native run-ios, and voila, my app is running. All the calls to my AWS Api, Auth and Storage are working perfectly.
Now i can make some amplify commands. Such as amplify status. I tried: amplify env add: here's what i got:
Users-MBP-2:projectname username$ amplify env add
Note: It is recommended to run this command from the root of your app directory
? Do you want to use an existing environment? Yes
? Choose the environment you would like to use: dev
Using default provider awscloudformation
✖ There was an error initializing your environment.
init failed
Error: ENOENT: no such file or directory, open '/Users/username/.aws/credentials'
at Object.openSync (fs.js:462:3)
at Proxy.readFileSync (fs.js:364:35)
at Object.readFileSync (/usr/local/lib/node_modules/#aws-amplify/cli/node_modules/aws-sdk/lib/util.js:95:26)
at IniLoader.parseFile (/usr/local/lib/node_modules/#aws-amplify/cli/node_modules/aws-sdk/lib/shared-ini/ini-loader.js:6:47)
at IniLoader.loadFrom (/usr/local/lib/node_modules/#aws-amplify/cli/node_modules/aws-sdk/lib/shared-ini/ini-loader.js:56:30)
at Config.region (/usr/local/lib/node_modules/#aws-amplify/cli/node_modules/aws-sdk/lib/node_loader.js:100:36)
at Config.set (/usr/local/lib/node_modules/#aws-amplify/cli/node_modules/aws-sdk/lib/config.js:507:39)
at Config.<anonymous> (/usr/local/lib/node_modules/#aws-amplify/cli/node_modules/aws-sdk/lib/config.js:342:12)
at Config.each (/usr/local/lib/node_modules/#aws-amplify/cli/node_modules/aws-sdk/lib/util.js:507:32)
at new Config (/usr/local/lib/node_modules/#aws-amplify/cli/node_modules/aws-sdk/lib/config.js:341:19) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '/Users/username/.aws/credentials'
}
Do you think credentials info needs to be brought/configured to my new machine?
When i run amplify configure project it's like doing an amplify init and building a project from scratch. I'm being asked:
? Enter a name for the project: ProjectName
? Choose your default editor: Visual Studio Code
? Choose the type of app that you're building javascript
Please tell us about your project
? What javascript framework are you using (Use arrow keys)
angular
ember
ionic
react
❯ react-native
vue
none
etc....
I also already have a region, username and accessKey, secretAccess key etc..
I do not want to replace or ruin anything in my current backend or current project! Whats going on?
Ensure amplify-cli is installed and you're logged in with your AWS details.
npm install -g #aws-amplify/cli
amplify configure
Running amplify configure is mainly to give the cli knowledge of your AWS account so subsequent commands can have access to things.
If you get amplify: command not found errors try restarting your terminal. If still no luck, you will need to check amplify has been added to your PATH variable.
Run amplify env add , but choose an existing environment. This will let you choose the environment you created on your other machine so you can pull those settings down to your new machine.
amplify env add
? Do you want to use an existing environment? Yes
Production
Follow up with:
amplify pull
You don't need to run amplify add auth again or anything. All of that will pull down automatically after you've done the above.
You DO NOT need to do all config again, but some for sure
You have to install amplify cli npm install -g #aws-amplify/cli
use amplify pull
https://docs.amplify.aws/cli/start#amplify-pull
Follow the rest of steps -
-- provide the accessKeyId, secretAccessKey
-- region
-- select amplify project
and then rest of app related thing like IDE, directory......
I tried every solution then I found this. (in MacBook)
% sudo -i
Password:
~ root# npm install -g #aws-amplify/cli
-- Ctrl+D to exist from Root user
% amplify pull --appId xxxx --envName yyyy.
Note: To get --appId xxxx --envName yyyy
Log in to the AWS console. Choose AWS Amplify. Click your app. Go to Backend
environments. Find the backend environment you wish to pull. Click
Edit backend. See top right then click 'Local setup instructions
' ( amplify pull --appId
YOUR_APP_ID --envName YOUR_ENV_NAME )
Waiting until it request to verify your amplify.
✔ Successfully received Amplify Studio tokens.
? Choose your default editor: Visual Studio Code
? Choose the type of app that you're building javascript
Please tell us about your project
? What javascript framework are you using react
? Source Directory Path: src
? Distribution Directory Path: build
? Build Command: npm run-script build
? Start Command: npm run-script start
✔ Synced UI components.
? Do you plan on modifying this backend? Yes
⠴ Building resource api/xxxx✅ GraphQL schema compiled successfully.
Edit your schema at ....
✔ Successfully pulled backend environment yyyy from the cloud.
✅
Successfully pulled backend environment staging from the cloud.
Run 'amplify pull' to sync future upstream changes.
% amplify pull
% npm install
% npm start
Hope this help every one!!
Happy Coding :)

Expo builds locally, won’t publish

I have my un-ejected expo app up and running and I've managed to build and run it successfully locally on both android and iOS without errors. However, when I try to publish the app I get the unable to resolve module error.
Here's the full error:
[exp] Failed building JavaScript bundle.
[exp] Unable to resolve module `BikeShare/theme/components` from `/Users/gdaunton/Projects/BikeShare/App.js`: Module does not exist in the module map
[exp]
[exp] This might be related to https://github.com/facebook/react-native/issues/4968
[exp] To resolve try the following:
[exp] 1. Clear watchman watches: `watchman watch-del-all`.
[exp] 2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
[exp] 3. Reset packager cache: `rm -fr $TMPDIR/react-*` or `npm start -- --reset-cache`.
[exp] Packager URL http://localhost:19001/node_modules/expo/AppEntry.bundle?dev=false&minify=true&hot=false&assetPlugin=/Users/gdaunton/Projects/BikeShare/node_modules/expo/tools/hashAssetFiles&platform=ios returned unexpected code 500. Please open your project in the Expo app and see if there are any errors. Also scroll up and make sure there were no errors or warnings when opening your project.
Basically I have a a setup like this:
BikeShare
- static
- js
- theme
- components
- index.js
- App.js
and a .babelrc with:
["module-alias", [
{ "src": "./static/js", "expose": "BikeShare" }
]]
I found out that it was because I had aliases that branched off of my main alias (i.e. BikeShare/img). I had to switch all of those to be namespaced separately (just img/). I also switched to using module-resolver instead of module-alias since that was recommended in a few places.

Static buildpack deploy now failing due to unsupported stack

I'm trying to deploy an update to a simple HTML application using static files. Using the static buildpack, I've previously deployed the application with no issues.
Pushing an application update, the command fails with the following message:
----> Downloaded app package (4.0K)
Cloning into '/tmp/buildpacks/staticfile-buildpack'...
Submodule 'compile-extensions' (https://github.com/cloudfoundry-incubator/compile-extensions.git) registered for path 'compile-extensions'
FAILED
Server error, status code: 400, error code: 170004, message: App staging failed in the buildpack compile phase
Looking in the logs for the application, the platform fails staging due to an incompatibility with the stack.
ERR Cloning into '/tmp/buildpacks/staticfile-buildpack'...
OUT Submodule 'compile-extensions' (https://github.com/cloudfoundry-incubator/compile-extensions.git) registered for path 'compile-extensions'
ERR Cloning into 'compile-extensions'...
OUT Submodule path 'compile-extensions': checked out '1f260464c156bddfb654adb14298344797d030a1'
ERR It looks like you're deploying on a stack that's not supported by this buildpack.
ERR That could be because you're using a recent buildpack release on a deprecated stack.
ERR If you're using the buildpack installed by your CF admin, please let your admin know you saw this error message.
ERR If you at one point specified a buildpack that's at git URL, please make sure you're pointed at a version that supports this stack.
OUT Staging failed: Buildpack compilation step failed
ERR encountered error: App staging failed in the buildpack compile phase
How can I resolve this?
Cloud Foundry recently added support for a new stack, cflinuxfs2, based upon Ubuntu 14.04. IBM Bluemix still supports the old lucid64 build stack, which appears to be chosen by default if a stack isn't specified on the command line.
Looking at the "Static Buildpack" manifest, the old stack isn't supported.
cf_stacks:
- cflinuxfs2
You can explicitly set the application stack during deploying using the '-s' command-line parameter.
cf push -b https://github.com/cloudfoundry/staticfile-buildpack.git -s cflinuxfs2
Using the 'cflinuxfs2' will fix the issue.
For anyone else having this issue on bluemix I was actually unable to use the cflinuxfs stack on the external bluemix, but pushing with cflinuxfs2 seems to work
cf push -b https://github.com/cloudfoundry/staticfile-buildpack.git -s cflinuxfs2
Edit: Running this command on the api endpoint that I was using I got the following output, hence the reason i had to use cflinuxfs2:
> cf stacks
name description
lucid64 Ubuntu 10.04
seDEA private
cflinuxfs2 Ubuntu 14.04.2 trusty
Also: https://developer.ibm.com/answers/questions/198303/cloudfoundry-static-buildpack-not-compatible.html

VMC cannot detect application type when publishing Play Framework 2.2 app to CloudFoundry

I am using a free cloud foundry account. Today I tried pushing my Play 2.2 application but it rejects to start, the message is Unable to detect a supported application type (RuntimeError).
Deploying the app to cloud foundry is done as described in the official documentation.
Has anyone yet get this working?
Here is the full error message:
Preparing to start ***... OK
-----> Downloaded app package (38M)
/var/vcap/packages/dea_next/buildpacks/lib/buildpack.rb:94:in `build_pack': Unable to detect a supported application type (RuntimeError)
from /var/vcap/packages/dea_next/buildpacks/lib/buildpack.rb:72:in `block in compile_with_timeout'
from /usr/lib/ruby/1.9.1/timeout.rb:68:in `timeout'
from /var/vcap/packages/dea_next/buildpacks/lib/buildpack.rb:71:in `compile_with_timeout'
from /var/vcap/packages/dea_next/buildpacks/lib/buildpack.rb:53:in `block in stage_application'
from /var/vcap/packages/dea_next/buildpacks/lib/buildpack.rb:49:in `chdir'
from /var/vcap/packages/dea_next/buildpacks/lib/buildpack.rb:49:in `stage_application'
from /var/vcap/packages/dea_next/buildpacks/bin/run:10:in `<main>'
Checking status of app '***'...Application failed to stage
EDIT: I posted the issue on the official mailing list. No answer yet. But here are the steps to reproduce the issue:
create a new play 2.2 app ( play new version22 )
cd into app directory ( cd version22 )
build the project ( play dist )
push the application to cloud foundry ( cf push --path=target/universal/version22-1.0-SNAPSHOT.zip ) -- just chose the defaults
bang
I guess this is caused by the new Feature (What's new in Play 2.2?) New stage and dist tasks that changed the packaging of the app. This could cause cloud foundry problem to detect the application type.
Which cloud foundry version are you targeting on v1 or v2?
Error which you are encountering is because , cf is not having a build pack for play framework.
If you are targeting cloud foundry v2 try pushing application this way:
cf push --buildpack https://github.com/cloudfoundry/java-buildpack
After some trial and error, I got it working using the following manifest.yml to deploy on cloud foundry v2:
---
env:
JAVA_HOME: .java
applications:
- name: <APP_NAME>
memory: 512M
instances: 1
host: <AP_HOST_NAME>
domain: cfapps.io
path: <PATH_TO_ZIP_FILE>
command: ./<DIR_PACKAGE_NAME>/bin/<APP_NAME>
buildpack: https://github.com/cloudfoundry/java-buildpack
You have to fill in the info between <> for your app, and config other information as well, but the core solution is to provide the JAVA_HOME env variable, and the correct path to the start command.
Perhaps we should consider a SBT task to create this file as a permanent fix, or maybe update the java-buildpack... I'm not sure which one is the best approach.
Edit: You also will need to place a script called start in <DIR_PACKAGE_NAME>/start, or else cloud foundry will try to compile the app and fail miserably - I suppose this needs to be fixed in java-buildpack as well.
This has been confirmed as a bug. Should be fixed soon.