You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Nikhil Khandelwal (JIRA)" <ji...@apache.org> on 2015/11/04 00:00:29 UTC

[jira] [Resolved] (CB-9062) Plugman fails to add owner to the plugin

     [ https://issues.apache.org/jira/browse/CB-9062?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nikhil Khandelwal resolved CB-9062.
-----------------------------------
    Resolution: Won't Fix

> Plugman fails to add owner to the plugin
> ----------------------------------------
>
>                 Key: CB-9062
>                 URL: https://issues.apache.org/jira/browse/CB-9062
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugman
>    Affects Versions: 3.6.3, 5.0.0
>            Reporter: Roman
>
> I am the owner of the `com.paypal.cordova.mobilesdk`  and when trying to execute 
> {code}plugman owner add <username>  com.paypal.cordova.mobilesdk  {code}
> the following error occurs, tried with node 10 and 12. and plugman version 0.23.0 and 0.23.1
> {code}
> render_error function raised error: (new TypeError("tempbody['dist-tags'] is undefined", "updates.package", 12)) 
> stacktrace: ([object Object],[object Object])@updates.package:12
> runUpdate(function (doc, req) {require("monkeypatch").patch(Object, Date, Array, String);var tempbody = JSON.parse(req.body);if (tempbody._npmVersion) {if (tempbody._npmVersion != "1.3.4") {return error("This version of plugman publish is broken, please update plugman with npm install -g plugman@latest.");}} else {var latest = tempbody['dist-tags'].latest;if (latest) {if (tempbody.versions[latest]._npmVersion != "1.3.4") {return error("This version of plugman publish is broken, please update plugman with npm install -g plugman@latest.");}}}var semver = require("semver");var valid = require("valid");
> function error(reason) {return [{_id: "error: forbidden", forbidden: reason}, JSON.stringify({forbidden: reason})];}
> function ok(doc, message) {delete doc.mtime;delete doc.ctime;var time = doc.time = doc.time || {};time.modified = (new Date).toISOString();time.created = time.created || time.modified;for (var v in doc.versions) {var ver = doc.versions[v];delete ver.ctime;delete ver.mtime;time[v] = time[v] || (new Date).toISOString();}return [doc, JSON.stringify({ok: message})];}
> if (doc) {if (req.query.version) {var parsed = semver.valid(req.query.version, true);if (!parsed) {var tag = req.query.version, ver = JSON.parse(req.body);if (!semver.valid(ver)) {return error("setting tag " + tag + " to invalid version: " + req.body);}doc['dist-tags'][tag] = semver.clean(ver, true);return ok(doc, "updated tag");}var ver = req.query.version;if (!semver.valid(ver, true)) {return error("invalid version: " + ver);}if (ver in doc.versions || semver.clean(ver) in doc.versions) {if (!req.query.rev || req.query.rev !== doc._rev) {return error("cannot modify existing version");}}var body = JSON.parse(req.body);if (!valid.name(body.name)) {return error("Invalid name: " + JSON.stringify(body.name));}body.version = semver.clean(body.version, true);ver = semver.clean(ver, true);if (body.version !== ver) {return error("version in doc doesn't match version in request: " + JSON.stringify(body.version) + " !== " + JSON.stringify(ver));}body._id = body.name + "@" + body.version;if (body.description) {doc.description = body.description;}if (body.author) {doc.author = body.author;}if (body.repository) {doc.repository = body.repository;}body.maintainers = doc.maintainers;if (body.publishConfig && typeof body.publishConfig === "object") {Object.keys(body.publishConfig).filter(function (k) {return k.match(/^_/);}).forEach(function (k) {delete body.publishConfig[k];});}var tag = req.query.tag || body.publishConfig && body.publishConfig.tag || body.tag || "latest";if (!req.query.pre) {doc['dist-tags'][tag] = body.version;}if (!doc['dist-tags'].latest) {doc['dist-tags'].latest = body.version;}doc.versions[ver] = body;doc.time = doc.time || {};doc.time[ver] = (new Date).toISOString();return ok(doc, "added version");}var newdoc = JSON.parse(req.body), changed = false;if (doc._rev && doc._rev !== newdoc._rev) {return error("must supply latest _rev to update existing package");}for (var i in newdoc) {if (typeof newdoc[i] === "string" || i === "maintainers") {doc[i] = newdoc[i];}}if (newdoc.versions) {doc.versions = newdoc.versions;}if (newdoc['dist-tags']) {doc['dist-tags'] = newdoc['dist-tags'];}if (newdoc.users) {if (!doc.users) {doc.users = {};}doc.users[req.userCtx.name] = newdoc.users[req.userCtx.name];}return ok(doc, "updated package metadata");} else {doc = JSON.parse(req.body);if (!doc._id) {doc._id = doc.name;}if (!doc.versions) {doc.versions = {};}var latest;for (var v in doc.versions) {if (!semver.valid(v, true)) {return error("Invalid version: " + JSON.stringify(v));}var p = doc.versions[v];if (p.version !== v) {return error("Version mismatch: " + JSON.stringify(v) + " !== " + JSON.stringify(p.version));}if (!valid.name(p.name)) {return error("Invalid name: " + JSON.stringify(p.name));}latest = semver.clean(v, true);}if (!doc['dist-tags']) {doc['dist-tags'] = {};}if (latest) {doc['dist-tags'].latest = latest;}return ok(doc, "created new entry");}},[object Object],[object Array])@/home/ubuntu/hosting/installs/hosting_v1.3.0r1/share/couchdb/server/main.js:961
> (function (doc, req) {require("monkeypatch").patch(Object, Date, Array, String);var tempbody = JSON.parse(req.body);if (tempbody._npmVersion) {if (tempbody._npmVersion != "1.3.4") {return error("This version of plugman publish is broken, please update plugman with npm install -g plugman@latest.");}} else {var latest = tempbody['dist-tags'].latest;if (latest) {if (tempbody.versions[latest]._npmVersion != "1.3.4") {return error("This version of plugman publish is broken, please update plugman with npm install -g plugman@latest.");}}}var semver = require("semver");var valid = require("valid");
> function error(reason) {return [{_id: "error: forbidden", forbidden: reason}, JSON.stringify({forbidden: reason})];}
> function ok(doc, message) {delete doc.mtime;delete doc.ctime;var time = doc.time = doc.time || {};time.modified = (new Date).toISOString();time.created = time.created || time.modified;for (var v in doc.versions) {var ver = doc.versions[v];delete ver.ctime;delete ver.mtime;time[v] = time[v] || (new Date).toISOString();}return [doc, JSON.stringify({ok: message})];}
> if (doc) {if (req.query.version) {var parsed = semver.valid(req.query.version, true);if (!parsed) {var tag = req.query.version, ver = JSON.parse(req.body);if (!semver.valid(ver)) {return error("setting tag " + tag + " to invalid version: " + req.body);}doc['dist-tags'][tag] = semver.clean(ver, true);return ok(doc, "updated tag");}var ver = req.query.version;if (!semver.valid(ver, true)) {return error("invalid version: " + ver);}if (ver in doc.versions || semver.clean(ver) in doc.versions) {if (!req.query.rev || req.query.rev !== doc._rev) {return error("cannot modify existing version");}}var body = JSON.parse(req.body);if (!valid.name(body.name)) {return error("Invalid name: " + JSON.stringify(body.name));}body.version = semver.clean(body.version, true);ver = semver.clean(ver, true);if (body.version !== ver) {return error("version in doc doesn't match version in request: " + JSON.stringify(body.version) + " !== " + JSON.stringify(ver));}body._id = body.name + "@" + body.version;if (body.description) {doc.description = body.description;}if (body.author) {doc.author = body.author;}if (body.repository) {doc.repository = body.repository;}body.maintainers = doc.maintainers;if (body.publishConfig && typeof body.publishConfig === "object") {Object.keys(body.publishConfig).filter(function (k) {return k.match(/^_/);}).forEach(function (k) {delete body.publishConfig[k];});}var tag = req.query.tag || body.publishConfig && body.publishConfig.tag || body.tag || "latest";if (!req.query.pre) {doc['dist-tags'][tag] = body.version;}if (!doc['dist-tags'].latest) {doc['dist-tags'].latest = body.version;}doc.versions[ver] = body;doc.time = doc.time || {};doc.time[ver] = (new Date).toISOString();return ok(doc, "added version");}var newdoc = JSON.parse(req.body), changed = false;if (doc._rev && doc._rev !== newdoc._rev) {return error("must supply latest _rev to update existing package");}for (var i in newdoc) {if (typeof newdoc[i] === "string" || i === "maintainers") {doc[i] = newdoc[i];}}if (newdoc.versions) {doc.versions = newdoc.versions;}if (newdoc['dist-tags']) {doc['dist-tags'] = newdoc['dist-tags'];}if (newdoc.users) {if (!doc.users) {doc.users = {};}doc.users[req.userCtx.name] = newdoc.users[req.userCtx.name];}return ok(doc, "updated package metadata");} else {doc = JSON.parse(req.body);if (!doc._id) {doc._id = doc.name;}if (!doc.versions) {doc.versions = {};}var latest;for (var v in doc.versions) {if (!semver.valid(v, true)) {return error("Invalid version: " + JSON.stringify(v));}var p = doc.versions[v];if (p.version !== v) {return error("Version mismatch: " + JSON.stringify(v) + " !== " + JSON.stringify(p.version));}if (!valid.name(p.name)) {return error("Invalid name: " + JSON.stringify(p.name));}latest = semver.clean(v, true);}if (!doc['dist-tags']) {doc['dist-tags'] = {};}if (latest) {doc['dist-tags'].latest = latest;}return ok(doc, "created new entry");}},[object Object],[object Array])@/home/ubuntu/hosting/installs/hosting_v1.3.0r1/share/couchdb/server/main.js:1031
> ("_design/app",[object Array],[object Array])@/home/ubuntu/hosting/installs/hosting_v1.3.0r1/share/couchdb/server/main.js:1505
> ()@/home/ubuntu/hosting/installs/hosting_v1.3.0r1/share/couchdb/server/main.js:1550
> @/home/ubuntu/hosting/installs/hosting_v1.3.0r1/share/couchdb/server/main.js:1561
> @:0
> : com.paypal.cordova.mobilesdk/-rev/23-1c12c8007517f5366cdf895200065307 Error: render_error function raised error: (new TypeError("tempbody['dist-tags'] is undefined", "updates.package", 12)) 
> stacktrace: ([object Object],[object Object])@updates.package:12
> runUpdate(function (doc, req) {require("monkeypatch").patch(Object, Date, Array, String);var tempbody = JSON.parse(req.body);if (tempbody._npmVersion) {if (tempbody._npmVersion != "1.3.4") {return error("This version of plugman publish is broken, please update plugman with npm install -g plugman@latest.");}} else {var latest = tempbody['dist-tags'].latest;if (latest) {if (tempbody.versions[latest]._npmVersion != "1.3.4") {return error("This version of plugman publish is broken, please update plugman with npm install -g plugman@latest.");}}}var semver = require("semver");var valid = require("valid");
> function error(reason) {return [{_id: "error: forbidden", forbidden: reason}, JSON.stringify({forbidden: reason})];}
> function ok(doc, message) {delete doc.mtime;delete doc.ctime;var time = doc.time = doc.time || {};time.modified = (new Date).toISOString();time.created = time.created || time.modified;for (var v in doc.versions) {var ver = doc.versions[v];delete ver.ctime;delete ver.mtime;time[v] = time[v] || (new Date).toISOString();}return [doc, JSON.stringify({ok: message})];}
> if (doc) {if (req.query.version) {var parsed = semver.valid(req.query.version, true);if (!parsed) {var tag = req.query.version, ver = JSON.parse(req.body);if (!semver.valid(ver)) {return error("setting tag " + tag + " to invalid version: " + req.body);}doc['dist-tags'][tag] = semver.clean(ver, true);return ok(doc, "updated tag");}var ver = req.query.version;if (!semver.valid(ver, true)) {return error("invalid version: " + ver);}if (ver in doc.versions || semver.clean(ver) in doc.versions) {if (!req.query.rev || req.query.rev !== doc._rev) {return error("cannot modify existing version");}}var body = JSON.parse(req.body);if (!valid.name(body.name)) {return error("Invalid name: " + JSON.stringify(body.name));}body.version = semver.clean(body.version, true);ver = semver.clean(ver, true);if (body.version !== ver) {return error("version in doc doesn't match version in request: " + JSON.stringify(body.version) + " !== " + JSON.stringify(ver));}body._id = body.name + "@" + body.version;if (body.description) {doc.description = body.description;}if (body.author) {doc.author = body.author;}if (body.repository) {doc.repository = body.repository;}body.maintainers = doc.maintainers;if (body.publishConfig && typeof body.publishConfig === "object") {Object.keys(body.publishConfig).filter(function (k) {return k.match(/^_/);}).forEach(function (k) {delete body.publishConfig[k];});}var tag = req.query.tag || body.publishConfig && body.publishConfig.tag || body.tag || "latest";if (!req.query.pre) {doc['dist-tags'][tag] = body.version;}if (!doc['dist-tags'].latest) {doc['dist-tags'].latest = body.version;}doc.versions[ver] = body;doc.time = doc.time || {};doc.time[ver] = (new Date).toISOString();return ok(doc, "added version");}var newdoc = JSON.parse(req.body), changed = false;if (doc._rev && doc._rev !== newdoc._rev) {return error("must supply latest _rev to update existing package");}for (var i in newdoc) {if (typeof newdoc[i] === "string" || i === "maintainers") {doc[i] = newdoc[i];}}if (newdoc.versions) {doc.versions = newdoc.versions;}if (newdoc['dist-tags']) {doc['dist-tags'] = newdoc['dist-tags'];}if (newdoc.users) {if (!doc.users) {doc.users = {};}doc.users[req.userCtx.name] = newdoc.users[req.userCtx.name];}return ok(doc, "updated package metadata");} else {doc = JSON.parse(req.body);if (!doc._id) {doc._id = doc.name;}if (!doc.versions) {doc.versions = {};}var latest;for (var v in doc.versions) {if (!semver.valid(v, true)) {return error("Invalid version: " + JSON.stringify(v));}var p = doc.versions[v];if (p.version !== v) {return error("Version mismatch: " + JSON.stringify(v) + " !== " + JSON.stringify(p.version));}if (!valid.name(p.name)) {return error("Invalid name: " + JSON.stringify(p.name));}latest = semver.clean(v, true);}if (!doc['dist-tags']) {doc['dist-tags'] = {};}if (latest) {doc['dist-tags'].latest = latest;}return ok(doc, "created new entry");}},[object Object],[object Array])@/home/ubuntu/hosting/installs/hosting_v1.3.0r1/share/couchdb/server/main.js:961
> (function (doc, req) {require("monkeypatch").patch(Object, Date, Array, String);var tempbody = JSON.parse(req.body);if (tempbody._npmVersion) {if (tempbody._npmVersion != "1.3.4") {return error("This version of plugman publish is broken, please update plugman with npm install -g plugman@latest.");}} else {var latest = tempbody['dist-tags'].latest;if (latest) {if (tempbody.versions[latest]._npmVersion != "1.3.4") {return error("This version of plugman publish is broken, please update plugman with npm install -g plugman@latest.");}}}var semver = require("semver");var valid = require("valid");
> function error(reason) {return [{_id: "error: forbidden", forbidden: reason}, JSON.stringify({forbidden: reason})];}
> function ok(doc, message) {delete doc.mtime;delete doc.ctime;var time = doc.time = doc.time || {};time.modified = (new Date).toISOString();time.created = time.created || time.modified;for (var v in doc.versions) {var ver = doc.versions[v];delete ver.ctime;delete ver.mtime;time[v] = time[v] || (new Date).toISOString();}return [doc, JSON.stringify({ok: message})];}
> if (doc) {if (req.query.version) {var parsed = semver.valid(req.query.version, true);if (!parsed) {var tag = req.query.version, ver = JSON.parse(req.body);if (!semver.valid(ver)) {return error("setting tag " + tag + " to invalid version: " + req.body);}doc['dist-tags'][tag] = semver.clean(ver, true);return ok(doc, "updated tag");}var ver = req.query.version;if (!semver.valid(ver, true)) {return error("invalid version: " + ver);}if (ver in doc.versions || semver.clean(ver) in doc.versions) {if (!req.query.rev || req.query.rev !== doc._rev) {return error("cannot modify existing version");}}var body = JSON.parse(req.body);if (!valid.name(body.name)) {return error("Invalid name: " + JSON.stringify(body.name));}body.version = semver.clean(body.version, true);ver = semver.clean(ver, true);if (body.version !== ver) {return error("version in doc doesn't match version in request: " + JSON.stringify(body.version) + " !== " + JSON.stringify(ver));}body._id = body.name + "@" + body.version;if (body.description) {doc.description = body.description;}if (body.author) {doc.author = body.author;}if (body.repository) {doc.repository = body.repository;}body.maintainers = doc.maintainers;if (body.publishConfig && typeof body.publishConfig === "object") {Object.keys(body.publishConfig).filter(function (k) {return k.match(/^_/);}).forEach(function (k) {delete body.publishConfig[k];});}var tag = req.query.tag || body.publishConfig && body.publishConfig.tag || body.tag || "latest";if (!req.query.pre) {doc['dist-tags'][tag] = body.version;}if (!doc['dist-tags'].latest) {doc['dist-tags'].latest = body.version;}doc.versions[ver] = body;doc.time = doc.time || {};doc.time[ver] = (new Date).toISOString();return ok(doc, "added version");}var newdoc = JSON.parse(req.body), changed = false;if (doc._rev && doc._rev !== newdoc._rev) {return error("must supply latest _rev to update existing package");}for (var i in newdoc) {if (typeof newdoc[i] === "string" || i === "maintainers") {doc[i] = newdoc[i];}}if (newdoc.versions) {doc.versions = newdoc.versions;}if (newdoc['dist-tags']) {doc['dist-tags'] = newdoc['dist-tags'];}if (newdoc.users) {if (!doc.users) {doc.users = {};}doc.users[req.userCtx.name] = newdoc.users[req.userCtx.name];}return ok(doc, "updated package metadata");} else {doc = JSON.parse(req.body);if (!doc._id) {doc._id = doc.name;}if (!doc.versions) {doc.versions = {};}var latest;for (var v in doc.versions) {if (!semver.valid(v, true)) {return error("Invalid version: " + JSON.stringify(v));}var p = doc.versions[v];if (p.version !== v) {return error("Version mismatch: " + JSON.stringify(v) + " !== " + JSON.stringify(p.version));}if (!valid.name(p.name)) {return error("Invalid name: " + JSON.stringify(p.name));}latest = semver.clean(v, true);}if (!doc['dist-tags']) {doc['dist-tags'] = {};}if (latest) {doc['dist-tags'].latest = latest;}return ok(doc, "created new entry");}},[object Object],[object Array])@/home/ubuntu/hosting/installs/hosting_v1.3.0r1/share/couchdb/server/main.js:1031
> ("_design/app",[object Array],[object Array])@/home/ubuntu/hosting/installs/hosting_v1.3.0r1/share/couchdb/server/main.js:1505
> ()@/home/ubuntu/hosting/installs/hosting_v1.3.0r1/share/couchdb/server/main.js:1550
> @/home/ubuntu/hosting/installs/hosting_v1.3.0r1/share/couchdb/server/main.js:1561
> @:0
> : com.paypal.cordova.mobilesdk/-rev/23-1c12c8007517f5366cdf895200065307
>     at RegClient.<anonymous> (/usr/local/lib/node_modules/plugman/node_modules/npm/node_modules/npm-registry-client/lib/request.js:272:14)
>     at Request.self.callback (/usr/local/lib/node_modules/plugman/node_modules/npm/node_modules/request/index.js:148:22)
>     at Request.emit (events.js:110:17)
>     at Request.<anonymous> (/usr/local/lib/node_modules/plugman/node_modules/npm/node_modules/request/index.js:876:14)
>     at Request.emit (events.js:129:20)
>     at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/plugman/node_modules/npm/node_modules/request/index.js:827:12)
>     at IncomingMessage.emit (events.js:129:20)
>     at _stream_readable.js:908:16
>     at process._tickCallback (node.js:355:11)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org