Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported on DocPad >= v6.46 #9

Closed
kenhkan opened this issue Sep 18, 2013 · 16 comments
Closed

Unsupported on DocPad >= v6.46 #9

kenhkan opened this issue Sep 18, 2013 · 16 comments

Comments

@kenhkan
Copy link

kenhkan commented Sep 18, 2013

Output from DocPad:

> docpad run
warning: Skipped the unsupported plugin: sunny due to version-plugin
info: Welcome to DocPad v6.46.5
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: cleanurls, coffeescript, eco, jade, less, livereload, marked, partials, related, stylus, text
...
@bobobo1618
Copy link
Owner

See the issue from a few days ago :)

I fixed it up (all it took was a version bump...), all you should need to do is npm update docpad-plugin-sunny or somesuch.

@kenhkan
Copy link
Author

kenhkan commented Sep 18, 2013

Ooops. So sorry man. Will be more careful next time. Could you npm publish? It appears it's still at 0.0.10 on NPM.

@bobobo1618
Copy link
Owner

Oh, that was silly of me... I apparently forgot to publish 🍨

Done now!

@kenhkan
Copy link
Author

kenhkan commented Sep 18, 2013

Sorry to be bugging you again. I'm aware that sunny doesn't work with Node.js > v0.8, but with the latest push it seems to break v0.8 too. Any idea?

> echo $NODE_ENV
production

> docpad --version
6.53.0

> n 0.8.25
> node --version
v0.8.25

> docpad generate --env static
info: Welcome to DocPad v6.53.0, local installation
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: cleanurls, coffeescript, eco, jade, less, livereload, marked, partials, related, stylus, sunny, text
info: Environment: static
info: Generating...
Found 1 configurations in config file.
info: Generated 33/33 files in 4.141 seconds
info: The action completed successfully
info: Shutting down... cya next time!
Got container www.[redacted].com.

events.js:71
        throw arguments[1]; // Unhandled 'error' event
                       ^
TypeError: Cannot call method 'findAllLive' of null
    at DocPad.getFiles (/Website/node_modules/docpad/out/lib/docpad.js:431:34)
    at doUpload (/Website/node_modules/docpad-plugin-sunny/sunny.plugin.js:54:19)
    at handle (/Website/node_modules/docpad-plugin-sunny/sunny.plugin.js:99:16)
    at EventEmitter.emit (events.js:99:17)
    at AuthenticatedRequest.processResults (/Website/node_modules/docpad-plugin-sunny/node_modules/sunny/lib/request.js:453:10)
    at IncomingMessage.AuthenticatedRequest (/Website/node_modules/docpad-plugin-sunny/node_modules/sunny/lib/request.js:427:16)
    at IncomingMessage.EventEmitter.emit (events.js:126:20)
    at IncomingMessage._emitEnd (http.js:367:10)
    at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:149:23)
    at CleartextStream.socketOnData [as ondata] (http.js:1491:20)
    at CleartextStream.CryptoStream._push (tls.js:544:27)
    at SecurePair.cycle (tls.js:898:20)
    at EncryptedStream.CryptoStream.write (tls.js:285:13)
    at Socket.ondata (stream.js:38:26)
    at Socket.EventEmitter.emit (events.js:96:17)
    at TCP.onread (net.js:397:14)
An error occured within the child DocPad instance: exited with a non-zero status code

> n 0.9.12
> node --version
v0.9.12

> docpad generate --env static
info: Welcome to DocPad v6.53.0, local installation
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: cleanurls, coffeescript, eco, jade, less, livereload, marked, partials, related, stylus, sunny, text
info: Environment: static
info: Generating...
Found 1 configurations in config file.
info: Generated 33/33 files in 4.643 seconds
info: The action completed successfully
info: Shutting down... cya next time!
Received error trying to connect to provider: 
 Error: Hostname/IP doesn't match certificate's altnames

> n 0.10.18
> node --version
v0.10.18

> docpad generate --env static
info: Welcome to DocPad v6.53.0, local installation
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: cleanurls, coffeescript, eco, jade, less, livereload, marked, partials, related, stylus, sunny, text
info: Environment: static
info: Generating...
Found 1 configurations in config file.
info: Generated 33/33 files in 9.973 seconds
info: The action completed successfully
info: Shutting down... cya next time!
Received error trying to connect to provider: 
 Error: Hostname/IP doesn't match certificate's altnames

