2017-10-24 26 views
5

Mam serwer działający na elastycznej fasoli. Wszystko było w porządku. ale dzisiaj przy stosowaniu aktualizacji (Absolutnie nic wspólnego z konfiguracjami lub wersjami używanych modułów), które było po prostu dodanie kilku słów do jakiegoś tekstu w aplikacji internetowej (dosłownie słowo "pies"). Aplikacja zaczęła się zawiesza z błędami bramy 502 nginx. Zakładam, że dzieje się tak dlatego, że aplikacja nie działa. Poszedłem i zmieniłem zmianę (chociaż nie sądziłem, że muszę to zrobić). a problem utrzymuje się.Żagle nie podnoszą się po prostej aktualizacji

Moje dane wyjściowe podczas próby podniesienia/uruchomienia aplikacji żagle są następujące.

Failed to load helper `web/auth/validate-user-password` as a machine! 
A hook (`helpers`) failed to load! 
Failed to lift app: ImplementationError: Sorry, could not interpret "web/auth/validate-user-password" because its underlying implementation has a problem: 
------------------------------------------------------ 
• The `cacheable` property is no longer supported. (Please use `sideEffects: 'cacheable' instead.) 
------------------------------------------------------ 

If you are the maintainer of "web/auth/validate-user-password", then you can change its implementation to solve the problem above. Otherwise, please file a bug report with the maintainer, or fork your own copy and fix that. 
[?] See https://sailsjs.com/support for help. 
    at flaverr (/var/app/current/node_modules/flaverr/index.js:77:15) 
    at helpBuildMachine (/var/app/current/node_modules/sails/node_modules/machine/lib/private/help-build-machine.js:127:11) 
    at Function.build (/var/app/current/node_modules/sails/node_modules/machine/lib/build.js:52:10) 
    at /var/app/current/node_modules/sails/lib/hooks/helpers/load-helpers.js:51:49 
    at /var/app/current/node_modules/@sailshq/lodash/lib/index.js:3228:15 
    at baseForOwn (/var/app/current/node_modules/@sailshq/lodash/lib/index.js:2199:14) 
    at /var/app/current/node_modules/@sailshq/lodash/lib/index.js:3198:18 
    at Function.<anonymous> (/var/app/current/node_modules/@sailshq/lodash/lib/index.js:3501:13) 
    at /var/app/current/node_modules/sails/lib/hooks/helpers/load-helpers.js:37:9 
    at helpBuildDictionary (/var/app/current/node_modules/sails/node_modules/include-all/lib/help-build-dictionary.js:135:10) 
    at Function.module.exports.optional (/var/app/current/node_modules/sails/node_modules/include-all/index.js:67:10) 
    at Hook.loadHelpers (/var/app/current/node_modules/sails/lib/hooks/helpers/load-helpers.js:21:14) 
    at Hook.initialize (/var/app/current/node_modules/sails/lib/hooks/helpers/index.js:28:19) 
    at Hook.wrapper [as initialize] (/var/app/current/node_modules/@sailshq/lodash/lib/index.js:3250:19) 
    at /var/app/current/node_modules/sails/lib/hooks/index.js:88:16 
    at /var/app/current/node_modules/async/dist/async.js:486:20 
(You are seeing the above error message because no custom callback was programmatically provided to `.lift()`.) 
A hook (`orm`) failed to load! 

To jest to, co widzę w package.json na wypadek, gdyby to pomogło.

{ 
    "name": "sails-xxxxxxx-seed", 
    "private": true, 
    "version": "0.0.3-147", 
    "description": "a Sails application", 
    "keywords": [], 
    "dependencies": { 
    "async": "2.0.1", 
    "aws-sdk": "^2.41.0", 
    "bcryptjs": "2.3.0", 
    "connect-redis": "3.3.0", 
    "flaverr": "^1.1.1", 
    "lodash": "3.10.1", 
    "machinepack-http": "3.1.2", 
    "moment-timezone": "0.5.13", 
    "pdfmake": "0.1.28", 
    "sails": "^1.0.0-32", 
    "sails-hook-orm": "^2.0.0-0", 
    "sails-hook-sockets": "^1.0.1", 
    "sails-mysql": "^1.0.0-13", 
    "sails-stdlib": "^0.7.1", 
    "sails.io.js": "1.1.9", 
    "serve-static": "1.12.3", 
    "socket.io-client": "1.7.3", 
    "socket.io-redis": "3.1.0", 
    "uuid": "3.0.1" 
    }, 
    "devDependencies": { 
    "@angular/animations": "~4.1.3", 
    "@angular/common": "~4.1.3", 
    "@angular/compiler": "~4.1.3", 
    "@angular/compiler-cli": "~4.1.3", 
    "@angular/core": "~4.1.3", 
    "@angular/forms": "~4.1.3", 
    "@angular/http": "~4.1.3", 
    "@angular/platform-browser": "~4.1.3", 
    "@angular/platform-browser-dynamic": "~4.1.3", 
    "@angular/platform-server": "~4.1.3", 
    "@angular/router": "~4.1.3", 
    "@angular/upgrade": "~4.1.3", 
    "@swimlane/ngx-datatable": "^8.0.0", 
    "@types/jasmine": "^2.5.47", 
    "@types/node": "^6.0.48", 
    "angular-pipes": "^6.5.1", 
    "angular-router-loader": "^0.6.0", 
    "angular2-in-memory-web-api": "0.0.21", 
    "angular2-moment": "^1.3.3", 
    "angular2-template-loader": "^0.6.0", 
    "angular2-text-mask": "^8.0.1", 
    "awesome-typescript-loader": "^3.1.2", 
    "babel-core": "^6.25.0", 
    "babel-loader": "^7.0.0", 
    "babel-preset-env": "^1.5.2", 
    "babel-preset-es2015": "^6.24.1", 
    "chart.js": "^2.5.0", 
    "clean-webpack-plugin": "0.1.16", 
    "clipboard": "^1.6.1", 
    "copy-webpack-plugin": "4.0.1", 
    "core-js": "^2.4.1", 
    "css-loader": "0.27.3", 
    "debug": "^2.6.8", 
    "ejs-loader": "0.3.0", 
    "eslint": "3.19.0", 
    "extract-text-webpack-plugin": "2.1.0", 
    "file-loader": "^0.11.1", 
    "glob": "^7.1.1", 
    "ie-shim": "^0.1.0", 
    "json2csv": "^3.7.3", 
    "knex": "0.13.0", 
    "less": "2.7.2", 
    "less-loader": "4.0.1", 
    "mime-types": "2.1.15", 
    "mocha": "^3.2.0", 
    "mydatepicker": "^1.9.2", 
    "ng-sidebar": "^4.1.1", 
    "ng2-charts": "^1.5.0", 
    "ng2-table": "^1.3.2", 
    "ng2-toastr": "^4.0.1", 
    "ng2-validation": "^4.1.0", 
    "ngx-bootstrap": "^1.6.6", 
    "ngx-progressbar": "^2.0.0", 
    "node-sass": "^4.5.2", 
    "primeng": "^4.0.0", 
    "prompt": "1.0.0", 
    "raw-loader": "^0.5.1", 
    "reflect-metadata": "^0.1.3", 
    "rxjs": "5.0.0-beta.12", 
    "sass-loader": "^6.0.3", 
    "semver": "^5.3.0", 
    "to-string-loader": "^1.1.4", 
    "typescript": "~2.2.1", 
    "url-loader": "^0.5.8", 
    "waterline-utils": "^1.3.12", 
    "webpack": "^2.2.1", 
    "webpack-livereload-plugin": "^0.11.0", 
    "webpack-merge": "^0.15.0", 
    "webpack-watch-livereload-plugin": "0.0.1", 
    "zone.js": "~0.6.26" 
    }, 
    "scripts": { 
    "start": "NODE_ENV=production node app.js", 
    "test": "npm run lint && npm run custom-tests && echo 'Done.'", 
    "lint": "node ./node_modules/eslint/bin/eslint . --max-warnings=0 && echo '✔ Your code looks good.'", 
    "custom-tests": "echo \"(No other custom tests yet.)\" && echo", 
    "version": "node -e 'process.stdout.write((require(\"./package.json\").version))'", 
    "bump": "node scripts/bump.js", 
    "debug": "node debug app.js", 
    "deploy-staging": "sails_environment=web_staging npm run bump && sails_environment=web_staging npm run deploy", 
    "deploy-demo": "sails_environment=web_demo npm run bump && npm run deploy", 
    "deploy": "cp -r eb/bootstrap/$sails_environment.sh .ebbootstrap.sh && npm run zip && rm .ebbootstrap.sh && node scripts/publish-static-assets && node scripts/deploy-to-eb", 
    "zip": "mkdir -p .tmp && rm .tmp/deploy.zip &> /dev/null; zip -9 -r --exclude=node_modules/* --exclude=.tmp/* --exclude=.DS_Store --exclude=.git/* --exclude=config/local.js ./.tmp/deploy.zip .", 
    "deploy-alerts-staging": "sails_environment=alerts_staging npm run bump && sails_environment=alerts_staging npm run deploy-alerts", 
    "deploy-alerts": "cp eb/bootstrap/$sails_environment.sh .ebbootstrap.sh && cp eb/apps/alerts/cron.yaml cron.yaml && npm run zip-backend && rm cron.yaml .ebbootstrap.sh && node scripts/deploy-to-eb", 
    "deploy-rollup-staging": "sails_environment=rollup_staging npm run bump && sails_environment=rollup_staging npm run deploy-rollup", 
    "deploy-rollup": "cp eb/bootstrap/$sails_environment.sh .ebbootstrap.sh && cp eb/apps/rollup/cron.yaml cron.yaml && npm run zip-backend && rm cron.yaml .ebbootstrap.sh && node scripts/deploy-to-eb", 
    "deploy-devices-staging": "sails_environment=devices_staging npm run bump && sails_environment=devices_staging npm run deploy-devices", 
    "deploy-devices": "cp eb/bootstrap/$sails_environment.sh .ebbootstrap.sh && npm run zip-backend && rm .ebbootstrap.sh && node scripts/deploy-to-eb", 
    "deploy-device-sim": "cp eb/bootstrap/device_sim.sh .ebbootstrap.sh && cp eb/apps/device-sim/cron.yaml cron.yaml && npm run zip-backend && rm cron.yaml .ebbootstrap.sh && sails_environment=device_sim npm run bump && sails_environment=device_sim node scripts/deploy-to-eb", 
    "zip-backend": "mkdir -p .tmp && rm .tmp/deploy.zip &> /dev/null; zip -9 -r --exclude=node_modules/* --exclude=.tmp/* --exclude=.DS_Store --exclude=.git/* --exclude=src/* --exclude=config/local.js ./.tmp/deploy.zip ." 
    }, 
    "main": "app.js", 
    "repository": { 
    "type": "git", 
    "url": "xxxxxxxxxx.git" 
    }, 
    "author": "xxxxxx", 
    "license": "" 
} 

i poniżej jest zweryfikować-user-password.js

module.exports = { 
    friendlyName: 'Validate user password (strict)', 
    description: 'Strictly validate a string as the potential "password" for a user.', 
    cacheable: true, 
    sync: true, 
    inputs: { 
    string: { 
     description: 'The string to validate as a password.', 
     required: true, 
     example: 'abcd1234', 
    } 
    }, 
    exits: { 
    success: { 
     description: 'The specified string is 100% valid.' 
    }, 
    notValid: { 
     description: 'The specified string is not a valid password.' 
    }, 
    }, 
    fn: function (inputs,exits) { 
    // Coerce 
    ////////////////////////////////////////////////////////////////////////////////////////////////////////// 
    // Since we don't need to support `strict: false` for this validator (it is ALWAYS strict), then we can 
    // just skip this part. (Also no need for the "notStrictlyValid" exit, output from the success exit, 
    // or the `strict` input) 
    // 
    // n/a 
    // Validate 
    ////////////////////////////////////////////////////////////////////////////////////////////////////////// 

    // • Must be long enough. 
    if (inputs.string.length < 7) { 
     return exits.notValid(new Error('Password must consist of at least 7 characters.')); 
    } 

    // • Must not be too long. 
    if (inputs.string.length > 72) { 
     return exits.notValid(new Error('Password must not contain more than 72 characters.')); 
    } 

    return exits.success(); 
    } 
}; 
+1

Czy możliwe było, że moduł związany z samymi żaglami został zaktualizowany, a mój pakiet po instalacji npm zaktualizował go? –

+0

Nie znam przyczyny, ale mogę zaproponować kilka rzeczy, które możesz wypróbować ... czy możesz bezpośrednio "podnieść" aplikację z wiersza poleceń i sprawdzić, czy otrzymasz bardziej przydatne komunikaty o błędach? Czy też podnosiłeś "jako" innego użytkownika (np. Uruchamiał aplikację po zalogowaniu się na serwerze jako inny użytkownik). Czasami spowoduje to, że jakiś moduł nie będzie posiadał uprawnień, które musi obsługiwać. – arbuthnott

+0

Mam ten sam problem. Znalazłeś rozwiązanie? – bzupnick

Odpowiedz

0

Rzeczywiście, jest to prawdopodobnie zmiana w samej żagle, które spowodowały, że. Czy wypróbowałeś następującą konfigurację dla validate-user-password.js?

module.exports = { 
    friendlyName: 'Validate user password (strict)', 
    description: 'Strictly validate a string as the potential "password" for a user.', 
    sideEffects: 'cacheable', 
    sync: true, 
    /* ... rest of content ... */ 
} 
Powiązane problemy