docs: function executePlugin(webgmeToken, socketId, pluginName, context, callback) {
          var storage,
              errResult,
              pluginContext,
              pluginManager = new PluginNodeManager(webgmeToken, null, logger, gmeConfig, webgmeUrl),
              finish = function (err, result) {
                  if (err) {
                      err = err instanceof Error ? err : new Error(err);
                      logger.error('plugin [' + pluginName + '] failed with error', err);
                      if (!result) {
                          result = pluginManager.getPluginErrorResult(pluginName, pluginName, err.message,
                              context && context.managerConfig && context.managerConfig.project);
                      } else if (!result.error) {
                          result.error = err.message;
                      }
                  } else {
                      logger.debug('plugin [' + pluginName + '] completed');
                  }
  
                  if (storage) {
                      storage.close(function (closeErr) {
                          callback(err || closeErr, result);
                      });
                  } else {
                      callback(err, result);
                  }
              },
              plugin,
              onNotification = function (emitter, event) {
                  if (event.type === storage.CONSTANTS.PLUGIN_NOTIFICATION) {
                      if (event.notification && event.notification.executionId === context.executionId) {
                          if (event.notification.type === storage.CONSTANTS.PLUGIN_NOTIFICATION_TYPE.ABORT) {
                              plugin.onAbort();
                          } else if (event.notification.type === storage.CONSTANTS.PLUGIN_NOTIFICATION_TYPE.MESSAGE) {
                              plugin.onMessage(event.notification.messageId, event.notification.content);
                          }
                      } else {
                          logger.error('Unexpected plugin-notification', new Error(JSON.stringify(event)));
                      }
  
                  }
              };
  
          if (gmeConfig.plugin.allowServerExecution === false) {
              errResult = pluginManager.getPluginErrorResult(pluginName, pluginName,
                  'plugin execution on server side is disabled');
              callback(null, errResult);
              return;
          }
  
          if (typeof pluginName !== 'string' || typeof context !== 'object') {
              errResult = pluginManager.getPluginErrorResult(pluginName, pluginName, 'invalid parameters');
              callback(new Error('invalid parameters'), errResult);
              return;
          }
  
          logger.debug('executePlugin', pluginName, socketId);
  
          logger.debug('executePlugin context', {metadata: context});
          getConnectedStorage(webgmeToken, context.managerConfig.project)
              .then(function (res) {
                  storage = res.storage || res;
                  storage.addEventListener(storage.CONSTANTS.NETWORK_STATUS_CHANGED,
                      getNetworkStatusChangeHandler(finish));
  
  
                  storage.webSocket.addEventListener(storage.CONSTANTS.NOTIFICATION, onNotification);
                  // storage.addEventListener(storage.CONSTANTS.NOTIFICATION, onNotification);
  
                  pluginContext = JSON.parse(JSON.stringify(context.managerConfig));
  
                  pluginContext.project = res.project;
                  if (typeof context.managerConfig.project !== 'string') {
                      throw new Error('Invalid argument, data.projectId is not a string.');
                  }
  
                  logger.debug('Opened project, got branches:', context.managerConfig.project, res.branches);
  
                  if (typeof socketId === 'string') {
                      logger.debug('socketId provided for plugin execution - notifications available.');
                      pluginManager.notificationHandlers = [function (data, callback) {
                          if (data.notification.type && data.notification.type ===
                              STORAGE_CONSTANTS.PLUGIN_NOTIFICATION_TYPE.INITIATED) {
                              data.executionId = context.executionId;
                              data.pluginSocketId = storage.webSocket.socket.id;
                          }
                          data.originalSocketId = socketId;
                          storage.sendNotification(data, callback);
                      }];
                  }
  
                  pluginManager.projectAccess = res.access;
  
                  // pluginManager.executePlugin(pluginName, context.pluginConfig, pluginContext, finish);
  
                  return pluginManager.initializePlugin(pluginName);
              })
              .then(function (plugin_) {
                  plugin = plugin_;
                  return pluginManager.configurePlugin(plugin, context.pluginConfig, pluginContext);
              })
              .then(function () {
                  pluginManager.runPluginMain(plugin, finish);
              })
              .catch(finish)
              .done();
      }