@bobobo1618
Copy link
Owner

Hmm, which cloud service are you using? Are you using S3 with a bucket name
containing periods?
There's another open issue we have a solution for but haven't documented
yet. Basically you need to set your authUrl... Have a look at the last few
comments on the other open ticket. I'm on my phone right now but if that
ticket doesn't help I'll try to get around to that documentation I've been
putting off.
On 19/09/2013 7:24 am, "Kenneth Kan" notifications@github.com wrote:

Sorry to be bugging you again. I'm aware that sunny doesn't work with
Node.js > v0.8, but with the latest push it seems to break v0.8 too. Any
idea?

echo $NODE_ENV
production

docpad --version
6.53.0

n 0.8.25
node --version
v0.8.25

docpad generate --env static
info: Welcome to DocPad v6.53.0, local installation
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: cleanurls, coffeescript, eco, jade, less, livereload, marked, partials, related, stylus, sunny, text
info: Environment: static
info: Generating...
Found 1 configurations in config file.
info: Generated 33/33 files in 4.141 seconds
info: The action completed successfully
info: Shutting down... cya next time!
Got container www.saltyfranks.com.

events.js:71
throw arguments[1]; // Unhandled 'error' event
^
TypeError: Cannot call method 'findAllLive' of null
at DocPad.getFiles (/Website/node_modules/docpad/out/lib/docpad.js:431:34)
at doUpload (/Website/node_modules/docpad-plugin-sunny/sunny.plugin.js:54:19)
at handle (/Website/node_modules/docpad-plugin-sunny/sunny.plugin.js:99:16)
at EventEmitter.emit (events.js:99:17)
at AuthenticatedRequest.processResults (/Website/node_modules/docpad-plugin-sunny/node_modules/sunny/lib/request.js:453:10)
at IncomingMessage.AuthenticatedRequest (/Website/node_modules/docpad-plugin-sunny/node_modules/sunny/lib/request.js:427:16)
at IncomingMessage.EventEmitter.emit (events.js:126:20)
at IncomingMessage._emitEnd (http.js:367:10)
at HTTPParser.parserOnMessageComplete as onMessageComplete
at CleartextStream.socketOnData as ondata
at CleartextStream.CryptoStream._push (tls.js:544:27)
at SecurePair.cycle (tls.js:898:20)
at EncryptedStream.CryptoStream.write (tls.js:285:13)
at Socket.ondata (stream.js:38:26)
at Socket.EventEmitter.emit (events.js:96:17)
at TCP.onread (net.js:397:14)
An error occured within the child DocPad instance: exited with a non-zero status code

n 0.9.12
node --version
v0.9.12

docpad generate --env static
info: Welcome to DocPad v6.53.0, local installation
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: cleanurls, coffeescript, eco, jade, less, livereload, marked, partials, related, stylus, sunny, text
info: Environment: static
info: Generating...
Found 1 configurations in config file.
info: Generated 33/33 files in 4.643 seconds
info: The action completed successfully
info: Shutting down... cya next time!
Received error trying to connect to provider:
Error: Hostname/IP doesn't match certificate's altnames

n 0.10.18
node --version
v0.10.18

docpad generate --env static
info: Welcome to DocPad v6.53.0, local installation
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: cleanurls, coffeescript, eco, jade, less, livereload, marked, partials, related, stylus, sunny, text
info: Environment: static
info: Generating...
Found 1 configurations in config file.
info: Generated 33/33 files in 9.973 seconds
info: The action completed successfully
info: Shutting down... cya next time!
Received error trying to connect to provider:
Error: Hostname/IP doesn't match certificate's altnames


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-24700723
.

@kenhkan
Copy link
Author

kenhkan commented Sep 18, 2013

Hmmm... I've tried setting authUrl to all variants (i.e. s3.amazonaws.com, s3-website-us-east-1.amazonaws.com, [site].s3-website-us-east-1.amazonaws.com) to no avail. Would this be related to authorization at all? I did get the "Got container [site]" message. And the error raised was on findAllLive:

TypeError: Cannot call method 'findAllLive' of null

@bobobo1618
Copy link
Owner

Can you try it with Node v0.10.x? Running docpad with 0.8 gave me all kinds
of weird errors. I'd either downgrade all your packages or give up on 0.8.
Using Node 0.10.x and setting authUrl should hopefully work.
On 19/09/2013 7:28 am, "Lucas Cooper" bobobo1618@gmail.com wrote:

Hmm, which cloud service are you using? Are you using S3 with a bucket
name containing periods?
There's another open issue we have a solution for but haven't documented
yet. Basically you need to set your authUrl... Have a look at the last few
comments on the other open ticket. I'm on my phone right now but if that
ticket doesn't help I'll try to get around to that documentation I've been
putting off.
On 19/09/2013 7:24 am, "Kenneth Kan" notifications@github.com wrote:

Sorry to be bugging you again. I'm aware that sunny doesn't work with
Node.js > v0.8, but with the latest push it seems to break v0.8 too. Any
idea?

echo $NODE_ENV
production

docpad --version
6.53.0

n 0.8.25
node --version
v0.8.25

docpad generate --env static
info: Welcome to DocPad v6.53.0, local installation
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: cleanurls, coffeescript, eco, jade, less, livereload, marked, partials, related, stylus, sunny, text
info: Environment: static
info: Generating...
Found 1 configurations in config file.
info: Generated 33/33 files in 4.141 seconds
info: The action completed successfully
info: Shutting down... cya next time!
Got container www.saltyfranks.com.

events.js:71
throw arguments[1]; // Unhandled 'error' event
^
TypeError: Cannot call method 'findAllLive' of null
at DocPad.getFiles (/Website/node_modules/docpad/out/lib/docpad.js:431:34)
at doUpload (/Website/node_modules/docpad-plugin-sunny/sunny.plugin.js:54:19)
at handle (/Website/node_modules/docpad-plugin-sunny/sunny.plugin.js:99:16)
at EventEmitter.emit (events.js:99:17)
at AuthenticatedRequest.processResults (/Website/node_modules/docpad-plugin-sunny/node_modules/sunny/lib/request.js:453:10)
at IncomingMessage.AuthenticatedRequest (/Website/node_modules/docpad-plugin-sunny/node_modules/sunny/lib/request.js:427:16)
at IncomingMessage.EventEmitter.emit (events.js:126:20)
at IncomingMessage._emitEnd (http.js:367:10)
at HTTPParser.parserOnMessageComplete as onMessageComplete
at CleartextStream.socketOnData as ondata
at CleartextStream.CryptoStream._push (tls.js:544:27)
at SecurePair.cycle (tls.js:898:20)
at EncryptedStream.CryptoStream.write (tls.js:285:13)
at Socket.ondata (stream.js:38:26)
at Socket.EventEmitter.emit (events.js:96:17)
at TCP.onread (net.js:397:14)
An error occured within the child DocPad instance: exited with a non-zero status code

n 0.9.12
node --version
v0.9.12

docpad generate --env static
info: Welcome to DocPad v6.53.0, local installation
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: cleanurls, coffeescript, eco, jade, less, livereload, marked, partials, related, stylus, sunny, text
info: Environment: static
info: Generating...
Found 1 configurations in config file.
info: Generated 33/33 files in 4.643 seconds
info: The action completed successfully
info: Shutting down... cya next time!
Received error trying to connect to provider:
Error: Hostname/IP doesn't match certificate's altnames

n 0.10.18
node --version
v0.10.18

docpad generate --env static
info: Welcome to DocPad v6.53.0, local installation
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: cleanurls, coffeescript, eco, jade, less, livereload, marked, partials, related, stylus, sunny, text
info: Environment: static
info: Generating...
Found 1 configurations in config file.
info: Generated 33/33 files in 9.973 seconds
info: The action completed successfully
info: Shutting down... cya next time!
Received error trying to connect to provider:
Error: Hostname/IP doesn't match certificate's altnames


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-24700723
.

@kenhkan
Copy link
Author

kenhkan commented Sep 18, 2013

Oh I thought sunny didn't work with 0.10! Cool. I actually have two questions now...

  1. Is there a way to connect without setting NODE_TLS_REJECT_UNAUTHORIZED to 0? Node.js doesn't seem to like mismatching certs.
  2. The same error persists on v0.10.18:
> node --version
v0.10.18

> docpad generate --env static
info: Welcome to DocPad v6.53.0, local installation
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: cleanurls, coffeescript, eco, jade, less, livereload, marked, partials, related, stylus, sunny, text
info: Environment: static
info: Generating...
Found 1 configurations in config file.
info: Generated 33/33 files in 4.332 seconds
info: The action completed successfully
info: Shutting down... cya next time!
Got container www.[redacted].com.

