How to locate and view detailed Heroku log files? - heroku

My Heroku app is not running. When I view the log files on the website, there is a reference to what I believe is a different more detailed log file.
I connected to Heroku via bash and tried to traverse to the ".npm/" directory, but it does not exist. Where do I find this log file?
2018-02-11T20:36:51.615923+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-02-11T20_36_51_610Z-debug.log
2018-02-11T20:36:51.615844+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:

Try executing 'heroku logs' command inside your project's root directory.

Related

Not able to launch heroku cli on cygwin

As I don't have admin rights on my laptop, so downloaded the zip version of heroku CLI for deploying my app. When I execute the cmd from the bin path of the heroku it's launching and working fine, but when trying to launch from cygwin it's not working. Followed below workaround as I thought path issues, symlinks issues
.bash_profile
#Setting the heroku path on the cygwin
export PATH=$PATH:"/cygdrive/c/Django/heroku/bin/heroku"
export CYGWIN="winsymlinks:native"
cd C:/cygdrive && rm -rf c && ln -s -v C:/ c
.bashrc
alias heroku="/cygdrive/c/Django/heroku/bin/heroku"
which are suggested in the SO, but not helpful and I'm getting below error when trying to execute $ heroku in cygwin..
$ heroku
internal/modules/cjs/loader.js:983
throw err;
^
Error: Cannot find module 'C:\cygdrive\c\Django\heroku\bin\run'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980
:15)
at Function.Module._load (internal/modules/cjs/loader.js:862:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_ma
in.js:74:12)
at internal/main/run_main_module.js:18:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Note: I'm able to launch heroku from GIT bash and CMD
whole time I was adding wrong files to the path and also executing them, Extracted zip folder of heroku contains following files
So, what I did..? copied the full path of bin including heroku.cmd file and pasted in the below file ".bashrc" as alias.
.bashrc
alias heroku="/cygdrive/c/Django/heroku/bin/heroku.cmd"
as heroku.cmd file is a script file and it contains set of commands for the heroku.
and I'm able to login to heroku and create app as well.

How to deploy a commit of parse server?

