Unable to deploy go app with Godeps dependencies on Heroku - heroku

I have the following error when i'm trying to push my project on heroku
git push heroku master
Counting objects: 88, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (86/86), done.
Writing objects: 100% (88/88), 18.85 MiB | 686.00 KiB/s, done.
Total 88 (delta 13), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Go app detected
remote: -----> Checking Godeps/Godeps.json file.
remote: -----> Using go1.7.3
remote: -----> Running: go install -v -tags heroku ./...
remote: main.go:8:2: cannot find package "github.com/Sirupsen/logrus" in any of:
remote: /app/tmp/cache/go1.7.3/go/src/github.com/Sirupsen/logrus (from $GOROOT)
remote: /tmp/tmp.Ffkjp5c5US/.go/src/github.com/Sirupsen/logrus (from $GOPATH)
remote: main.go:6:2: cannot find package "github.com/gin-gonic/gin" in any of:
remote: /app/tmp/cache/go1.7.3/go/src/github.com/gin-gonic/gin (from $GOROOT)
remote: /tmp/tmp.Ffkjp5c5US/.go/src/github.com/gin-gonic/gin (from $GOPATH)
remote: ! Push rejected, failed to compile Go app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to eerie-wizard-18479.
remote:
To https://git.heroku.com/eerie-wizard-18479.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/eerie-wizard-18479.git'
I carefully made a godep save ./... before commiting and pushing on heroku, this is my Godeps.json file: (logrus and gin are present in this file)
{
"ImportPath": "github.com/sbouaked/neo-fundations",
"GoVersion": "go1.7",
"GodepVersion": "v74",
"Packages": [
"./..."
],
"Deps": [
{
"ImportPath": "github.com/Sirupsen/logrus",
"Comment": "v0.10.0-38-g3ec0642",
"Rev": "3ec0642a7fb6488f65b06f9040adc67e3990296a"
},
{
"ImportPath": "github.com/gin-gonic/gin",
"Comment": "v1.0-2-g3900df0",
"Rev": "3900df04d2a88e22beaf6a2970c63648b9e1b0e1"
},
{
"ImportPath": "github.com/gin-gonic/gin/binding",
"Comment": "v1.0-2-g3900df0",
"Rev": "3900df04d2a88e22beaf6a2970c63648b9e1b0e1"
},
{
"ImportPath": "github.com/gin-gonic/gin/render",
"Comment": "v1.0-2-g3900df0",
"Rev": "3900df04d2a88e22beaf6a2970c63648b9e1b0e1"
},
{
"ImportPath": "github.com/golang/protobuf/proto",
"Rev": "98fa357170587e470c5f27d3c3ea0947b71eb455"
},
{
"ImportPath": "github.com/manucorporat/sse",
"Rev": "ee05b128a739a0fb76c7ebd3ae4810c1de808d6d"
},
{
"ImportPath": "golang.org/x/net/context",
"Rev": "4bb47a1098b37d69980d96237e2ae4ff56bb5a95"
},
{
"ImportPath": "golang.org/x/sys/unix",
"Rev": "c200b10b5d5e122be351b67af224adc6128af5bf"
},
{
"ImportPath": "gopkg.in/go-playground/validator.v8",
"Comment": "v8.18.1",
"Rev": "5f57d2222ad794d0dffb07e664ea05e2ee07d60c"
},
{
"ImportPath": "gopkg.in/yaml.v2",
"Rev": "a5b47d31c556af34a302ce5d659e6fea44d90de0"
}
]
}
I saw on this post that I have to commit vendor/, but I didn't want to. There is really any solutions for this now ?

