I would like deploy my Meteor APP with node-prerender but it failed on 'Verifying Deployment' with mup.
I've not any error, just failed :
- Verifying Deployment
[ [xx.xxx.xxx.xxx] x Verifying Deployment: FAILED
-----------------------------------STDERR-----------------------------------
ib/src/blowfish.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node
COPY Release/bcrypt_lib.node
make: Leaving directory '/bundle/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bcrypt/build'
bcrypt#0.8.7 /bundle/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bcrypt
bindings#1.2.1 /bundle/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bindings
nan#2.3.5 /bundle/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/nan
> buffertools#2.1.4 install /bundle/bundle/programs/server/npm/node_modules/bufferstream/node_modules/buffertools
> node-gyp rebuild
make: Entering directory '/bundle/bundle/programs/server/npm/node_modules/bufferstream/node_modules/buffertools/build'
CXX(target) Release/obj.target/buffertools/buffertools.o
=> Redeploying previous version of the app
-----------------------------------STDOUT-----------------------------------
To see more logs type 'mup logs --tail=50'
----------------------------------------------------------------------------
If i test to deploy my APP without node-prerender, it work nice.
I'm based on this blog post.
My JS call in server :
Meteor.startup(() => {
const prerenderio = Npm.require('prerender-node');
const settings = Meteor.settings.private.PrerenderIO;
if (settings && settings.token && settings.host) {
prerenderio.set('prerenderToken', settings.token);
prerenderio.set('host', settings.host);
prerenderio.set('protocol', 'http');
WebApp.rawConnectHandlers.use(prerenderio);
}
});
I've not error on local.
Do you have any idea ?
Thank you !
Related
I'm following the first example (copy/paste) of custom config file (lint-staged.config.js) for lint-staged packaged from its github README without success. I get error Command failed with exit code 1. always.
I tried this...
I have tried three things, for each case I had my lint-staged.config.js in the root directory.
package.json: result is error Command failed with exit code 1.
"lint-staged": {
"packages/**/*.{ts,tsx}": [
"yarn lint-staged --config ./lint-staged.config.js"
]
},
husky/pre-commit: result is error Command failed with exit code 1.
npx lint-staged --config ../lint-staged.config.js
cmd line: result is error Command failed with exit code 1.
yarn lint-staged --config lint-staged.config.js
The problem
Im just looking for run a custom config file.
The problem is that the execution fails, the error message its related to the command but the command itself its correct as lint-staged [options] (yarn/npx lint-staged -h) then to provide a custom config file it would as lint-staged [--config [path]] but it fails (I even provide all kind of quotes for path).
The issue is that when the module doesn't provide an explicit positive answer to the validation it will always return error Command failed with exit code 1 meaning that the validation has fail.
To properly work as expected it should, in my case:
first, the module had to have a return.
Secondly it should be in form of string array.
Third, the first string of the array had to be terminal-like response as '0' or 'true' of 'false'.
Then, the next following strings could be a message or messages like 'error some A' and 'error some B' and 'error some C' and so on...
For example: ['0', 'error some A', 'error some B', 'error some C']
const path = require("path");
module.exports = (absolutePaths) => {
const cwd = process.cwd();
const relativePaths = absolutePaths.map((file) => path.relative(cwd, file));
console.log("query", relativePaths)
return ['0', 'error some A', 'error some B', 'error some C']
};
This runs ok, but as Andrey Mikhaylov said in this post to run something like
"lint-staged": {
"packages/**/*.{ts,tsx}": [
"yarn lint-staged --config ./lint-staged.config.js"
]
},
If the lint returns an error, It will blow away the staged files causing a regression that will drop the commit completely, which means that all the work will be lost.
I fix this not intended/desired behaviour running the same command yarn lint-staged --config ./lint-staged.config.js but from husky at the pre-commit file as
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
yarn lint-staged --config ./lint-staged.config.js`
I'm trying to get a simple set of e2e tests running on a Gutenberg block. It's from an existing Git repo to demonstrate e2e testing. I haven't made any alterations, but the author hasn't replied so I'm trying myself to get it working.
Below is a single test (I have commented out the others for now until I can get one passing):
import {
createNewPost,
enablePageDialogAccept,
getEditedPostContent,
insertBlock,
} from '#wordpress/e2e-test-utils';
describe( 'Wrapper block', () => {
beforeAll( async () => {
await enablePageDialogAccept();
} );
beforeEach( async () => {
await createNewPost();
} );
it( 'Wrapper block should be available', async () => {
await insertBlock( 'Wrapper Block' );
// Check if block was inserted
expect( await page.$( '[data-type="e2e-tests-example/wrapper-block"]' ) ).not.toBeNull();
expect( await getEditedPostContent() ).toMatchSnapshot();
} );
} );
Below is my package.json with versions and script commands:
{
"name": "e2e-tests-example",
...
"scripts": {
...
"test:e2e": "wp-scripts test-e2e"
},
"wp-env": {
"plugin-dir": "e2e-tests-example",
"plugin-name": "E2E Tests Example",
"docker-template": "./docker-compose.override.yml",
"welcome-logo": [
"E2E Tests Example"
],
"welcome-build-command": "npm run dev"
}
}
When I try to run the e2e tests, it seems that the test environment isn't available so just errors:
PS C:\...\e2e-tests-example-wp-plugin> npm run test:e2e
> e2e-tests-example#1.0.0 test:e2e C:\Users\marty\Sites\nmis-wp\wp-content\plugins\e2e-tests-example-wp-plugin
> wp-scripts test-e2e
FAIL e2e-tests/wrapper-block.spec.js (7.233s)
● Wrapper block › Wrapper block should be available
net::ERR_CONNECTION_REFUSED at http://localhost:8889/wp-admin/post-new.php
at navigate (node_modules/puppeteer/lib/FrameManager.js:120:37)
-- ASYNC --
at Frame.<anonymous> (node_modules/puppeteer/lib/helper.js:111:15)
at Page.goto (node_modules/puppeteer/lib/Page.js:675:49)
at Page.goto (node_modules/puppeteer/lib/helper.js:112:23)
at _callee$ (node_modules/#wordpress/e2e-test-utils/build/#wordpress/e2e-test-utils/src/visit-admin-page.js:20:13)
at tryCatch (node_modules/regenerator-runtime/runtime.js:45:40)
at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:271:22)
at Generator.prototype.(anonymous function) [as next] (node_modules/regenerator-runtime/runtime.js:97:21)
at asyncGeneratorStep (node_modules/#babel/runtime/helpers/asyncToGenerator.js:3:24)
at _next (node_modules/#babel/runtime/helpers/asyncToGenerator.js:25:9)
at node_modules/#babel/runtime/helpers/asyncToGenerator.js:32:7
-- ASYNC --
at Page.goto (node_modules/puppeteer/lib/helper.js:111:15)
at _callee$ (node_modules/#wordpress/e2e-test-utils/build/#wordpress/e2e-test-utils/src/visit-admin-page.js:20:13)
at tryCatch (node_modules/regenerator-runtime/runtime.js:45:40)
at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:271:22)
at Generator.prototype.(anonymous function) [as next] (node_modules/regenerator-runtime/runtime.js:97:21)
at asyncGeneratorStep (node_modules/#babel/runtime/helpers/asyncToGenerator.js:3:24)
at _next (node_modules/#babel/runtime/helpers/asyncToGenerator.js:25:9)
at node_modules/#babel/runtime/helpers/asyncToGenerator.js:32:7
at node_modules/#babel/runtime/helpers/asyncToGenerator.js:21:12
● Wrapper block › Wrapper block should be available
No node found for selector: .edit-post-header [aria-label="Add block"]
at assert (node_modules/puppeteer/lib/helper.js:283:11)
at DOMWorld.click (node_modules/puppeteer/lib/DOMWorld.js:366:5)
-- ASYNC --
at Frame.<anonymous> (node_modules/puppeteer/lib/helper.js:111:15)
at Page.click (node_modules/puppeteer/lib/Page.js:1067:29)
at _callee$ (node_modules/#wordpress/e2e-test-utils/build/#wordpress/e2e-test-utils/src/open-global-block-inserter.js:5:13)
at tryCatch (node_modules/regenerator-runtime/runtime.js:45:40)
at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:271:22)
at Generator.prototype.(anonymous function) [as next] (node_modules/regenerator-runtime/runtime.js:97:21)
at asyncGeneratorStep (node_modules/#babel/runtime/helpers/asyncToGenerator.js:3:24)
at _next (node_modules/#babel/runtime/helpers/asyncToGenerator.js:25:9)
at node_modules/#babel/runtime/helpers/asyncToGenerator.js:32:7
› 3 snapshots obsolete.
• Wrapper block Alignment should be set 1
• Wrapper block Background color should be applied 1
• Wrapper block Margin bottom should be applied 1
FAIL e2e-tests/wrapper-block-filters.spec.js
● Test suite failed to run
Your test suite must contain at least one test.
at node_modules/#jest/core/build/TestScheduler.js:242:24
at asyncGeneratorStep (node_modules/#jest/core/build/TestScheduler.js:131:24)
at _next (node_modules/#jest/core/build/TestScheduler.js:151:9)
at node_modules/#jest/core/build/TestScheduler.js:156:7
at node_modules/#jest/core/build/TestScheduler.js:148:12
at onResult (node_modules/#jest/core/build/TestScheduler.js:271:25)
Snapshot Summary
› 3 snapshots obsolete from 1 test suite. To remove them all, re-run jest with `-u`.
↳ e2e-tests/wrapper-block.spec.js
• Wrapper block Alignment should be set 1
• Wrapper block Background color should be applied 1
• Wrapper block Margin bottom should be applied 1
Test Suites: 2 failed, 2 total
Tests: 1 failed, 1 total
Snapshots: 3 obsolete, 0 total
Ran all test suites.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! e2e-tests-example#1.0.0 test:e2e: `wp-scripts test-e2e`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the e2e-tests-example#1.0.0 test:e2e 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\marty\AppData\Roaming\npm-cache\_logs\2020-09-11T11_17_03_665Z-debug.log
If I've missed any other files that I need to include, let me know. The repo I'm working from can be found here (with all the files) - https://github.com/liip/e2e-tests-example-wp-plugin
I notice there is a docker-compose.override.yml files but no instruction to run any docker containers manually, and no docker-compose.yml files. I'm not finding a ton of resources on e2e testing with gutenberg, just thought it would be nice to work from a working project and learn from that.
I had the exact same issue, but in my case it was happening because there was a port conflict between MAMP and Puppeteer.
To avoid it I was using a custom port for the Docker instance, but Puppeteer was still accessing the default 8889 port.
Tu run the Docker instance on a custom port I used the .wp-env.js file and added to it the port parameter:
{
"core": "WordPress/WordPress",
"plugins": ["."],
"port": 3338
}
Then you start the Docker instance like:
npm run wp-env start
And to run the test on the custom port you can run:
npm run test:e2e -- --wordpress-base-url=http://localhost:3338/
The command above can run the tests against a non Docker environment or in our case on a custom port.
I try to deploy my Symfony application and when I use composer to install dependencies, I get an error.
I saw that there were people who had the same problem but I didn' t find a solution. Like change in .env APP_ENV=dev to APP_ENV=prod.
Here the logs :
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 255
!! PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "DoctrineFixturesBundle" from namespace "Doctrine\Bundle\FixturesBundle".
!! Did you forget a "use" statement for another namespace? in /tmp/build.YZSXu7Ir2b/src/Kernel.php:23
I use DoctrineFixturesBundle only in dev environment :
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.1",
"fzaninotto/faker": "^1.8",
"symfony/profiler-pack": "^1.0"
}
Here my config/bundles.php :
...
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
...
And here Line 23 of Kernel.php :
...
public function registerBundles(): iterable
{
$contents = require $this->getProjectDir().'/config/bundles.php';
foreach ($contents as $class => $envs) {
if ($envs[$this->environment] ?? $envs['all'] ?? false) {
yield new $class(); // line 23
}
}
}
...
if I understand your problem, you just have Composer Install, but the best is to do that composer install --no-dev --optimize-autoloader it's explained Here. Otherwise, I do not know
Please check if directory "vendor/doctrine/doctrine-fixtures-bundle" exists and if there are files inside - specifically the "vendor/doctrine/doctrine-fixtures-bundle/DoctrineFixturesBundle.php"
If they are not there then it seems you didnt executed "composer update" to add the package. In such case please try:
COMPOSER_MEMORY_LIMIT=-1 composer update doctrine/doctrine-fixtures-bundle
You should see something like:
- Installing doctrine/data-fixtures (v1.3.1): Loading from cache
- Installing doctrine/doctrine-fixtures-bundle (3.2.2): Loading from cache
I'm building my .NET Core app in Travis CI using Cake script, when it comes to
var d = new DirectoryInfo(packageOutputPath.ToString());
var Files = d.GetFiles("*.nupkg").Select(x => new FilePath(x.FullName));
var key = EnvironmentVariable("NugetKey");
NuGetPush(Files, new NuGetPushSettings {
Source = Variables.NugetSource,
ApiKey = key
command I get:
An error occurred when executing task 'PushPackage'.
Error: One or more errors occurred. (Permission denied)
Permission denied
My .travis.yml file:
sudo: required
language: csharp
mono: none
dotnet: 2.1.402
before_install:
- chmod +x build.sh
script:
- ./build.sh --Target="PushPackage"
I have tried replacing - ./build.sh --Target="PushPackage" with - sudo bash build.sh --Target="PushPackage" but this did not help. Any suggestions why I'm getting this error?
build.sh file was builded according to this. Whole repo is here.
You should be using the DotNetCoreNuGetPush alias when using the .NET CLI, NuGetPush requires nuget.exe.
Example:
DirectoryPath packageOutputPath = MakeAbsolute(Directory("./nuget/"));
var settings = new DotNetCoreNuGetPushSettings
{
Source = "https://www.example.com/nugetfeed",
ApiKey = "4003d786-cc37-4004-bfdf-c4f3e8ef9b3a"
};
foreach(var file in GetFiles($"{packageOutputPath}/*.nupkg"))
{
DotNetCoreNuGetPush(file.FullPath, settings);
}
Unable to setup nginx-passenger module using chef-solo.. Phusion passenger compile issue.
cookbook 'rvm', '~> 0.9.2'
cookbook 'nginx', '~> 2.7.4'
i have gone through solutions in other similar threads,, but no success yet... any help is highly appreciated..
My Configuration
{
"name": "nginx-server",
"description": "Nginx server",
"default_attributes": {
"rvm": {
"default_ruby":"ruby-2.1.2",
"gems": {
"2.1.2": [
{"name": "bundler"},
{"name": "passenger"},
{"name": "rake"}
]
}
},
"nginx": {
"version": "1.4.1",
"dir" : "/etc/nginx",
"log_dir" : "/var/log/nginx",
"binary": "/opt/nginx-1.4.1/sbin",
"user" : "www-data",
"init_style" : "init",
"source" :{
"modules" : [
"nginx::http_stub_status_module",
"nginx::http_gzip_static_module",
"nginx::passenger"
]
},
"passenger" : {
"version": "3.0.21",
"ruby" : "/usr/local/rvm/rubies/ruby-2.1.2/bin/ruby",
"root" : "/usr/local/rvm/gems/ruby-2.1.2/gems/passenger-3.0.21"
}
}
},
"json_class": "Chef::Role",
"run_list": [
"rvm::system",
"rvm::gem_package",
"nginx::source",
"monit_configs-tlq::nginx"
],
"chef_type": "role",
"override_attributes": {
}
}
Error message: Phusion Passenger support files are not yet compiled. Compiling them for you
adding module in /usr/local/rvm/gems/ruby-2.1.2/gems/passenger-3.0.21/ext/nginx
*** The Phusion Passenger support files are not yet compiled. Compiling them for you... ***
*** Running 'rake nginx RELEASE=yes' in /usr/local/rvm/gems/ruby-2.1.2/gems/passenger-3.0.21/ext/nginx... ***
STDERR: /opt/chef/embedded/bin/rake:9:in `require': no such file to load -- rubygems (LoadError)
from /opt/chef/embedded/bin/rake:9
---- End output of "bash" "/tmp/chef-script20141016-27177-1eqrpme" ----
Ran "bash" "/tmp/chef-script20141016-27177-1eqrpme" returned 1
[2014-10-16T20:45:43+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
ERROR: RuntimeError: chef-solo failed. See output above.
Any idea to solve this,, will be of great help... :)
Many Thanks
Dave
The problem is that you are trying to use the ruby binary from RVM but your path is still setup to use other scripts from the Chef omnibus install. The trace shows rake running the the omnibus folder but ruby from RVM. Fix the PATH environment variable used for the bash recipe or source the RVM shell config in the bash code before running rake. This will likely require forking the above cookbooks unless they have explicit support for each other.