Utilizing DeployR Server and the Javascript API yields a message of 'Project in Use' for large data returns

Let me start by saying that I primarily work with JavaScript, but recently I've delved into a project involving R/DeployR, so my expertise in this area is still limited to what I've learned in the past few months.

In this project, I am using the DeployR JavaScript API in Node.js to connect to DeployR Open Edition 7.4.1.

Recently, I encountered an error that has puzzled both myself and the data engineer I'm working with. This issue seems to arise only when handling a large amount of data, specifically databases with more than 28,000 rows.

To gain more insights into the process and pinpoint the issue, I decided to integrate PubNub for logging purposes. Here's a brief summary of what's happening and the specific problem I'm trying to resolve.

Process: The Node.js application sends a request through the JavaScript API to run an R Script that processes the data using various algorithms. The R script then iterates through each algorithm with a for loop.

Issue: The problem arises during the third iteration of the loop when DeployR sends an error back to the JavaScript API, which then forwards the error message as JSON to the application. Strangely, even though an error is flagged, the script continues to run and eventually reports completion through PubNub. At this point, the expected data object is returned, triggering the .end function in the JavaScript API, but resulting in an empty response. It's perplexing that the error occurs yet the R Script proceeds without interruption.

Error Message:

{ get: [Function],
  deployr: 
   { response: 
      { success: false,
        call: '/r/project/execute/script',
        errorCode: 403,
        error: '403: Project currently in-use by node_api, call rejected.\n' } } }

Answer №1

After facing a challenging problem, we successfully identified that the DeployR server was ending before the R script, which was quite complex, could finish generating the data. As a result, the subsequent call to load the project failed.

This issue arose primarily due to developing an application on a larger scale than DeployR was originally designed to support. However, we overcame this obstacle by integrating PubNub - a similar monitoring feature that alerts a node (or any front end) environment when the R script has completed its execution. This solution worked like a charm!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Delete the value from the array and refresh the HTML with the updated total amount, or display '$' if there is no total amount

Currently, I have two inputs: debit and credit. On button click events, they update an array called 'debits'. Debit adds positive values while credit adds negative values. The next step is to sum the values in the array and assign it to a variab ...

Give drawn elements a touch of fuzziness and experiment with the color of the fragment shader

I am currently experimenting with creating an animated gradient effect by blending three separate blobs together in a melting-like fashion, with each blob moving independently. The desired result can be seen in the image provided below. So far, I have bee ...

Instructions for connecting a button and an input field

How can I connect a button to an input field? My goal is to make it so that when the button is clicked, the content of the text field is added to an array (displayed below) const userTags = []; function addTags(event) { userTags.push(event.target.__ wha ...

In JS/JSON, a new line of data is generated every hour

Recently, I have been experimenting with DiscordJS and exploring its logging functionality. I am aware that the method I am using is outdated and may not be the most secure for actively changing data, but I am intrigued. let count = JSON.parse(fs.readFile ...

Take away the attention from the span element

I have been experimenting with the following jsfiddle and attempted various methods suggested in this Stack Overflow thread, but I am struggling to remove the focus from the "feedback" span after clicking on the cancel button in jQuery confirm dialog. Her ...

What are the steps to add a Search Box to my HTML Website?

Currently, I am in search of a way to incorporate a "Search" feature on my website that is built solely with HTML. I have added a Search box for the users but I'm uncertain about how to proceed next. Can I use PHP to enable the Search functionality o ...

using async.waterfall with async.apply

Here is a code snippet that I am working with: async.waterfall([ // Read directory async.apply(fs.readdir, '../testdata'), // Load data from each file function(files, callback) { async.each(files, loadDataFromFile, callback); } ], ...

Creating a SVG polygon using an array of points in JavaScript

Consider the following array containing points: arr = [ [ 0,0 ], [ 50,50 ], [ 25,25 ], ]; I would like to create an SVG polygon using this array. Initially, I thought the code below would work, but it doesn't: <polygo ...

Fluctuating updated site (ajax)

What method do you recommend for maintaining the data in a table on a page current? Currently, I am using a timer that connects to the server via ajax every 2 seconds to check for updates. Is there a way to trigger an event or function only when the cont ...

Guide to utilizing Regex validation for checking the vehicle registration plate in Vue 3 input field

I need to implement validation for an input field that only accepts capital letters and numbers, following a specific format (AAA-111). The first 3 characters should be alphabets, followed by a hyphen, and then the last 3 characters should be numbers. & ...

Implementing AngularJS directives with jQuery

Utilizing Jquery Selectric to enhance the select box in my AngularJS app led me to create a directive for rendering the element. Below you'll find the directive code along with how it's implemented. The Directive: angular.module('shoeReva ...

Is there a way to compare two regex values using vuelidate?

Can someone assist me with validating an input field using vuelidate? I am looking to return a valid result if either of the two regular expressions provided below is true. const val1 = helpers.regex('val1', /^\D*7(\D*\d){12}\ ...

Testing API route handlers function in Next.js with Jest

Here is a health check function that I am working with: export default function handler(req, res) { res.status(200).json({ message: "Hello from Next.js!" }); } Alongside this function, there is a test in place: import handler from "./heal ...

Having trouble accessing the property of undefined in material ui cards

Currently, I am incorporating Material UI cards into my React project. One issue I encountered is trying to implement two functions, onMouseOver and onMouseOut, in my cards. However, when I run the code, I receive an error message stating "Uncaught TypeE ...

The AJAX form fails to submit the information, causing PHP to not process the request

I encountered an issue with this particular form a few days ago which was resolved using a different PHP code provided by the helpful folks here. However, after making a small change to the form, it no longer works. I have verified that all the variables b ...

Creating a Modal in React without the need for a button to trigger it

I am working on implementing a model using the React Material UI library to display information on the landing page when a user logs in. However, I am facing an issue with closing the modal once it appears despite using a timeout trigger. const[post,setP ...

How does a web crawler determine which elements to click on when navigating a webpage?

Recently, I developed a crawler application that is able to access a given webpage and extract the HTTP Requests before storing them in an excel sheet. Currently, I have implemented click events for some buttons using jQuery. Now, I am faced with the chal ...

Easily manipulate textboxes by dynamically adding or deleting them and then sending the data to a

Can you provide a simple example of how to dynamically add and remove textboxes and then display the results? I envision it like this: [Empty Textbox][Add button] When 'Value1' is entered into the textbox and 'add' is clicked, it s ...

The initial number is inserted within the text box upon entering the final number

Whenever I enter the final digit, the text-box swallows up the initial number (it vanishes), resulting in an additional space. https://i.stack.imgur.com/Vfm8s.png https://i.stack.imgur.com/od4bQ.png Upon clicking outside of the text-box, the formatting ...

Tips for creating a console.log wrapper specifically designed for Angular2 using Typescript

Is there a way to create a custom global logging function in Angular 2 TypeScript project that can be used instead of console.log for services and components? I envision the function looking like this: mylogger.ts function mylogger(msg){ console.log ...