If you look at the heroku buildpack for Go (https://github.com/heroku/heroku-buildpack-go/blob/master/bin/compile), it does not currently support GoDeps, as traditional GoDeps style dependency management has been deprecated as Go v1.6. You can convert your GoDeps dependencies to a vendored dependency and that should fix that.
I personally recommend using glide: https://github.com/Masterminds/glide
But you can also use:
https://github.com/kardianos/govendor
or
https://github.com/constabulary/gb
As those are supported in the compile script for the buildpack.
Each of those support an automated conversion of GoDeps to their formats.
If you have ./vendor/vendor.json Heroku will automatically use govendor, unless you configure Heroku to use something otherwise.
This page may help as well https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-go
It does support Godep, technically, but it would seem you have to either use an older version of Go or move GoDeps to vendor.

Related

Build error with Keystone v5 – #keystonejs/app-next with Heroku CLI

I'm having issues trying to upload a website using this Keystone v5 + Next.js and everything runs well at dev and even builds locally: Styled-components + Styled-system, SSR and .babelrc (for styled-components config), also next.config.js (for jsconfig.json). But at the time that I do this line of code, using Heroku CLI it chash after everything upload
command line
git push heroku develop:master
doing it that way due I'm testing at develop branch from origin repo.
Heroku log
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: YARN_PRODUCTION=true
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote: NODE_VERBOSE=false
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): 12.12.0
remote: engines.npm (package.json): unspecified (use default)
remote: engines.yarn (package.json): 1.22.4
remote:
remote: Resolving node version 12.12.0...
remote: Downloading and installing node 12.12.0...
remote: Using default npm version: 6.11.3
remote: Resolving yarn version 1.22.4...
remote: Downloading and installing yarn (1.22.4)...
remote: Installed yarn 1.22.4
remote:
remote: -----> Installing dependencies
remote: Installing node modules (yarn.lock)
remote: yarn install v1.22.4
remote: [1/4] Resolving packages...
remote: [2/4] Fetching packages...
remote: info fsevents#2.1.3: The platform "linux" is incompatible with this module.
remote: info "fsevents#2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
remote: info fsevents#1.2.13: The platform "linux" is incompatible with this module.
remote: info "fsevents#1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
remote: [3/4] Linking dependencies...
remote: warning " > graphql-tag#2.10.3" has unmet peer dependency "graphql#^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0".
remote: warning "#keystonejs/fields > #apollo/react-hooks#3.1.5" has unmet peer dependency "#types/react#^16.8.0".
remote: warning "#keystonejs/fields > slate#0.47.9" has unmet peer dependency "immutable#>=3.8.1 || >4.0.0-rc".
remote: warning "#keystonejs/fields > slate-react#0.22.10" has unmet peer dependency "immutable#>=3.8.1 || >4.0.0-rc".
remote: warning "react-apollo > #apollo/react-common#3.1.4" has unmet peer dependency "#types/react#^16.8.0".
remote: warning "react-apollo > #apollo/react-common#3.1.4" has unmet peer dependency "apollo-utilities#^1.3.2".
remote: warning "react-apollo > #apollo/react-common#3.1.4" has unmet peer dependency "graphql#^14.3.1".
remote: warning " > apollo-cache-inmemory#1.6.6" has unmet peer dependency "graphql#^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
remote: warning " > apollo-client#2.6.10" has unmet peer dependency "graphql#^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
remote: warning "#keystonejs/apollo-helpers > apollo-link#1.2.14" has unmet peer dependency "graphql#^0.11.3 || ^0.12.3 || ^0.13.0 || ^14.0.0 || ^15.0.0".
remote: warning "#keystonejs/adapter-mongoose > #keystonejs/fields-mongoid > #keystonejs/fields > slate-react > react-immutable-proptypes#2.2.0" has unmet peer dependency "immutable#>=3.6.2".
remote: warning "#keystonejs/adapter-mongoose > #keystonejs/fields-mongoid > #keystonejs/fields > slate-react > slate-prop-types#0.5.44" has unmet peer dependency "immutable#>=3.8.1".
remote: warning "#keystonejs/apollo-helpers > apollo-cache#1.3.5" has unmet peer dependency "graphql#^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
remote: warning "#keystonejs/apollo-helpers > apollo-utilities#1.3.4" has unmet peer dependency "graphql#^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
remote: warning "#keystonejs/apollo-helpers > #apollo/react-components#3.1.5" has unmet peer dependency "graphql#^14.3.1".
remote: warning " > #keystonejs/app-graphql#5.1.7" has unmet peer dependency "express#^4.17.1".
remote: warning "#keystonejs/app-graphql > #keystonejs/app-graphql-playground#5.1.3" has unmet peer dependency "express#^4.17.1".
remote: warning " > apollo-link-http#1.5.17" has unmet peer dependency "graphql#^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
remote: warning "#keystonejs/app-graphql > #keystonejs/app-graphql-playground > #apollographql/graphql-playground-react > react-codemirror#1.0.0" has incorrect peer dependency "react#>=15.5 <16".
remote: warning "#keystonejs/app-graphql > #keystonejs/app-graphql-playground > #apollographql/graphql-playground-react > react-codemirror#1.0.0" has incorrect peer dependency "react-dom#>=15.5 <16".
remote: warning " > react-apollo#3.1.5" has unmet peer dependency "#types/react#^16.8.0".
remote: warning " > react-apollo#3.1.5" has unmet peer dependency "graphql#^14.3.1".
remote: warning "react-apollo > #apollo/react-hoc#3.1.5" has unmet peer dependency "#types/react#^16.8.0".
remote: warning "react-apollo > #apollo/react-hoc#3.1.5" has unmet peer dependency "graphql#^14.3.1".
remote: warning " > styled-components#5.1.1" has unmet peer dependency "react-is#>= 16.8.0".
remote: [4/4] Building fresh packages...
remote: Done in 92.86s.
remote:
remote: -----> Build
remote: Running build (yarn)
remote: yarn run v1.22.4
remote: $ cross-env NODE_ENV=production keystone build
remote: - Initialising Keystone CLI
remote: ℹ Command: keystone build
remote: -
remote: ✔ Validated project entry file ./index.js
remote: - Initialising Keystone instance
remote: ✔ Initialised Keystone instance
remote: - Exporting Keystone build to ./dist
**remote: warn - You have enabled experimental feature(s).
remote:
remote: warn - Experimental features are not covered by semver, and may cause** unexpected or broken application behavior. Use them at your own risk.
remote: Creating an optimized production build...
remote: Attention: Next.js now collects completely anonymous telemetry regarding usage.
remote: This information is used to shape Next.js' roadmap and prioritize features.
remote: You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
remote: https://nextjs.org/telemetry
remote:
remote: > Using external babel configuration
remote: > Location: "/tmp/build_a5f2f47908fc7f68e09dd51d79d5e3f7/app/.babelrc"
remote:
**remote: Failed to compile.
remote:
remote: ./pages/about-us.js
remote: Module not found: Can't resolve 'components/UI/layout' in '/tmp/build_a5f2f47908fc7f68e09dd51d79d5e3f7/app/pages'
remote:
remote: ✖ Exporting Keystone build to ./dist
remote: Error: > Build failed because of webpack errors
remote: at build (/tmp/build_a5f2f47908fc7f68e09dd51d79d5e3f7/node_modules/next/dist/build/index.js:13:917)**
remote: at async Promise.all (index 2)
remote: at async Object.exec (/tmp/build_a5f2f47908fc7f68e09dd51d79d5e3f7/node_modules/#keystonejs/keystone/bin/commands/build.js:42:7)
remote: error Command failed with exit code 1.
remote: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote: If you're stuck, please submit a ticket so we can help:
remote: https://help.heroku.com/
remote:
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to xxxx.
remote:
Yes, I do know that it could be a webpack config error and I don't know what does mean about experimental feature.
keystone.js
const { Keystone } = require('#keystonejs/keystone');
const { PasswordAuthStrategy } = require('#keystonejs/auth-password');
const { GraphQLApp } = require('#keystonejs/app-graphql');
const { AdminUIApp } = require('#keystonejs/app-admin-ui');
const { NextApp } = require('#keystonejs/app-next');
const session = require('express-session');
const MongoStore = require('connect-mongo')(session);
const { UserSchema } = require('./models');
const initialiseData = require('./initial-data');
const { MongooseAdapter: Adapter } = require('#keystonejs/adapter-mongoose');
const PROJECT_NAME = 'Website Name';
const adapterConfig = {
mongoUri: process.env.MONGO_URI,
useNewUrlParser: true,
useFindAndModify: false,
useUnifiedTopology: true,
};
const keystone = new Keystone({
name: PROJECT_NAME,
adapter: new Adapter(adapterConfig),
onConnect: process.env.CREATE_TABLES !== 'true' && initialiseData,
cookieSecret: 'long_secret',
cookie: {
secure: process.env.NODE_ENV === 'production',
maxAge: 1000 * 60 * 60 * 24 * 30,
sameSite: false,
},
secureCookies: false,
sessionStore: new MongoStore({
url: process.env.MONGO_URI,
autoReconnect: true,
secret: 'long_secret',
mongooseConnection: adapterConfig,
autoRemove: 'disabled'
})
});
keystone.createList('User', UserSchema);
const authStrategy = keystone.createAuthStrategy({
type: PasswordAuthStrategy,
list: 'User',
});
module.exports = {
keystone,
apps: [
new GraphQLApp(),
new AdminUIApp({
enableDefaultRoute: false,
authStrategy,
}),
new NextApp({
dir: 'app',
})
],
configureExpress: app => {
app.set('trust proxy', 1);
}
};
I'm not pretty sure what I'm doing wrong, neither witch configuration do I need to do at next.config.js, since the only config that I have is this:
module.exports = {
experimental: {
jsconfigPaths: true,
}
}
with or without it, it gives me the same error, just the route changes and this error only occurs on pages folder
Folder Structure
./app
|– api/
|– apifile.js
|
|– components/
|– ...componentsfiles.js
|
|– hooks/
|– ...hooksfiles.js
|
|– pages/
|– ...pagesfiles.js
|
|– public/
|– assets/
|
|– utils
|– style
|_
|– ...styles.js
|– ...otherutils.js
|
|– .babelrc
|
|– jsconfig.json
|
|– next.config.js
./models/
./index.js (keystone.js)
./initial-data.js
./package.json
and this is my package.json file
{
"name": "xxxx-xxxx",
"description": "xxxx xxxx",
"private": true,
"version": "5.0.7",
"author": "Andler Develops",
"repository": "https://github.com/keystonejs/keystone/tree/master/packages/create-keystone-app/example-projects/starter",
"homepage": "https://github.com/keystonejs/keystone",
"license": "MIT",
"engines": {
"node": "12.12.0",
"yarn": "1.22.4"
},
"scripts": {
"dev": "cross-env NODE_ENV=development DISABLE_LOGGING=true keystone dev",
"build": "cross-env NODE_ENV=production keystone build",
"start": "cross-env NODE_ENV=production keystone start",
"create-tables": "cross-env CREATE_TABLES=true keystone create-tables"
},
"dependencies": {
"#keystonejs/adapter-mongoose": "^8.1.0",
"#keystonejs/apollo-helpers": "^5.1.4",
"#keystonejs/app-admin-ui": "^6.0.0",
"#keystonejs/app-graphql": "^5.1.7",
"#keystonejs/app-next": "^5.1.2",
"#keystonejs/auth-password": "^5.1.7",
"#keystonejs/field-content": "^6.0.1",
"#keystonejs/fields": "^10.0.0",
"#keystonejs/file-adapters": "^6.0.2",
"#keystonejs/keystone": "^9.0.0",
"#material-ui/core": "^4.10.0",
"#material-ui/lab": "^4.0.0-alpha.54",
"#styled-system/theme-get": "^5.1.2",
"aos": "^2.3.4",
"apollo-cache-inmemory": "^1.6.6",
"apollo-client": "^2.6.10",
"apollo-link-http": "^1.5.17",
"connect-mongo": "^3.2.0",
"cross-env": "^7.0.2",
"dotenv": "^8.2.0",
"envy": "^2.0.0",
"express-session": "^1.17.1",
"framer-motion": "^1.11.0",
"graphql-tag": "^2.10.3",
"next": "^9.4.4",
"react": "^16.13.1",
"react-apollo": "^3.1.5",
"react-dom": "^16.13.1",
"react-helmet": "^6.0.0",
"react-icons": "^3.10.0",
"react-lazy-load-image-component": "^1.5.0-beta.0",
"rebass": "^4.0.7",
"slugify": "^1.4.0",
"styled-components": "^5.1.1",
"styled-system": "^5.1.5"
},
"devDependencies": {
"babel-plugin-styled-components": "^1.10.7",
"prettier": "2.0.5"
}
}
I ran into this yesterday, it works locally, but when I deploy it does not and I get the error you're getting. I fixed it by moving my dependencies from my nextjs package.json, to the keystone package.json in the root of my project. I completely deleted my node_modules in the nextjs folder as I guess it just doesn't look at it.
I also didn't have problems on my local machine, but when built in a docker container received the error. I changed versions of the core packages to the ones in the beginner's guide:
"next": "9.3.5",
"react": "16.13.1",
"react-dom": "16.13.1",
I don't know why, but it helped. I lost more than 4 hours debugging this sh**...

google app engine (GAE) ERROR: chown: cannot access '/app/public': No such file or directory

Getting this error form first "gcloud deploy". Project is Laravel app. I've replaces production info with some dummy info in all logs and files.
I've red some older post with the same issue but no response. ¿Anyone having same issue?. I've tested with a new laravel 5.7 installation and getting same error. I've deleted the whole project and created a new GAE project. Don't know what else to try. Also I've tested with a Symfony 4 framework project and same problem.
//file: app.yaml
service: api-dev
runtime: php
env: flex
runtime_config:
document_root: public
front_controller_file: index.php
skip_lockdown_document_root: true #<= this does the trick!!??
#enable_stackdriver_integration: true
# Ensure we skip ".env", which is only for local development
skip_files:
- .env
- .git
env_variables:
# Put production environment variables here.
APP_LOG: errorlog
APP_ENV: local
APP_DEBUG: true
APP_KEY: base64:SECRET
STORAGE_DIR: /tmp
## Set these environment variables according to your CloudSQL configuration.
DB_HOST: localhost
DB_DATABASE: api_db
DB_USERNAME: api_user
DB_PASSWORD: api_pwd
DB_SOCKET: "/cloudsql/YOUR_INSTANCE_NAME"
beta_settings:
# for Cloud SQL, set this value to the Cloud SQL connection name,
# e.g. "project:region:cloudsql-instance"
cloud_sql_instances: "YOUR_INSTANCE_NAME"
My Laravel project composer.json
//composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"tymon/jwt-auth": "0.5.*",
"phpoffice/phpexcel": "1.8.x-dev",
"maatwebsite/excel": "~2.1.0",
"barryvdh/laravel-dompdf": "0.6.*",
"vsmoraes/laravel-pdf": "^1.0",
"laravelcollective/html": "~5.0",
"barryvdh/laravel-snappy": "^0.3.3",
"inacho/php-credit-card-validator": "1.*",
"laravel/envoy": "^1.4"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"symfony/css-selector": "2.8.*|3.0.*",
"symfony/dom-crawler": "2.8.*|3.0.*"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"chmod -R 755 bootstrap\\\/cache",
"php artisan cache:clear"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
And here is the full output of the deploy command:
'gcloud app deploy deploy/dev.yaml --verbosity=debug'
DEBUG: No bucket specified, retrieving default bucket.
DEBUG: Using bucket [gs://staging.ibizi-dev.appspot.com].
DEBUG: Service [appengineflex.googleapis.com] is already enabled for project [ibizi-dev]
Beginning deployment of service [default]...
INFO: Need Dockerfile to be generated for runtime php
Building and pushing image for service [default]
INFO: Uploading [/var/folders/yh/t3v72_f96_9gshbgykw2yp6w0000gn/T/tmpk_BvPn/src.tgz] to [staging.ibizi-dev.appspot.com/eu.gcr.io/ibizi-dev/appengine/default.20181022t152439:latest]
DEBUG: Using runtime builder root [gs://runtime-builders/]
DEBUG: Loading runtimes manifest from [gs://runtime-builders/runtimes.yaml]
INFO: Reading [<googlecloudsdk.api_lib.storage.storage_util.ObjectReference object at 0x110774650>]
DEBUG: Resolved runtime [php] as build configuration [gs://runtime-builders/php-default-builder-20180926113101.yaml]
INFO: Using runtime builder [gs://runtime-builders/php-default-builder-20180926113101.yaml]
INFO: Reading [<googlecloudsdk.api_lib.storage.storage_util.ObjectReference object at 0x11078d150>]
Started cloud build [c874e7e6-d67b-443b-9cc0-169aa6f4dd58].
DEBUG: GCS logfile url is https://www.googleapis.com/storage/v1/b/staging.ibizi-dev.appspot.com/o/log-c874e7e6-d67b-443b-9cc0-169aa6f4dd58.txt?alt=media
To see logs in the Cloud Console: https://console.cloud.google.com/gcr/builds/c874e7e6-d67b-443b-9cc0-169aa6f4dd58?project=702099999392
DEBUG: Operation [operations/build/ibizi-dev/Yzg3NGU3ZTYtZDY3Yi00NDNiLTljYzAtMTY5YWE2ZjRkZDU4] not complete. Waiting 1s.
DEBUG: Reading GCS logfile: 404 (no log yet; keep polling)
DEBUG: Operation [operations/build/ibizi-dev/Yzg3NGU3ZTYtZDY3Yi00NDNiLTljYzAtMTY5YWE2ZjRkZDU4] not complete. Waiting 1s.
DEBUG: Reading GCS logfile: 206 (read 205 bytes)
---------------------------------------------------------------------------------------------------------------------------------- REMOTE BUILD OUTPUT -----------------------------------------------------------------------------------------------------------------------------------
starting build "c874e7e6-d67b-443b-9cc0-169aa6f4dd58"
FETCHSOURCE
Fetching storage object: gs://staging.ibizi-dev.appspot.com/eu.gcr.io/ibizi-dev/appengine/default.20181022t152439:latest#1540214682717948
DEBUG: Operation [operations/build/ibizi-dev/Yzg3NGU3ZTYtZDY3Yi00NDNiLTljYzAtMTY5YWE2ZjRkZDU4] not complete. Waiting 1s.
DEBUG: Reading GCS logfile: 416 (no new content; keep polling)
DEBUG: Operation [operations/build/ibizi-dev/Yzg3NGU3ZTYtZDY3Yi00NDNiLTljYzAtMTY5YWE2ZjRkZDU4] not complete. Waiting 1s.
DEBUG: Reading GCS logfile: 206 (read 529 bytes)
Copying gs://staging.ibizi-dev.appspot.com/eu.gcr.io/ibizi-dev/appengine/default.20181022t152439:latest#1540214682717948...
- [1 files][ 798.0 B/ 798.0 B]
Operation completed over 1 objects/798.0 B.
BUILD
Starting Step #0
Step #0: Pulling image: gcr.io/gcp-runtimes/php/gen-dockerfile#sha256:2528f753fe7726eb4068d7020d11ecc97216b3ab9e4cb7728edda98cd61b410c
DEBUG: Operation [operations/build/ibizi-dev/Yzg3NGU3ZTYtZDY3Yi00NDNiLTljYzAtMTY5YWE2ZjRkZDU4] not complete. Waiting 1s.
DEBUG: Reading GCS logfile: 206 (read 1446 bytes)
Step #0: sha256:2528f753fe7726eb4068d7020d11ecc97216b3ab9e4cb7728edda98cd61b410c: Pulling from gcp-runtimes/php/gen-dockerfile
Step #0: Digest: sha256:2528f753fe7726eb4068d7020d11ecc97216b3ab9e4cb7728edda98cd61b410c
Step #0: Status: Downloaded newer image for gcr.io/gcp-runtimes/php/gen-dockerfile#sha256:2528f753fe7726eb4068d7020d11ecc97216b3ab9e4cb7728edda98cd61b410c
Step #0: + php /builder/create_dockerfile.php create --php72-image gcr.io/google-appengine/php72#sha256:ab499cb6f2419351ee7db259ae88721f9861935659b42007727395b80226a809 --php71-image gcr.io/google-appengine/php71#sha256:d5dbccb1e6dcc6d26c2df23c464f191ea10ef2bf8e9e18e6d13df3c6770b92a1 --php70-image gcr.io/google-appengine/php70#sha256:cf215595a9d4540762724721ab19837abb9af43645963fa0bd29cc31a2960529 --php56-image gcr.io/google-appengine/php56#sha256:0e57acbab18ce2dba8142dff708157ffdacdefbbdfa480d9068382431fd60fb5
Step #0:
Step #0: There is no PHP runtime version specified in composer.json, or
Step #0: we don't support the version you specified. Google App Engine
Step #0: uses the latest 7.2.x version.
Step #0: We recommend pinning your PHP version by running:
Step #0:
Step #0: composer require php 7.2.* (replace it with your desired minor version)
Step #0:
Step #0: Using PHP version 7.2.x...
Step #0:
Finished Step #0
Starting Step #1
Step #1: Pulling image: gcr.io/cloud-builders/docker#sha256:ae2ac38e0aba542add006c47eb4a5820b819f9fa74ada0673d2910387e0f1c0e
DEBUG: Operation [operations/build/ibizi-dev/Yzg3NGU3ZTYtZDY3Yi00NDNiLTljYzAtMTY5YWE2ZjRkZDU4] not complete. Waiting 1s.
DEBUG: Reading GCS logfile: 206 (read 354 bytes)
Step #1: sha256:ae2ac38e0aba542add006c47eb4a5820b819f9fa74ada0673d2910387e0f1c0e: Pulling from cloud-builders/docker
Step #1: e5c573070776: Already exists
Step #1: a7e8e7eaedca: Already exists
Step #1: 3c2cba919283: Already exists
Step #1: 2e2f0b8e1d16: Pulling fs layer
Step #1: 2e2f0b8e1d16: Verifying Checksum
Step #1: 2e2f0b8e1d16: Download complete
DEBUG: Operation [operations/build/ibizi-dev/Yzg3NGU3ZTYtZDY3Yi00NDNiLTljYzAtMTY5YWE2ZjRkZDU4] not complete. Waiting 1s.
DEBUG: Reading GCS logfile: 416 (no new content; keep polling)
DEBUG: Operation [operations/build/ibizi-dev/Yzg3NGU3ZTYtZDY3Yi00NDNiLTljYzAtMTY5YWE2ZjRkZDU4] not complete. Waiting 1s.
DEBUG: Reading GCS logfile: 416 (no new content; keep polling)
DEBUG: Operation [operations/build/ibizi-dev/Yzg3NGU3ZTYtZDY3Yi00NDNiLTljYzAtMTY5YWE2ZjRkZDU4] not complete. Waiting 1s.
DEBUG: Reading GCS logfile: 416 (no new content; keep polling)
DEBUG: Operation [operations/build/ibizi-dev/Yzg3NGU3ZTYtZDY3Yi00NDNiLTljYzAtMTY5YWE2ZjRkZDU4] not complete. Waiting 1s.
DEBUG: Reading GCS logfile: 416 (no new content; keep polling)
DEBUG: Operation [operations/build/ibizi-dev/Yzg3NGU3ZTYtZDY3Yi00NDNiLTljYzAtMTY5YWE2ZjRkZDU4] not complete. Waiting 1s.
DEBUG: Reading GCS logfile: 416 (no new content; keep polling)
DEBUG: Operation [operations/build/ibizi-dev/Yzg3NGU3ZTYtZDY3Yi00NDNiLTljYzAtMTY5YWE2ZjRkZDU4] not complete. Waiting 1s.
DEBUG: Reading GCS logfile: 416 (no new content; keep polling)
DEBUG: Operation [operations/build/ibizi-dev/Yzg3NGU3ZTYtZDY3Yi00NDNiLTljYzAtMTY5YWE2ZjRkZDU4] not complete. Waiting 1s.
DEBUG: Reading GCS logfile: 416 (no new content; keep polling)
DEBUG: Operation [operations/build/ibizi-dev/Yzg3NGU3ZTYtZDY3Yi00NDNiLTljYzAtMTY5YWE2ZjRkZDU4] not complete. Waiting 1s.
DEBUG: Reading GCS logfile: 206 (read 1636 bytes)
Step #1: 2e2f0b8e1d16: Pull complete
Step #1: Digest: sha256:ae2ac38e0aba542add006c47eb4a5820b819f9fa74ada0673d2910387e0f1c0e
Step #1: Status: Downloaded newer image for gcr.io/cloud-builders/docker#sha256:ae2ac38e0aba542add006c47eb4a5820b819f9fa74ada0673d2910387e0f1c0e
Step #1: Sending build context to Docker daemon 5.632kB
Step #1: Step 1/9 : FROM gcr.io/google-appengine/php72#sha256:ab499cb6f2419351ee7db259ae88721f9861935659b42007727395b80226a809
Step #1: sha256:ab499cb6f2419351ee7db259ae88721f9861935659b42007727395b80226a809: Pulling from google-appengine/php72
Step #1: Digest: sha256:ab499cb6f2419351ee7db259ae88721f9861935659b42007727395b80226a809
Step #1: Status: Downloaded newer image for gcr.io/google-appengine/php72#sha256:ab499cb6f2419351ee7db259ae88721f9861935659b42007727395b80226a809
Step #1: ---> 66030c9a7cc4
Step #1: Step 2/9 : ENV DOCUMENT_ROOT='/app/public' ENABLE_STACKDRIVER_INTEGRATION='1' LOG_CHANNEL='stackdriver' APP_LOG='errorlog' APP_ENV='demo' APP_DEBUG='' APP_KEY='base64:+9Lz6fgTo+I5NtJgwNctYuFaaDBNdiL1OpNlhzdPiXs=' STORAGE_DIR='/tmp' DB_HOST='localhost' DB_DATABASE='pms_dev' DB_USERNAME='root' DB_PASSWORD='TMvsds666' DB_SOCKET='/cloudsql/ibizi-dev:europe-west1:pmsapi-dev' FRONT_CONTROLLER_FILE='index.php' COMPOSER_FLAGS='--no-dev --prefer-dist' DETECTED_PHP_VERSION='7.2' IS_BATCH_DAEMON_RUNNING='true'
Step #1: ---> Running in 7594ef12b822
Step #1: Removing intermediate container 7594ef12b822
Step #1: ---> 142b1c897658
Step #1: Step 3/9 : COPY . $APP_DIR
Step #1: ---> f981d2d61e5d
Step #1: Step 4/9 : RUN chown -R www-data.www-data $APP_DIR
Step #1: ---> Running in 2acb68030e93
DEBUG: Operation [operations/build/ibizi-dev/Yzg3NGU3ZTYtZDY3Yi00NDNiLTljYzAtMTY5YWE2ZjRkZDU4] not complete. Waiting 1s.
DEBUG: Reading GCS logfile: 206 (read 363 bytes)
Step #1: Removing intermediate container 2acb68030e93
Step #1: ---> 4725933d3fe3
Step #1: Step 5/9 : RUN /build-scripts/composer.sh
Step #1: ---> Running in d754ce7f2927
Step #1: Removing intermediate container d754ce7f2927
Step #1: ---> 3f19b1e63bed
Step #1: Step 6/9 : RUN /bin/bash /build-scripts/move-config-files.sh
Step #1: ---> Running in 10b9531680b7
DEBUG: Operation [operations/build/ibizi-dev/Yzg3NGU3ZTYtZDY3Yi00NDNiLTljYzAtMTY5YWE2ZjRkZDU4] not complete. Waiting 1s.
DEBUG: Reading GCS logfile: 206 (read 975 bytes)
Step #1: Moving user supplied config files...
Step #1: Removing intermediate container 10b9531680b7
Step #1: ---> 45771fd2253a
Step #1: Step 7/9 : RUN /usr/sbin/nginx -t -c /etc/nginx/nginx.conf
Step #1: ---> Running in 67614392383d
Step #1: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Step #1: nginx: configuration file /etc/nginx/nginx.conf test is successful
Step #1: Removing intermediate container 67614392383d
Step #1: ---> 6d3a14951445
Step #1: Step 8/9 : RUN /bin/bash /build-scripts/lockdown.sh
Step #1: ---> Running in 706cf97d0d6d
Step #1: chown: cannot access '/app/public': No such file or directory
Step #1: Locking down the document root...
Step #1: The command '/bin/sh -c /bin/bash /build-scripts/lockdown.sh' returned a non-zero code: 1
Finished Step #1
ERROR
ERROR: build step 1 "gcr.io/cloud-builders/docker#sha256:ae2ac38e0aba542add006c47eb4a5820b819f9fa74ada0673d2910387e0f1c0e" failed: exit status 1
DEBUG: Operation [operations/build/ibizi-dev/Yzg3NGU3ZTYtZDY3Yi00NDNiLTljYzAtMTY5YWE2ZjRkZDU4] complete. Result: {
"metadata": {
"#type": "type.googleapis.com/google.devtools.cloudbuild.v1.BuildOperationMetadata",
"build": {
"finishTime": "2018-10-22T13:25:11.466503939Z",
"status": "FAILURE",
"timeout": "600s",
"startTime": "2018-10-22T13:24:45.495313971Z",
"artifacts": {
"images": [
"eu.gcr.io/ibizi-dev/appengine/default.20181022t152439:latest"
]
},
"logsBucket": "staging.ibizi-dev.appspot.com",
"results": {
"buildStepImages": [
"",
""
]
},
"id": "c874e7e6-d67b-443b-9cc0-169aa6f4dd58",
"timing": {
"FETCHSOURCE": {
"endTime": "2018-10-22T13:24:51.044559960Z",
"startTime": "2018-10-22T13:24:47.603211198Z"
},
"BUILD": {
"endTime": "2018-10-22T13:25:10.480688954Z",
"startTime": "2018-10-22T13:24:51.120689972Z"
}
},
"source": {
"storageSource": {
"object": "eu.gcr.io/ibizi-dev/appengine/default.20181022t152439:latest",
"bucket": "staging.ibizi-dev.appspot.com"
}
},
"options": {
"substitutionOption": "ALLOW_LOOSE",
"logging": "LEGACY"
},
"steps": [
{
"status": "SUCCESS",
"name": "gcr.io/gcp-runtimes/php/gen-dockerfile#sha256:2528f753fe7726eb4068d7020d11ecc97216b3ab9e4cb7728edda98cd61b410c",
"args": [
"--php72-image",
"gcr.io/google-appengine/php72#sha256:ab499cb6f2419351ee7db259ae88721f9861935659b42007727395b80226a809",
"--php71-image",
"gcr.io/google-appengine/php71#sha256:d5dbccb1e6dcc6d26c2df23c464f191ea10ef2bf8e9e18e6d13df3c6770b92a1",
"--php70-image",
"gcr.io/google-appengine/php70#sha256:cf215595a9d4540762724721ab19837abb9af43645963fa0bd29cc31a2960529",
"--php56-image",
"gcr.io/google-appengine/php56#sha256:0e57acbab18ce2dba8142dff708157ffdacdefbbdfa480d9068382431fd60fb5"
],
"env": [
"GAE_APPLICATION_YAML_PATH=dev.yaml"
],
"timing": {
"endTime": "2018-10-22T13:24:53.076290422Z",
"startTime": "2018-10-22T13:24:51.120719923Z"
},
"pullTiming": {
"endTime": "2018-10-22T13:24:51.939222557Z",
"startTime": "2018-10-22T13:24:51.120719923Z"
}
},
{
"status": "FAILURE",
"name": "gcr.io/cloud-builders/docker#sha256:ae2ac38e0aba542add006c47eb4a5820b819f9fa74ada0673d2910387e0f1c0e",
"args": [
"build",
"-t",
"eu.gcr.io/ibizi-dev/appengine/default.20181022t152439:latest",
"--network=cloudbuild",
"."
],
"env": [
"GAE_APPLICATION_YAML_PATH=dev.yaml"
],
"timing": {
"endTime": "2018-10-22T13:25:10.374276995Z",
"startTime": "2018-10-22T13:24:53.076303098Z"
},
"pullTiming": {
"endTime": "2018-10-22T13:25:06.452731685Z",
"startTime": "2018-10-22T13:24:53.076303098Z"
}
}
],
"sourceProvenance": {
"resolvedStorageSource": {
"generation": "1540214682717948",
"object": "eu.gcr.io/ibizi-dev/appengine/default.20181022t152439:latest",
"bucket": "staging.ibizi-dev.appspot.com"
},
"fileHashes": {
"gs://staging.ibizi-dev.appspot.com/eu.gcr.io/ibizi-dev/appengine/default.20181022t152439:latest#1540214682717948": {}
}
},
"projectId": "ibizi-dev",
"images": [
"eu.gcr.io/ibizi-dev/appengine/default.20181022t152439:latest"
],
"substitutions": {
"_GAE_APPLICATION_YAML_PATH": "dev.yaml",
"_OUTPUT_IMAGE": "eu.gcr.io/ibizi-dev/appengine/default.20181022t152439:latest"
},
"createTime": "2018-10-22T13:24:44.661298334Z",
"logUrl": "https://console.cloud.google.com/gcr/builds/c874e7e6-d67b-443b-9cc0-169aa6f4dd58?project=702099999392"
}
},
"done": true,
"name": "operations/build/ibizi-dev/Yzg3NGU3ZTYtZDY3Yi00NDNiLTljYzAtMTY5YWE2ZjRkZDU4",
"error": {
"message": "Build failed; check build logs for details",
"code": 2
}
}
DEBUG: Reading GCS logfile: 416 (no new content; keep polling)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DEBUG: (gcloud.app.deploy) Cloud build failed. Check logs at https://console.cloud.google.com/gcr/builds/c874e7e6-d67b-443b-9cc0-169aa6f4dd58?project=702099999392 Failure status: UNKNOWN: Error Response: [2] Build failed; check build logs for details
Traceback (most recent call last):
File "/Users/davidpv/Downloads/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 841, in Execute
resources = calliope_command.Run(cli=self, args=args)
File "/Users/davidpv/Downloads/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 770, in Run
resources = command_instance.Run(args)
File "/Users/davidpv/Downloads/google-cloud-sdk/lib/surface/app/deploy.py", line 90, in Run
parallel_build=False)
File "/Users/davidpv/Downloads/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deploy_util.py", line 620, in RunDeploy
flex_image_build_option=flex_image_build_option)
File "/Users/davidpv/Downloads/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deploy_util.py", line 405, in Deploy
image, code_bucket_ref, gcr_domain, flex_image_build_option)
File "/Users/davidpv/Downloads/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deploy_util.py", line 282, in _PossiblyBuildAndPush
self.deploy_options.parallel_build)
File "/Users/davidpv/Downloads/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/deploy_command_util.py", line 449, in BuildAndPushDockerImage
return _SubmitBuild(build, image, project, parallel_build)
File "/Users/davidpv/Downloads/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/deploy_command_util.py", line 482, in _SubmitBuild
build, project=project)
File "/Users/davidpv/Downloads/google-cloud-sdk/lib/googlecloudsdk/api_lib/cloudbuild/build.py", line 150, in ExecuteCloudBuild
self.WaitAndStreamLogs(build_op)
File "/Users/davidpv/Downloads/google-cloud-sdk/lib/googlecloudsdk/api_lib/cloudbuild/build.py", line 195, in WaitAndStreamLogs
+ message)
BuildFailedError: Cloud build failed. Check logs at https://console.cloud.google.com/gcr/builds/c874e7e6-d67b-443b-9cc0-169aa6f4dd58?project=702099999392 Failure status: UNKNOWN: Error Response: [2] Build failed; check build logs for details
ERROR: (gcloud.app.deploy) Cloud build failed. Check logs at https://console.cloud.google.com/gcr/builds/c874e7e6-d67b-443b-9cc0-169aa6f4dd58?project=702099999392 Failure status: UNKNOWN: Error Response: [2] Build failed; check build logs for details
I just found that by adding "skip_lockdown_document_root: true" in the "runtime_config" node it does not fail anymore. Does anyone can explain for dummies what does this action? I haven't found a clear explanation. I'd like to know what's going on under the hood with this "skip_locakdown_document_root" option. I can guess that it does a chmod/chown a that's it, but I'd like to confirm this. Thanks
I had a similar issue, but it happened that I've changed the way I deployed project, and the path was no longer correct.
I used the mentioned "skip_lockdown_document_root" option to be able to start the VM, ssh into it and understand the problem. (I had error 500)

