DocPad plugin: odd errors when testing, hangs when including in project - coffeescript

I'm trying to write a DocPad plugin to import MongoDB docs into the DocPad database for use in a static website. The source code is at https://github.com/nfriedly/docpad-plugin-mongodb and it's based on https://github.com/docpad/docpad-plugin-tumblr
When I run cake test, I get this output:
cake compile
cake install
npm install (for app)
npm install (for test)
npm install (for docpad tests)
coffee compile
npm test
> docpad-plugin-mongodb#2.0.0 test c:\Users\IBM_ADMIN\docpad-plugin-mongodb
> npm run prepare_test_db && node ./out/mongodb.test.js
> docpad-plugin-mongodb#2.0.0 prepare_test_db c:\Users\IBM_ADMIN\docpad-plugin-mongodb
> mongo test/prepare_database.mongo.js
MongoDB shell version: 2.6.5
connecting to: test
connecting to: docpad_plugin_mongodb_test
mongodb
mongodb > create
notice: If everyone who saw this message donated $1/week, maintaining DocPad would become sustainable: http://docpad.org/donate
error: An error occured:
Error: Didn't place the skeleton as the desired structure already exists
at c:\Users\IBM_ADMIN\docpad-plugin-mongodb\node_modules\docpad\out\lib\docpad.js:4107:17
at Object.cb [as oncomplete] (fs.js:168:19)
error: To report the above error, follow the guide at: http://docpad.org/bug-report
mongodb > create OK
mongodb > load plugin mongodb
mongodb > load plugin mongodb OK
mongodb > generate
mongodb > generate > action
warning: You have multiple files being written to c:\Users\IBM_ADMIN\docpad-plugin-mongodb\test\out\testData\1.json, they are:
- testData/1.json:c7
- testData/1.json:c5
Rename one of them to avoid an over-write
FAILURE: 2/3 tests ran successfully; 0 failed, 1 incomplete, 0 errors
npm ERR! Test failed. See above for more details.
npm ERR! not ok code 0
c:\Users\IBM_ADMIN\docpad-plugin-mongodb\Cakefile:99
throw err;
^
Error: Process exited with error status code
at ChildProcess.<anonymous> (c:\Users\IBM_ADMIN\docpad-plugin-mongodb\Cakefile:88:15)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
And, when I include the module in my project, it just hangs after this:
$ docpad run
info: Welcome to DocPad v6.69.1 (local installation: c:\Users\IBM_ADMIN\watson-developer-cloud\node_modules\docpad
notice: If everyone who saw this message donated $1/week, maintaining DocPad would become sustainable: http://docp
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: eco, mongodb
info: Environment: development
info: DocPad listening to http://0.0.0.0:9778/ on directory c:\Users\IBM_ADMIN\watson-developer-cloud\out
(And if I visit localhost:9778, it just hangs and never loads a page)
It seems like it only displays logs from plugins after the first pass is complete, so I started adding throw statements to see what it was doing. It seems that it imports things from mongo successfully, and it creates the document, but when the plugin calls document.action 'load', (err) ->, that callback is never fired.
Can anyone provide some guidance on what I'm messing up and how to get things working smoothly?

Fixed it. The TaskGroup library (apparently) once had a .once('complete', callback) event that no longer works. Switching it to .done(callback) (and fixing a couple of other small bugs) got me working now.
It still gives me the "Error: Didn't place the skeleton as the desired structure already exists" but the tests all pass now, so I'll call it a win.

Related

Haskell Stack Persistent error, cannot find -llibpq

I have set up a project, which uses Servant and Persistent, using a PostgreSQL backed. Everything works fine, when I run stack ghci, including migration, but when I run stack build, I get the following error:
Linking .stack-work\dist\29cc6475\build\ServantAuthTraining-exe\ServantAuthTraining-exe.exe ...
C://Users//Chris//AppData//Local//Programs//stack//x86_64-windows//ghc-8.8.3//mingw//bin/ld.exe: cannot find -llibpq
collect2.exe: error: ld returned 1 exit status
`gcc.exe' failed in phase `Linker'. (Exit code: 1)
-- While building package ServantAuthTraining-0.1.0.0 using:
C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_3.0.1.0_ghc-8.8.3.exe --builddir=.stack-work\dist\29cc6475 build lib:ServantAuthTraining exe:ServantAuthTraining-exe --ghc-options " -fdiagnostics-color=always"
Process exited with code: ExitFailure 1
I am on windows, and very new to all of the mentioned techs.
I can connect to the database via pgAdmin.
You likely need to pass something like --extra-include-dirs=C:\PostgreSQL\8.4\include --extra-lib-dirs=C:\PostgreSQL\8.4\lib (or whatever path) to stack so it knows where to find libpq. This can also be configured in your stack.yaml as described at https://docs.haskellstack.org/en/latest/yaml_configuration/#extra-include-dirsextra-lib-dirs.

Probot version 7.2 is not starting my app

With probot 7.2, if I create a simple index.js like
module.exports = app => {
app.log('YYYYYYYEEEEEEEEEEEAAAAAAAAAAAHHHHHHHHH it is working!!!!')
}
This export is not working, as when I run the application, I never see my log message. The npm run dev give those log:
> test#1.0.0 dev /tmp/test
> nodemon
[nodemon] 1.18.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: .env *.*
[nodemon] starting `npm start`
> test#1.0.0 start /tmp/test
> probot run ./index.js
08:46:15.243Z INFO probot: Listening on http://localhost:3000
08:46:15.817Z INFO probot:
Welcome to Probot! Go to http://localhost:3000 to get started.
If I downgrade the version to 7.1 it is fine.
Is someone know if there is some (and which) change to do with 7.2 version ?
Just found out why, so I answer myself:
On 7.1 version, there is error when your start probot without the needed env variable.
On 7.2 those errors are not showing. You need to have env variable correctly set else it will simply start but silently fail to load your setup.
The env (or .env file) must define:
APP_ID=...
WEBHOOK_PROXY_URL=...
LOG_LEVEL=...
WEBHOOK_SECRET=...
PRIVATE_KEY=...
The complete possible env variables are defined in the documentation

Yocto Conflict between attempted installs

I have a conflict between a number of install files.
I am getting the below error:
Transaction Summary
================================================================================
Install 612 Packages
Total size: 110 M Installed size: 403 M Downloading Packages: Running
transaction check Transaction check succeeded. Running transaction
test Error: Transaction check error: file /etc/iproute2/rt_protos
conflicts between attempted installs of
base-files-3.0.14-r89.nexbox_a95x_s905x and iproute2-4.14.1-r0.aarch64
file /etc/iproute2/rt_tables conflicts between attempted installs of
base-files-3.0.14-r89.nexbox_a95x_s905x and iproute2-4.14.1-r0.aarch64
file /etc/sysctl.conf conflicts between attempted installs of
base-files-3.0.14-r89.nexbox_a95x_s905x and procps-3.3.12-r0.aarch64
Error Summary
-------------
ERROR: amlogic-image-headless-sd-1.0-r0 do_rootfs: Function failed:
do_rootfs ERROR: Logfile of failure stored in:
/home/user/amlogic-bsp/build/tmp/work/nexbox_a95x_s905x-poky-linux/amlogic-image-headless-sd/1.0-r0/temp/log.do_rootfs.29264
ERROR: Task
(/home/user/amlogic-bsp/meta-meson/recipes-core/images/amlogic-image-headless-sd.bb:do_rootfs)
failed with exit code '1' NOTE: Tasks Summary: Attempted 3131 tasks of
which 3130 didn't need to be rerun and 1 failed.
I have seen somewhere that I should pin a file, but how do I do this? I can't find a tutorial or any reference to what that means.
I am also getting the below warning. Is this related?
WARNING: Layer meson should set LAYERSERIES_COMPAT_meson in its
conf/layer.conf file to list the core layer names it is compatible
with.
I'm new to OE coming over from OpenWRT.
For bitbake, I've added the layers for the packages below:
meta-openwrt:- OE/Yocto metadata layer for OpenWRT
superna9999/meta-meson:- Upstream Linux Amlogic Meson Yocto/OpenEmbedded Layer
And tried compiling the nexbox-a95x-s905x image
I think the problem is that /etc/iproute2/rt_protos is provided by base-files which is coming from meta-openwrt as well as from iproute2 package which is coming from other OE layers. its not clear for the image builder which one to use and hence the conflict
You can solve it via defining a iproute2_%.bbappend file in meta-openwrt where this file gets deleted from iproute2 package and preference is given to the one openwrt provides
do_install_append() {
rm -rf ${D}${sysconfdir}/iproute2/rt_protos
}
should help.

Running meteor from a checkout

I'm trying to run meteor from a checkout following the instructions on the main README: https://github.com/meteor/meteor (under Slow Start.) I'm trying to run the devel branch.
When running normal meteor, it starts up a mongo instance using the database stored in the .meteor directory of the current project. However, the checked out version throws the following error:
W20130729-16:18:46.369(-4)?(STDERR) /home/mao/projects/CrowdMapper/.meteor/local/build/programs/server/boot.js:184
W20130729-16:18:46.370(-4)?(STDERR) }).run();
W20130729-16:18:46.371(-4)?(STDERR) ^
W20130729-16:18:46.393(-4)?(STDERR) Error: MONGO_URL must be set in environment
W20130729-16:18:46.395(-4)?(STDERR) at packages/mongo-livedata/remote_collection_driver.js:32
W20130729-16:18:46.395(-4)?(STDERR) at _.once (packages/underscore/underscore.js:704)
W20130729-16:18:46.396(-4)?(STDERR) at new Meteor.Collection (packages/mongo-livedata/collection.js:65)
W20130729-16:18:46.396(-4)?(STDERR) at packages/service-configuration/service_configuration_common.js:8
W20130729-16:18:46.397(-4)?(STDERR) at packages/service-configuration.js:42:4
W20130729-16:18:46.397(-4)?(STDERR) at packages/service-configuration.js:51:3
W20130729-16:18:46.397(-4)?(STDERR) at mains (/home/mao/projects/CrowdMapper/.meteor/local/build/programs/server/boot.js:153:10)
W20130729-16:18:46.399(-4)?(STDERR) at Array.forEach (native)
W20130729-16:18:46.400(-4)?(STDERR) at Function._.each._.forEach (/home/mao/projects/meteor/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
W20130729-16:18:46.400(-4)?(STDERR) at /home/mao/projects/CrowdMapper/.meteor/local/build/programs/server/boot.js:80:5
How can I tell this version to use the project-local mongo database and start its own mongo instance as before?
This was caused by a breaking change in the devel branch as documented here:
https://groups.google.com/forum/#!topic/meteor-core/xtTlpFqp4to
This is because Meteor 0.6.5-rc's and later don't automatically include core dependencies that were listed for free before. It can be fixed with
meteor add standard-app-packages
or
meteor run-upgrader app-packages

Derby app created using 'derby new test' not working

I've installed derbyjs using npm install -g derby and then created a test app using derby new test.
Then i started the app using node server.js and I got the following output:
info - socket.io started
Starting cluster with 1 workers in undefined mode
`kill -s SIGUSR2 7161` to force cluster reload
Go to: http://localhost:3000/
info - socket.io started
So I tried to request http://localhost:3000/, but the site does not finish loading and I get the following exception:
TEMPLATE ERROR
Error: Model mutation performed after bundling for clientId: 79f4a9f3-25fc-438d-b9f4-a450dccf9566
at Model.errorOnCommit [as _commit] (/web/derby/test/node_modules/derby/node_modules/racer/lib/bundle/bundle.Model.js:64:9)
at /web/derby/test/node_modules/derby/node_modules/racer/lib/txns/txns.Model.js:120:15
at next (/web/derby/test/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
at /web/derby/test/node_modules/derby/node_modules/racer/lib/txns/txns.Model.js:107:16
at next (/web/derby/test/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
at /web/derby/test/node_modules/derby/node_modules/racer/lib/txns/txns.Model.js:101:16
at next (/web/derby/test/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
at /web/derby/test/node_modules/derby/node_modules/racer/lib/txns/txns.Model.js:92:16
at next (/web/derby/test/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
at Object.run (/web/derby/test/node_modules/derby/node_modules/racer/lib/middleware.js:10:12)
events.js:68
throw arguments[1]; // Unhandled 'error' event
^
Error: Cannot write after end
at Gzip.write (zlib.js:311:31)
at ServerResponse.res.write (/web/derby/test/node_modules/express/node_modules/connect/lib/middleware/compress.js:82:18)
at Object.View._render (/web/derby/test/node_modules/derby/lib/View.server.js:337:9)
at /web/derby/test/node_modules/derby/lib/View.server.js:276:10
at Array.2 (/web/derby/test/node_modules/derby/lib/View.server.js:300:5)
at Object.Promise.resolve (/web/derby/test/node_modules/derby/node_modules/racer/lib/util/Promise.js:21:19)
at /web/derby/test/node_modules/derby/lib/View.server.js:136:17
at /web/derby/test/node_modules/derby/lib/files.js:224:7
at Object.oncomplete (fs.js:308:15)
at process._makeCallback (node.js:248:20)
I have absolutely no idea how I can get it running... Is it a bug, or am I doing something wrong?
Update
I've created a bug report on the derby repository: https://github.com/codeparty/derby/issues/170