How do I deploy a specific commit of parse server on AWS EB?
I tried to:
Change the package.json of parse-server-example to:
"dependencies": {
"parse-server": "parse-community/parse-server#commit-hash"
}
Run npm install
Deploy to AWS EB
The server fails to start with error:
Error: Cannot find module '/var/app/current/node_modules/parse-server/lib/index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (internal/modules/cjs/loader.js:316:19)
at Function.Module._findPath (internal/modules/cjs/loader.js:705:18)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:969:27)
at Function.Module._load (internal/modules/cjs/loader.js:864:27)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (/var/app/current/index.js:10:19)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32) {
code: 'MODULE_NOT_FOUND',
path: '/var/app/current/node_modules/parse-server/package.json',
requestPath: 'parse-server'
It works when I don't point the dependency to a commit, but it doesn't work with a commit - why?
If you look at the Parse Server GitHub repository, you will see that there is no lib/ folder over there. The lib/ is at the .gitignore file and you will only find it in the npm package. That's why it fails when you try to install directly from the GitHub repository.
The workaround is:
Create a fork of Parse Server repository in your own GitHub account.
Clone your own fork.
Reset to the commit you need, run npm install.
Remove the lib/ folder from .gitignore, commit, and push it to your own fork.
Try the process you described again but installing from your own GitHub fork.
Make sure npm install is not running under root but rather under a non-privileged user. Running under root will break npm prepare step that is required to compile src/ into lib/ using babel.

Strapi Graphql Plugin Crashes Strapi Server

I just tried to install the graphql plugin for strapi (i.e., strapi-plugin-graphql). When I tried to install it via the admin interface, I got the following error message:
The restart takes longer than expected
The server should have restarted, please check your logs in the terminal
When I check my terminal, this is what I see:
[2019-12-27T07:47:12.612Z] debug GET /admin/plugins (5 ms) 200
[2019-12-27T07:47:15.882Z] info Installing graphql...
[2019-12-27T07:48:59.105Z] info File changed: C:\code\tutorials\react\Gatsby\strapi\startup-reporter\package.json[2019-12-27T07:48:59.279Z] debug POST /admin/plugins/install (103411 ms) 200
[2019-12-27T07:48:59.281Z] info The server is restarting
[2019-12-27T07:49:14.672Z] debug ⛔️ Server wasn't able to start properly.
[2019-12-27T07:49:14.674Z] error Error: Field "Query.news" can only be defined once.
at assertValidSDL (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\graphql\validation\validate.js:108:11)
at Object.buildASTSchema (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\graphql\utilities\buildASTSchema.js:71:34)
at Object.buildSchemaFromTypeDefinitions (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\graphql-tools\dist\generate\buildSchemaFromTypeDefinitions.js:23:28)
at makeExecutableSchema (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\graphql-tools\dist\makeExecutableSchema.js:26:29)
at Object.generateSchema (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\strapi-plugin-graphql\services\Schema.js:300:22)
at Object.initialize (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\strapi-plugin-graphql\hooks\graphql\index.js:59:50)
at Promise.resolve.then (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\strapi\lib\hooks\index.js:37:28)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! startup-reporter#0.1.0 dev: `strapi develop`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the startup-reporter#0.1.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\moshe\AppData\Roaming\npm-cache\_logs\2019-12-27T07_49_14_697Z-debug.log
Any idea why I am getting this error message and how to fix it?
UPDATE:
I should note that I did a fresh install of strapi and then installed the graphql plugin -- and it installed properly. It only didn't work with an installation that already had custom post types. I don't know why that is -- and what I can do to install it with those custom post types. Any ideas?
Here is the issue about this problem
https://github.com/strapi/strapi/issues/1198
Some words are not well managed for the pluralize version.
So the issue is due to that point.
There is currently nothing to do to fix it by your own.

How to fix EACCES: permission denied, open '/Users/.... when installing gatsby-cli

I'm setting up Gatsby and get stuck at the beginning.
When i write npx/npm install global gatsby-cli in the terminal -
Alems-MacBook-Pro:~ alemkahrobek$ npm install -g gatsby-cli i see this:
/usr/local/bin/gatsby -> /usr/local/lib/node_modules/gatsby-cli/lib/index.js
gatsby-telemetry#1.0.4 postinstall /usr/local/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry
node src/postinstall.js
gatsby-cli#2.5.4
added 225 packages from 131 contributors in 13.617s.
If i check the version of gatsby i get this:
Alems-MacBook-Pro:~ alemkahrobek$ gatsby -v
/usr/local/lib/node_modules/gatsby-cli/node_modules/configstore/index.js:49
throw error;
^
Error: EACCES: permission denied, open '/Users/alemkahrobek/.config/gatsby/config.json'
You don't have access to this file.
at Object.openSync (fs.js:439:3)
at Object.readFileSync (fs.js:344:35)
at Configstore.get all [as all] (/usr/local/lib/node_modules/gatsby-cli/node_modules/configstore/index.js:31:25)
at new Configstore (/usr/local/lib/node_modules/gatsby-cli/node_modules/configstore/index.js:25:48)
at new Store (/usr/local/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry/lib/store.js:28:51)
at new EventStorage (/usr/local/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry/lib/event-storage.js:24:50)
at new AnalyticsTracker (/usr/local/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry/lib/telemetry.js:32:50)
at Object.<anonymous> (/usr/local/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry/lib/index.js:7:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10).
Now if i try to make a new project like:
gatsby new example
i get this:
Alems-MacBook-Pro:~ alemkahrobek$ npm gatsby new example
Usage: npm <command>
where <command> is one of:
access, adduser, audit, bin, bugs, c, cache, ci, cit,
clean-install, clean-install-test, completion, config,
create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
edit, explore, get, help, help-search, hook, i, init,
install, install-ci-test, install-test, it, link, list, ln,
login, logout, ls, org, outdated, owner, pack, ping, prefix,
profile, prune, publish, rb, rebuild, repo, restart, root,
run, run-script, s, se, search, set, shrinkwrap, star,
stars, start, stop, t, team, test, token, tst, un,
uninstall, unpublish, unstar, up, update, v, version, view,
whoami
npm <command> -h quick help on <command>
npm -l display full usage info
npm help <term> search for help on <term>
npm help npm involved overview
Specify configs in the ini-formatted file:
/Users/alemkahrobek/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm#6.9.0 /usr/local/lib/node_modules/npm
Alems-MacBook-Pro:~ alemkahrobek$ npm help config
NPM-CONFIG(1) NPM-CONFIG(1)
NAME
npm-config - Manage the npm configuration files
SYNOPSIS
npm config set <key> <value> [-g|--global]
npm config get <key>
npm config delete <key>
npm config list [-l] [--json]
npm config edit
npm get <key>
npm set <key> <value> [-g|--global]
aliases: c
DESCRIPTION
npm gets its config settings from the command line, environment vari-
ables, npmrc files, and in some cases, the package.json file.
See npm help 5 npmrc for more information about the npmrc files.
See npm help 7 npm-config for a more thorough discussion of the mechanisms involved.
The npm config command can be used to update and edit the contents of
the user and global npmrc files.
Sub-commands
Config supports the following sub-commands:
set
npm config set key value
Sets the config key to the value.
If value is omitted, then it sets it to "true".
get
npm config get key
Echo the config value to stdout.
list
npm config list
Show all the config settings. Use -l to also show defaults. Use --json
to show the settings in json format.
delete
npm config delete key
Deletes the key from all configuration files.
edit
npm config edit
Opens the config file in an editor. Use the --global flag to edit the
global config.
SEE ALSO
o npm help 5 folders
o npm help 7 config
o npm help 5 package.json
o npm help 5 npmrc
For Ubuntu users who experience the same problem, I've solved it giving the right permissions on the specified folder:
chown -R $USER:$USER /home/$USER/.config/gatsby
Check out the official page on npmjs.com: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally
I would definitely the first option on that page. nvm is pretty awesome: https://github.com/creationix/nvm

Node.js failed to install global npm packages on windows (not path)

So, I have a strange problem that I'm not even sure I can identify. I just installed the current version of Node.js (v.10.*) on my Windows 7 machine. I have tried to install a couple packages globally (gulp and yoeman), but I get errors when they are installing and in my C:\Users\Michael\AppData\Roaming\npm\node_modules directory, many of the package files are missing. Obviously, when I try to run the command globally, it fails because there IS NO command. It was never created.
Some other globally installed packages work fine (bower and grunt).
To make things really tricky. When I install gulp to a local folder (without the -g), the install works perfectly and I can use gulp by prepending the entire path before the command. Obviously, I could add that path to my system properties so the command would be global, but that wouldn't really fix my problem. Why does the install produce errors when installing globally, but not when installing locally?
As I watch the directory while gulp is installing locally, I see the files being created. Then the first error comes along and many of the files are deleted.
I believe the relevent parts of the log for my gulp install are:
6949 verbose lock lodash.noop#2.4.1 C:\Users\Michael\AppData\Roaming\npm-cache\7e62c2bb-lodash-noop-2-4-1.lock
6950 error Error: ENOENT, lstat 'C:\Users\Michael\AppData\Roaming\npm\node_modules\gulp\node_modules\vinyl-fs\node_modules\glob-stream\node_modules\glob2base\node_modules\lodash.findindex\node_modules\lodash.createcallback\node_modules\lodash._baseisequal\node_modules\lodash._releasearray\node_modules\lodash._arraypool'
6951 error If you need help, you may report this *entire* log,
6951 error including the npm and node versions, at:
6951 error <http://github.com/npm/npm/issues>
6952 error System Windows_NT 6.1.7601
6953 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "gulp"
6954 error cwd c:\wamp\www\phoenix\animus\gulp
6955 error node -v v0.10.28
6956 error npm -v 1.4.9
6957 error path C:\Users\Michael\AppData\Roaming\npm\node_modules\gulp\node_modules\vinyl-fs\node_modules\glob-stream\node_modules\glob2base\node_modules\lodash.findindex\node_modules\lodash.createcallback\node_modules\lodash._baseisequal\node_modules\lodash._releasearray\node_modules\lodash._arraypool
6958 error fstream_path C:\Users\Michael\AppData\Roaming\npm\node_modules\gulp\node_modules\vinyl-fs\node_modules\glob-stream\node_modules\glob2base\node_modules\lodash.findindex\node_modules\lodash.createcallback\node_modules\lodash._baseisequal\node_modules\lodash._releasearray\node_modules\lodash._arraypool
6959 error fstream_unc_path \\?\C:\Users\Michael\AppData\Roaming\npm\node_modules\gulp\node_modules\vinyl-fs\node_modules\glob-stream\node_modules\glob2base\node_modules\lodash.findindex\node_modules\lodash.createcallback\node_modules\lodash._baseisequal\node_modules\lodash._releasearray\node_modules\lodash._arraypool
6960 error fstream_type Directory
6961 error fstream_class DirWriter
6962 error code ENOENT
6963 error errno 34
6964 error fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26
6964 error fstream_stack Object.oncomplete (fs.js:107:15)
6965 verbose exit [ 34, true ]
I have log files if that would help.
Thank you.
Windows can only support 260 characters as Max Path Length. I hope nodejs developers will resolve the nesting module approach. To do a workaround I simply change the global npm modules path to c: from AppData to get some characters and it resolves the issue. I know that this hack just provide you few characters but it is working for me.
To do so,
Open notepad in Administrator mode.
Go to location [nodejs installation directory]\node_modules\npm
Open file "npmrc" and change prefix=c:\npm
Save the file.

Resources