When attempting to deploy a Basic Page node errors are logged in the following order:

Notice: Undefined property: stdClass::$nid in node_access() (line 2847 of /.../modules/node/node.module).

Notice: Undefined index: CONTENT_TYPE in RESTServer->parseRequest() (line 249 of /.../modules/services/servers/rest_server/includes/RESTServer.inc).

Not sure if the content is deployed correctly. The content seems to appear correctly, and no errors are reported by the source server.

Comments

Rory’s picture

Priority: Normal » Minor

Thinking this could be an issue integrating changes with the other modules involved.

aspilicious’s picture

Are you on latest dev (uuid, services and deploy?)
The second notice is not that bad, deploy works with that one.

Did you install UUID services on both sides?

wOOge’s picture

I'm having the same issue — using the latest dev of uuid, services and deploy, on a clean install of drupal 7.12 — just have one content type, same on both sites, and it's a basic, basic content type, with title, body (long text + split).

Using the example endpoints and plans, with the appropriate credentials input into the endpoint — Deploy tells me it's succeeded but I get the original poster's error on the endpoint logs.

let me know if you need any more info to help diagnose.

stongo’s picture

I'm getting the exact same error on the destination server. Using newest dev versions of UUID, Deploy and Services. I am also pushing a node that is of the default Basic Page content type. The source server logs the deployment as a success in watchdog.

Notice: Undefined index: CONTENT_TYPE in RESTServer->parseRequest() (line 249 of /srv/www/dev.mysite.me/html/sites/all/modules/contrib/services/servers/rest_server/includes/RESTServer.inc).

aspilicious’s picture

I also get these errors, but they are services related, so it's no problem.

stongo’s picture

I don't think Deploy is setting the correct headers, according to a similar issue from the Services issue queue.
http://drupal.org/node/1348766

aspilicious’s picture

Ok I'll investigate this when I find some time :)

stongo’s picture

aspilicious, I have some cycles I can put in to investigating this, if you can point me roughly in the right direction to start digging through the code.

aspilicious’s picture

In deploy => plugins => DeployServiceRestJSON.inc the content_type got set.

$this->config['headers']['Content-Type'] = 'application/json';

I wonder why that is put inside the foreach...
Should also work outside of it, normaly...

Maybe it has to be contentType or CONTENT_TYPE or Content_Type...
You should try one of those.

stongo’s picture

I was able to fix the undefined index notice in watchdog by tracing it back to my apache config.
I added this to my httpd.conf:

AddType application/json .json

And this to the source/destination .htaccess files within <IfModule mod_rewrite.c>:

RewriteRule .* - [E=CONTENT_TYPE:%{HTTP:Content-Type},L]

The bad news is that nodes still aren't being created on the destination server.
In watchdog, it seems like Deploy is logging in and then logging out without doing anything else.

aspilicious’s picture

Status: Active » Fixed

Marking this fixed now

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.