jhipster Project won't build for prod profile : gradlew -Pprod bootWar fails on taks webpack

ISSUE SOLVED see below for infos
after searching for a solutions for 2 days now i give up. I coudn't find a similar issue on the web and i don't know what to do.
Hope somebody can help there...
Issue
The application is building and running fine with gradlew -Pdev bootWar jibDockerBuild
However, the build won't work when selecting the prod profile:
gradlew -Pprod bootWar jibDockerBuild
Reference Exception
ERROR in Illegal State: referring to a type without a variable
{"filePath":"D:/dev/myApp/node_modules/#angular/forms/forms.d.ts",
"name":"FormGroupDirective","members":[]}
FULL EXCEPTION
The following is printed on execution:
D:\dev\myApp>gradlew -Pprod bootWar jibDockerBuild
> Task :yarn_install
yarn install v1.9.4
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents#1.2.4: The platform "win32" is incompatible with this module.
info "fsevents#1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > bootstrap#4.1.3" has unmet peer dependency "jquery#1.9.1 - 3".
warning " > bootstrap#4.1.3" has unmet peer dependency "popper.js#^1.14.3".
warning " > ngx-webstorage#2.0.1" has incorrect peer dependency "#angular/core#^5.0.0".
[5/5] Building fresh packages...
Done in 97.47s.
> Task :webpack
yarn run v1.9.4
$ yarn run cleanup && yarn run webpack:prod:main && yarn run clean-www
$ rimraf build/{aot,www}
$ yarn run webpack --config webpack/webpack.prod.js --profile
$ node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js --config webpack/webpack.prod.js --profile
(node:28256) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
Hash: 6aab3d14e434ee333c51
Version: webpack 4.8.0
Time: 8812ms
Built at: 2018-10-07 18:52:03
6 assets
Entrypoint polyfills = app/polyfills.6aab3d14e434ee333c51.bundle.js
Entrypoint global = global.1e92ecdbfdaf2bb32590.css app/global.6aab3d14e434ee333c51.bundle.js
Entrypoint main = app/main.6aab3d14e434ee333c51.bundle.js
[0] ./src/main/webapp/app/app.main.ts 0 bytes {0} [built]
factory:4638ms building:3545ms = 8183ms
[2] ./src/main/webapp/content/css/global.css 39 bytes {1} [built]
factory:4639ms building:2778ms = 7417ms
[3] ./src/main/webapp/app/polyfills.ts 0 bytes {2} [built]
factory:4638ms building:3540ms = 8178ms
+ 1 hidden module
ERROR in Illegal State: referring to a type without a variable {"filePath":"D:/dev/myApp/node_modules/#angular/forms/forms.d.ts","name":"FormGroupDirective","members":[]}
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
> Task :webpack FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':webpack'.
> Process 'command 'yarn.cmd'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.9/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1m 58s
5 actionable tasks: 3 executed, 2 up-to-date
ENVIRONMENT
Windows 10
Using JHipster version installed locally in current project's node_modules
Executing jhipster:info
Options: from-cli: true
Welcome to the JHipster Information Sub-Generator
JHipster Version(s)
myApp#0.0.0 D:\dev\myApp
`-- generator-jhipster#5.4.1
JHipster configuration, a .yo-rc.json file generated in the root folder
<details>
<summary>.yo-rc.json file</summary>
<pre>
{
"generator-jhipster": {
"promptValues": {
"packageName": "de.myApp.myApp",
"nativeLanguage": "de"
},
"jhipsterVersion": "5.4.1",
"applicationType": "monolith",
"baseName": "myApp",
"packageName": "de.myApp.myApp",
"packageFolder": "de/myApp/myApp",
"serverPort": "8080",
"authenticationType": "session",
"cacheProvider": "ehcache",
"enableHibernateCache": true,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "mysql",
"prodDatabaseType": "mysql",
"searchEngine": false,
"messageBroker": false,
"serviceDiscoveryType": false,
"buildTool": "gradle",
"enableSwaggerCodegen": false,
"rememberMeKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
"clientFramework": "angularX",
"useSass": false,
"clientPackageManager": "yarn",
"testFrameworks": [],
"jhiPrefix": "jhi",
"enableTranslation": true,
"nativeLanguage": "de",
"languages": [
"de",
"en",
"fr"
],
"appsFolders": [
"myApp"
],
"directoryPath": "../",
"monitoring": "elk",
"consoleOptions": [
"curator"
],
"jwtSecretKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons"
}
}
</pre>
</details>
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
SKIPPED
Environment and Tools
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
git version 1.8.4.msysgit.0
node: v8.11.3
npm: 5.6.0
yarn: 1.9.4
Docker version 18.06.1-ce, build e68fc7a
docker-compose version 1.22.0, build f46880fe
I found the cause of the issue:
I obviously placed the ReactiveFormModul imports at the wrong place. I had it in a module "upwards", but actually, I had to place it into the module where I actually have the components defining the form. To be honest ... I don't understand exactly why this is an issue, maybe someone can clarify.
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '#angular/core';
import { RouterModule } from '#angular/router';
import { ReactiveFormsModule } from '#angular/forms';
*** other imports
#NgModule({
imports: [***, ReactiveFormsModule, *** ROUTER stuff,
declarations: [MyReactiveFormComponent],
schemas: [***]
})
export class MyReactiveFormModule {}
After this, I found also other issues that was working fine in the dev-build (again ... don't understand the reason. I guess that has to do with a stricter "compile" configuration):
The variable referencing the formGroup was declared "private". Therefore I got a compile Error on the prod profile. I had to change it so that it can be accessed by the html template.
Variables accessed in html must be public (or accessible by means of a getter method)
Accessing Form Controls in subsequent html elements must be "public"
Code-Example:
MyReactiveComponent.ts:
this.myForm = this.fb.group({
id: [this.myObject.id],
date: [this.myObject.date, Validators.required],
number: [this.myObject.number, [Validators.required, Validators.min(2), Validators.max(100)]],
dynamicOptions: this.fb.array([]),
prefilledOptions: [this.prefilledOptions, Validators.required]
});
MyReactiveComponent.html:
<div class="row justify-content-center">
<div class="col-8">
<form [formGroup]="myForm" id="myFormId" novalidate (ngSubmit)="save()" #editForm="ngForm">
<h2>Create or edit a Play</h2>
<div>
<jhi-alert-error></jhi-alert-error>
<div class="form-group">
<input type="number" class="form-control" formControlName="number" (blur)="updateNumber()" id="field_number" required min="2" jhiMin="2" max="100" jhiMax="100"/>
<div [hidden]="!(number?.dirty && number?.invalid)">
<small class="form-text text-danger"
[hidden]="!number?.errors?.required">
This field is required.
</small>
...
Accessing number in "number?.dirty" for example requires to have a getter-method to be able to access it:
get number() {
return this.myForm.get('number') as FormControl;
}
Hope that helps other when struggling...

How to bundle AWS Cognito within Aurelia Framework

Since my previous post on another question was deleted, even though it was pretty explicit in presenting the problem (in that context), I will try again as a stand alone question.
I am trying to bundle Amazon Cognito with aurelia.json. I have followed everything I could thin of in the answers provided by jsachs and Nathan in the mentioned article, however I think something is incomplete.
{
"name": "account-components-bundle.js",
"source": {
"include": [
"**/components/account/**/*.js",
"**/components/account/**/*.{html,css}"
]
},
"dependencies": [
{
"name": "aws-sdk",
"path": "../node_modules/aws-sdk/dist",
"main": "aws-sdk.min",
"exports": "AWS"
}
],
"prepend": [
"node_modules/aws-sdk/dist/aws-sdk.min.js",
"node_modules/amazon-cognito-identity-js/dist/aws-cognito-sdk.min.js",
"node_modules/amazon-cognito-identity-js/dist/amazon-cognito-identity.min.js",
"node_modules/bluebird/js/browser/bluebird.core.js",
"node_modules/requirejs/require.js"
]
},
If you add only the prepend directive, au build will not throw any error, however I have no way of calling the Cognito classes.
Adding the dependencies directive in the form above will eventually bundle the package, however at page load you will get the following error (please keep in mind I am not calling anything yet within our own code):
Unhandled rejection Error: Script error for "aws-sdk/global", needed by: components/account/login
http://requirejs.org/docs/errors.html#scripterror
at makeError (https://white.dev/dist/aurelia-bundle.js:4419:17)
at HTMLScriptElement.onScriptError (https://white.dev/dist/aurelia-bundle.js:5989:36)
From previous event:
at DefaultLoader.loadModule (https://white.dev/dist/aurelia-bundle.js:14914:14)
at ViewEngine.importViewModelResource (https://white.dev/dist/aurelia-bundle.js:23006:26)
at CompositionEngine.ensureViewModel (https://white.dev/dist/aurelia-bundle.js:24276:32)
at CompositionEngine.createController (https://white.dev/dist/aurelia-bundle.js:24252:19)
at CompositionEngine._createControllerAndSwap (https://white.dev/dist/aurelia-bundle.js:24227:19)
at CompositionEngine.compose (https://white.dev/dist/aurelia-bundle.js:24313:21)
at processInstruction (https://white.dev/dist/aurelia-bundle.js:24798:32)
at Compose.bind (https://white.dev/dist/aurelia-bundle.js:24689:7)
at Controller.bind (https://white.dev/dist/aurelia-bundle.js:23196:24)
at View.bind (https://white.dev/dist/aurelia-bundle.js:21200:24)
at If._runValueChanged (https://white.dev/dist/aurelia-bundle.js:24887:19)
at If.valueChanged (https://white.dev/dist/aurelia-bundle.js:24842:31)
at If.bind (https://white.dev/dist/aurelia-bundle.js:24831:12)
From previous event:
at CompositionEngine._createControllerAndSwap (https://white.dev/dist/aurelia-bundle.js:24227:45)
at CompositionEngine.compose (https://white.dev/dist/aurelia-bundle.js:24313:21)
at TemplatingEngine.compose (https://white.dev/dist/aurelia-bundle.js:24576:38)
at Aurelia.setRoot (https://white.dev/dist/aurelia-bundle.js:13886:21)
at Object._callee$ (https://white.dev/dist/app-bundle.js:86:37)
at tryCatch (https://white.dev/dist/aurelia-bundle.js:3:27199)
at Generator.invoke [as _invoke] (https://white.dev/dist/aurelia-bundle.js:3:28901)
at Generator.t.(anonymous function) [as next] (https://white.dev/dist/aurelia-bundle.js:3:27447)
at step (https://white.dev/dist/app-bundle.js:25:44)
at https://white.dev/dist/app-bundle.js:36:29
From previous event:
at step (https://white.dev/dist/app-bundle.js:35:55)
at https://white.dev/dist/app-bundle.js:43:24
From previous event:
at Object.<anonymous> (https://white.dev/dist/app-bundle.js:22:20)
at Object.configure (https://white.dev/dist/app-bundle.js:97:25)
at https://white.dev/dist/aurelia-bundle.js:12465:29
From previous event:
at config (https://white.dev/dist/aurelia-bundle.js:12460:56)
at https://white.dev/dist/aurelia-bundle.js:12496:14
From previous event:
at bootstrap (https://white.dev/dist/aurelia-bundle.js:12495:26)
at https://white.dev/dist/aurelia-bundle.js:12482:9
at <anonymous>
From previous event:
at run (https://white.dev/dist/aurelia-bundle.js:12477:61)
at Object.<anonymous> (https://white.dev/dist/aurelia-bundle.js:12502:37)
at Object.execCb (https://white.dev/dist/aurelia-bundle.js:5947:33)
at Module.check (https://white.dev/dist/aurelia-bundle.js:5134:51)
at Module.enable (https://white.dev/dist/aurelia-bundle.js:5427:22)
at Object.enable (https://white.dev/dist/aurelia-bundle.js:5808:39)
at Module.<anonymous> (https://white.dev/dist/aurelia-bundle.js:5412:33)
at https://white.dev/dist/aurelia-bundle.js:4385:23
at each (https://white.dev/dist/aurelia-bundle.js:4310:31)
at Module.enable (https://white.dev/dist/aurelia-bundle.js:5364:17)
at Module.init (https://white.dev/dist/aurelia-bundle.js:5039:26)
at https://white.dev/dist/aurelia-bundle.js:5711:36
The moment I go further and try to extend the dependencies (not use the already compiled libraries), I get to the same old problem mentioned in the previous post.
"dependencies": [
{
"name": "lodash",
"path": "../node_modules/lodash",
"main": "index"
},
{
"name": "xmlbuilder",
"path": "../node_modules/xmlbuilder",
"main": "lib/index"
},
{
"name": "aws-sdk",
"path": "../node_modules/aws-sdk",
"main": "lib/aws",
"exports": "AWS"
}
],
This dependencies, when running au build, will lead to
File not found or not accessible: /path/to/project/node_modules/aws-sdk/lib/region_config_data.json.js. Requested by /path/to/project/node_modules/aws-sdk/lib/aws.js
{ Error: ENOENT: no such file or directory, open '/path/to/project/node_modules/aws-sdk/lib/region_config_data.json.js'
at Object.fs.openSync (fs.js:584:18)
at Object.fs.readFileSync (fs.js:491:33)
at Object.exports.readFileSync (/path/to/project/node_modules/aurelia-cli/lib/file-system.js:74:13)
at fileRead (/path/to/project/node_modules/aurelia-cli/lib/build/bundled-source.js:101:27)
at Object.context.fileRead (/path/to/project/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:179:18)
at Object.context.load (/path/to/project/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:370:32)
at Module.load (eval at <anonymous> (/path/to/project/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:832:29)
at Module.fetch (eval at <anonymous> (/path/to/project/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:822:66)
at Module.check (eval at <anonymous> (/path/to/project/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:854:30)
at Module.enable (eval at <anonymous> (/path/to/project/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:1173:22)
errno: -2,
code: 'ENOENT',
syscall: 'open',
I think this is caused by the fact that requirejs in comparison to nodejs require() may not support loading json files and it always expects the file to be a js one.
At this point in my debugging quest I am kinda stuck. Has anyone got any suggestions in how this can be achieved? I would be very grateful.
To avoid and exclude some previous questions to my approaches, I have tried to add to the bundle dependencies "amazon-cognito-identity-js" as well, in more than one form (both dist and lib files). The outcome is the same as the one above. I get stuck at json.js error.
Edit 1
I managed to clean all compile errors with the following form for aurelia.json, however the classes are not loading properly.
"bundles": [
{
"name": "app-bundle.js",
"source": {
"include": [
"**/src/main.js",
"**/src/app.js",
"**/src/environment.js",
"**/src/app.{html,css}"
]
}
},
...
{
"name": "vendor-bundle.js",
"dependencies": [
...
{
"name": "lodash",
"path": "../node_modules/lodash",
"main": "index"
},
{
"name": "xmlbuilder",
"path": "../node_modules/xmlbuilder",
"main": "lib/index"
},
{
"name": "aws-sdk",
"path": "../node_modules/aws-sdk",
"main": "dist/aws-sdk",
"exports": "AWS"
}
],
"append": [
"node_modules/amazon-cognito-identity-js/dist/aws-cognito-sdk.min.js",
"node_modules/amazon-cognito-identity-js/dist/amazon-cognito-identity.min.js"
]
},
...
]
Funny to give the answer myself, but hey... if it will help others...
I managed to bundle the scripts by prepending them in the aurelia-bundle.js ahead of every other scripts that need to be loaded. Please understand, that (for me), placing the scripts in any other position that the following, will end up in neither loading correctly or not loading at all.
Don't pretend this is a general solution, but hey... works for me.
Please find a more detailed history here.
{
"name": "aurelia-bundle.js",
"prepend": [
"node_modules/aws-sdk/dist/aws-sdk.min.js",
"node_modules/amazon-cognito-identity-js/dist/aws-cognito-sdk.min.js",
"node_modules/amazon-cognito-identity-js/dist/amazon-cognito-identity.min.js",
"node_modules/babel-polyfill/dist/polyfill.min.js",
"node_modules/whatwg-fetch/fetch.js",
"node_modules/bluebird/js/browser/bluebird.core.js",
"node_modules/aurelia-cli/lib/resources/scripts/configure-bluebird.js",
"node_modules/requirejs/require.js"
],
"dependencies": [
"aurelia-animator-css",
"aurelia-binding",
"aurelia-bootstrapper",
"aurelia-dependency-injection",
"aurelia-event-aggregator",

Godep cant find gin when pushing go project to PCF-dev

Yesterday my app was pushing fine. When I came back today to push I am having issues where godeps can't find certain dependencies. Im able to godep go install just fine on my local machine, which leads me to believe this is a PCF issue of some type.
go push output:
Starting app business-service in org pcfdev-org / space pcfdev-space as user...
Downloading dotnet_core_buildpack_beta...
Downloading go_buildpack...
Downloading nodejs_buildpack...
Downloading ruby_buildpack...
Downloading staticfile_buildpack...
Downloaded ruby_buildpack
Downloading python_buildpack...
Downloaded go_buildpack
Downloading php_buildpack...
Downloaded nodejs_buildpack
Downloading binary_buildpack...
Downloaded dotnet_core_buildpack_beta
Downloading java_buildpack...
Downloaded binary_buildpack
Downloaded php_buildpack
Downloaded python_buildpack
Downloaded staticfile_buildpack
Downloaded java_buildpack
Creating container
Successfully created container
Downloading app package...
Downloaded app package (9.1K)
Staging...
-------> Buildpack version 1.7.10
file:///tmp/buildpacks/d17226e3d1bc5f728403b1521b69c8ae/dependencies/https___buildpacks.cloudfoundry.org_concourse-binaries_godep_godep-v74-linux-x64.tgz
file:///tmp/buildpacks/d17226e3d1bc5f728403b1521b69c8ae/dependencies/https___buildpacks.cloudfoundry.org_concourse-binaries_glide_glide-v0.11.0-linux-x64.tgz
-----> Checking Godeps/Godeps.json file.
-----> Installing go1.6.3... done
Downloaded [file:///tmp/buildpacks/d17226e3d1bc5f728403b1521b69c8ae/dependencies/https___storage.googleapis.com_golang_go1.6.3.linux-amd64.tar.gz]
!! Installing package '.' (default)
-----> Running: godep go install -v -tags cloudfoundry --buildmode=pie .
server/server.go:4:2: cannot find package "gopkg.in/gin-gonic/gin.v1" in any of:
/tmp/cache/go1.6.3/go/src/gopkg.in/gin-gonic/gin.v1 (from $GOROOT)
/tmp/app/.heroku/go/src/business-service/Godeps/_workspace/src/gopkg.in/gin-gonic/gin.v1 (from $GOPATH)
/tmp/app/.heroku/go/src/gopkg.in/gin-gonic/gin.v1
godep: go exit status 1
Failed to compile droplet
Exit status 223
Staging failed: Exited with status 223
Destroying container
Successfully destroyed container
Godeps.json:
{
"ImportPath": "business-service",
"GoVersion": "go1.6",
"GodepVersion": "v74",
"Deps": [
{
"ImportPath": "github.com/gin-gonic/gin/binding",
"Comment": "v1.0-2-g3900df0",
"Rev": "3900df04d2a88e22beaf6a2970c63648b9e1b0e1"
},
{
"ImportPath": "github.com/gin-gonic/gin/render",
"Comment": "v1.0-2-g3900df0",
"Rev": "3900df04d2a88e22beaf6a2970c63648b9e1b0e1"
},
{
"ImportPath": "github.com/golang/protobuf/proto",
"Rev": "98fa357170587e470c5f27d3c3ea0947b71eb455"
},
{
"ImportPath": "github.com/manucorporat/sse",
"Rev": "ee05b128a739a0fb76c7ebd3ae4810c1de808d6d"
},
{
"ImportPath": "golang.org/x/net/context",
"Rev": "65dfc08770ce66f74becfdff5f8ab01caef4e946"
},
{
"ImportPath": "gopkg.in/gin-gonic/gin.v1",
"Comment": "v1.0",
"Rev": "2dae550eb5392006a4582ce9c90016a9b5a74e8b"
},
{
"ImportPath": "gopkg.in/go-playground/validator.v8",
"Comment": "v8.18.1",
"Rev": "5f57d2222ad794d0dffb07e664ea05e2ee07d60c"
},
{
"ImportPath": "gopkg.in/yaml.v2",
"Rev": "a5b47d31c556af34a302ce5d659e6fea44d90de0"
}
]
}

Resources