/Website/node_modules/docpad/out/lib/docpad.js:431
      files = this.getDatabase().findAllLive(query, sorting, paging);
                                 ^
TypeError: Cannot call method 'findAllLive' of null
    at DocPad.getFiles (/Website/node_modules/docpad/out/lib/docpad.js:431:34)
    at doUpload (/Website/node_modules/docpad-plugin-sunny/sunny.plugin.js:54:19)
    at null.<anonymous> (/Website/node_modules/docpad-plugin-sunny/sunny.plugin.js:99:16)
    at EventEmitter.emit (events.js:98:17)
    at AuthenticatedRequest.processResults (/Website/node_modules/docpad-plugin-sunny/node_modules/sunny/lib/request.js:453:10)
    at IncomingMessage.<anonymous> (/Website/node_modules/docpad-plugin-sunny/node_modules/sunny/lib/request.js:427:16)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:920:16
    at process._tickDomainCallback (node.js:459:13)
An error occured within the child DocPad instance: exited with a non-zero status code

@bobobo1618
Copy link
Owner

Hmm... I'll have a look later. Maybe Docpad has changed the API... Also,
can you try doing a clean Docpad setup in another folder with one of the
base skeletons and see if that helps? Just to ensure that your
configuration isn't out of date or somesuch.

As for the connection without certs thing, not that I know of...
On 19/09/2013 8:13 am, "Kenneth Kan" notifications@github.com wrote:

Oh I thought sunny didn't work with 0.10! Cool. I actually have two
questions now...

  1. Is there a way to connect without setting
    NODE_TLS_REJECT_UNAUTHORIZED to 0? Node.js doesn't seem to like
    mismatching certs.
  2. The same error persists on v0.10.18:

node --version
v0.10.18

docpad generate --env static
info: Welcome to DocPad v6.53.0, local installation
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: cleanurls, coffeescript, eco, jade, less, livereload, marked, partials, related, stylus, sunny, text
info: Environment: static
info: Generating...
Found 1 configurations in config file.
info: Generated 33/33 files in 4.332 seconds
info: The action completed successfully
info: Shutting down... cya next time!
Got container www.[redacted].com.

/Website/node_modules/docpad/out/lib/docpad.js:431
files = this.getDatabase().findAllLive(query, sorting, paging);
^
TypeError: Cannot call method 'findAllLive' of null
at DocPad.getFiles (/Website/node_modules/docpad/out/lib/docpad.js:431:34)
at doUpload (/Website/node_modules/docpad-plugin-sunny/sunny.plugin.js:54:19)
at null. (/Website/node_modules/docpad-plugin-sunny/sunny.plugin.js:99:16)
at EventEmitter.emit (events.js:98:17)
at AuthenticatedRequest.processResults (/Website/node_modules/docpad-plugin-sunny/node_modules/sunny/lib/request.js:453:10)
at IncomingMessage. (/Website/node_modules/docpad-plugin-sunny/node_modules/sunny/lib/request.js:427:16)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:920:16
at process._tickDomainCallback (node.js:459:13)
An error occured within the child DocPad instance: exited with a non-zero status code


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-24703866
.

@kenhkan
Copy link
Author

kenhkan commented Sep 18, 2013

It's sad that I have to report that the same thing happened... Here are the steps I took just in case I'm missing something:

  1. Create a new container on AWS S3
  2. Run mkdir test; cd test; docpad run
  3. Run npm install --save docpad-plugin-sunny
  4. Add to docpad.coffee (somehow GH isn't formatting this right but you get the idea):
  enabledPlugins:
    sunny: true

  plugins:
    sunny:
      configFromEnv: false
      envPrefixes: ["DOCPAD_SUNNY_", "DOCPAD_"]
      authUrl: 'test.docpad.sunny.s3-website-us-east-1.amazonaws.com'
      cloudConfigs: [
        {
          sunny: {
            provider: "aws"
            account: "[redacted]"
            secretKey: "[redacted]"
            ssl: true
          }
          container: 'test.docpad.sunny'
          acl: false # Uses the policy already set on S3.
          retryLimit: -1 # Retry as long as is necessary until the upload works.
        }
      ]
  1. Run NODE_ENV=production docpad generate --env static

Am I missing a step?

On the cert thing, it's cool as long as that's the best way of doing things. :)

@bobobo1618
Copy link
Owner

Okay, I've gone through it all now (and can reproduce the error) and it seems to me that it must be an error in Docpad itself.

/node_modules/docpad/out/lib/docpad.js:431
      files = this.getDatabase().findAllLive(query, sorting, paging);
                                 ^
TypeError: Cannot call method 'findAllLive' of null
    at DocPad.getFiles (/private/tmp/derptest/node_modules/docpad/out/lib/docpad.js:431:34)
    at doUpload (/private/tmp/derptest/node_modules/docpad-plugin-sunny/sunny.plugin.js:54:19)
    at null.<anonymous> (/private/tmp/derptest/node_modules/docpad-plugin-sunny/sunny.plugin.js:99:16)
    at EventEmitter.emit (events.js:98:17)
    at AuthenticatedRequest.processResults (/private/tmp/derptest/node_modules/docpad-plugin-sunny/node_modules/sunny/lib/request.js:453:10)
    at IncomingMessage.<anonymous> (/private/tmp/derptest/node_modules/docpad-plugin-sunny/node_modules/sunny/lib/request.js:427:16)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:910:16
    at process._tickDomainCallback (node.js:459:13)
An error occured within the child DocPad instance: exited with a non-zero status code

This means that this.getDatabase() (in the Docpad code) is returning null, even though it's given a valid instance (I'm using the Docpad instance that Docpad itself passes to my plugin).

So it seems that the issue is with Docpad... Especially considering that this code worked fine until they updated.

@kenhkan
Copy link
Author

kenhkan commented Sep 19, 2013

That's what I suspected too... May I ask what versions of Node.js, DocPad, and docpad-plugin-sunny you use to make it work prior to this? I'm still getting this for DocPad between v6.45 and v6.50:

> NODE_ENV=production docpad generate --env static
info: Welcome to DocPad v6.50.1
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: cleanurls, coffeescript, eco, jade, less, livereload, marked, partials, related, stylus, sunny, text
info: Environment: static
info: Generating...
Found 1 configurations in config file.
info: Generated 33/33 files in 9.871 seconds
info: The action completed successfully
info: Shutting down... cya next time!

@bobobo1618
Copy link
Owner

I can't say, I'm afraid. I haven't actually used Docpad in a very long
time. It should work all the way back to the first versions that had
working plugin support since I think Docpad was still quite new when I
wrote this.
On 19/09/2013 4:23 pm, "Kenneth Kan" notifications@github.com wrote:

That's what I suspected too... May I ask what versions of Node.js, DocPad,
and docpad-plugin-sunny you use to make it work prior to this? I'm still
getting this for DocPad between v6.45 and v6.50:

NODE_ENV=production docpad generate --env static
info: Welcome to DocPad v6.50.1
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: cleanurls, coffeescript, eco, jade, less, livereload, marked, partials, related, stylus, sunny, text
info: Environment: static
info: Generating...
Found 1 configurations in config file.
info: Generated 33/33 files in 9.871 seconds
info: The action completed successfully
info: Shutting down... cya next time!


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-24723690
.

@kenhkan
Copy link
Author

kenhkan commented Sep 21, 2013

@bobobo1618 I see. Thanks for supporting this and not let this become a dormant repo!

@patcon
Copy link
Contributor

patcon commented Oct 29, 2013

FYI, the version bump likely mixed up docpad. You're using 3.0.0, but docpad seems to repurpose the plugin's version to be some indicator of docpad plugin api, and it needs to be 2.0.0, rather than using its engine hash:

http://docpad.org/docs/plugin-write#package-json

The reason reason why we do version 2.0.0 is just a general convention. Version 2 plugins are compatible for with DocPad v6, whereas Version 1 plugins are compatible with DocPad v5 (before DocPad v5 plugins were bundled).

Also, the skipUnsupportedPlugins config was broken, but it should be a workaround after its merged:
docpad/docpad#690

@bobobo1618
Copy link
Owner

Dammit Docpad. God your plugin support pisses me off sometimes. Actually, I don't think I'm going to do anything about this. package.json has a section just for this:

  "engines": {
    "node": ">=0.4.0",
    "docpad": "6.x"
  }

Finds the issue you opened and comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants