How to Specify the Target App when setting up PredictionIO for Rails App - ruby-on-rails

I'm new to PredictionIO, and I'm following this tutorial http://docs.prediction.io/0.8.0/tutorials/engines/itemrec/rails.html. I got to the step where I need to import a rake task. Well, that doesn't work and I get this error:
PredictionIO::EventClient::NotCreatedError: The requested resource could not be found.
That happens when I try this line:
client.set_user(user.id)
Now, right before this step, it says to change file params/datasource.json and to specify the target app. I don't know how to get this ID and I suspect this might be the problem here.
Hope this is clear and someone knows the answer.

Select a unique number for your application,say 5.
Replace PIO_APP_ID with 5 in the rails code and run.This is to inform the event server that incoming events are pertaining to appId=5.
Once all the events are registered, go to io.prediction.engines.itemrec/params/datasource.json and change appId to 5.Now train,deploy the engine in that order.
You can view the events registered by the event server by
curl -i -X GET http://localhost:7070/events.json?appId=5

Related

How to make basic changes to ASP.Net Core with Docker Support?

I've created my 'first' ASP.NET Core project with Docker support in VS2017.
I build and run and viola, it 'works'. A browser is launched, it loads http://localhost:32787/api/values and returns the expected "value1","value2" response... All is good.
So now I want to start working with this animal to make it do MY will.. get rid of the valuesController and create my own new testController. On run (select the 'docker' start command) it heads for api/values again...and again. (if I change values to test in the url it works as expected. But how do I get it to STOP going to api/values I cannot find any setting that will affect this change.
launchSettings.json is the 'intuitive' place to look. There I find a setting for launchUrl, which I change, first to just api/test (just as it was api/values OOTB) ... no joy, I go ahead and add the rest of the address
so it reads: http://localhost:32787/api/value...
I do a search on the solution and in the file system and can find the word "Values" NOWHERE.
I have found other articles that get into more advanced routes and adding them to the app.UseMvc() command in the Configuration (great, I'm sure I will need to use that soon) but something, somewhere is telling this project to go to http://localhost:32787/api/values and I want to know where that is and how to change it.
Pardon if this is a duplicate but I have tried any number of google searches for things like 'change default url in asp.net core with docker' and get polluted with irrelevant articles that show me many wonderful things that I don't need to know...YET.
If you are using the latest version of VS, and you added Docker support either during, or after the solution was created, all you have to do is right-click on the project named docker-compose, choose Properties, and you can change the information there.
The default Service URL is what you need to focus on. The Launch Browser is set to Yes by default, which has little value in an API project after a short time. Change these to what you think you need. I set my Launch Browser to No, and in case I ever need it, set the Service URL to one that makes sense after doing some development.
I had a hard time finding these myself the first time I went digging.
In case you try to browse with docker and it doesn't land on desired default route, then in your launchSettings.json, just add your desired prefix to launchUrl in the Docker node. For example to make api as your default route when running docker:
"Docker": {
"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/api"
}

Umbraco scheduledTasks not working

I have a scheduled task that I want to run every 5 minutes.
I added the url for my method in umbracoSettings.config and the necessary settings but scheduledTasks doesn't seem to be running.
I tried debugging it by calling the url from the browser and I do hit my break point.
I tried checking the logs but there are no errors being recorded. Is this a bug in umbraco? How can I know that the scheduled task is running?
<scheduledTasks>
<!-- add tasks that should be called with an interval (seconds) -->
<task log="true" alias="task1" interval="300" url="http://localhost:43203/umbraco/api/Integration/Init"/>
</scheduledTasks>
I'm using Umbraco 7.5.8
I never had trouble using scheduledTasks in other versions of Umbraco.
The main issue I've seen with scheduled tasks is when the server that's running can't resolve the address in the task. Sometimes a server can be so locked down it can't actually "see" itself, so it can't get to the URL to run it. If this was the case though, you'd normally see some errors in the Umbraco TraceLog file in /App_Data/Logs/.
If your breakpoint isn't getting hit, you could try adding some logging code to the method you're calling and see if that gets written to the Umbraco log files? That way you should be able to tell if it's being hit or not.
Its working now. if you look at umbracoServer table in the database you will see a column isMaster.
The scheduledTasks is only running on the master server.

Parse Server Cloud Code Does Not Work

Hey guys I have a very confusing issue at hand, I want to state that I have looked through EVERY resource I could find including on here about getting custom cloud code functions to work.
I am hosting Parse Server on Heroku with my database on mLabs
I can successfully call the 'hello' cloud code function
I cannot successfully call any custom Function, even one that prints something to the console
Below is my current process that I have been using trying to get my cloud code functions to work
Open Main.js and Add Cloud code:
Parse.Cloud.define('testParagraph', function(req, res) {
console.log("received......... this is a console log for a test function that will print out a paragraph as a test");
res.success('Hi, this is the start of a new test function that will print out a paragraph');
});
Commit change to git
Push Change to git
Restart Heroku Server
Run App & Call cloud code from iOS app in Swift
Result:
Every Time I get error 141 Invalid Function, however I can call 'hello' successfully. Just not a custom function.
Edit 2: I have discovered that I am unable to update any cloud functions. Meaning that while I can successfully call the "hello" function if I make a change to said function, re-upload to git, restart Heroku the change is not implemented. This leads me to believe that there must be something wrong with either the link to my main.js or it is being uploaded somewhere else and isnt calling the correct main.js... Any insight would be helpful
I solved this issue, my git was behind HEAD and therefore any changes I made did not become active on my Heroku Server, I merged my branches and this solved my problem of not being able to run custom functions. Now I am able to run custom functions, but I still get error 141 when try to query my database, due to the new problem I am marking this as solved and asking a new question.

Why am I getting the message "The specified request cannot be executed from current Application Pool"?

Quite not sure why I see this error.
I navigate to my Login View like so http://test.staging.com/mywebsite/Login
My Login view was just redone using MVC but I have seen this same error message going to an aspx page as well...
If I use http I get the error message The specified request cannot be executed from current Application Pool.
If I use https://test.staging.com/mywebsite/Login, I'm good.
If I don't specify a protocol, test.staging.com/mywebsite/Login, I get the error as well
Is there an error happening under the covers and my custom error page can't be shown like discussed here?
What are some other causes of this error?
That usually means your custom errors are configured to run as a different AppPool.
You can read more at MSDN. (See section "Using Custom Errors from Another Application Pool").
There are two ways to correct this behavior. The first is possibly not one that you are interested in because it would require you to change your current architecture and run both sites in the same application pool (such as share the same worker process memory space). To do this, simply move the /errors virtual directory to run in the same application pool as the site for which it serves the custom error.
The second way is to make use of a registry key provided by IIS 6.0. This registry key makes sure IIS 6.0 does not check the metadata during the execution of the custom error and therefore allowing this to work.
See the article for information on the registry key fix.
It may also mean that you are using something along the lines of Server.Transfer to a page that is in a different AppPool.
It could be because you're using different versions of ASP.NET for one or many apps in the pool.
Make sure all apps in the pool use the same version of ASP (e.g. ASP 2.0.50727)
If you just added a new app, try changing the app momentarily to a different version of ASP, then back to same version. I experienced an issue where the displayed version was correct, but under the hood, a different version was used!
Check your event log, under Application, to get more details about the error.
The message would be caused by your page server-side redirecting to a page served by another application pool. Such as for example, in your link, the error page.
I know this is an old thread, but I stumbled upon it and found a different solution. Here's what worked for me: Make sure your application handles .asmx files correctly
From IIS:
Right Click on your project > Properties > Configuration
If necessary, add the .asmx file extension that maps to the aspnet_isapi.dll
Limit to: "GET,HEAD,POST,DEBUG" and restart.
Because I can't comment on vcsjones's answer, I'll add it down here. The DWORD value IgnoreAppPoolForCustomErrors needs to be set under HKLM\SYSTEM\CurrentControlSet\Services\W3SVC\ Parameters vs HKLM\SYSTEM\CurrentControlSet\Services\W3SVC referenced in that technet article. Set it to 1 and do an iisreset and you're good to go.
Source Blog Post
In my particular case, I received this error while trying to serve a content (non ASP.NET) website while it was an Application. Right-Clicking the virtual folder and removing the application fixed it for me.
In my case the application used the application pool that didn't exist. I have no idea how it's happened.

When i used SMS plugin in grails i am getting error

i have service to send sms to the mobile through Application. I am getting the follwing error.
2011-06-06 19:37:35,729 [http-8080-2] ERROR sipgate.SipgateService - Server returned HTTP response code: 401 for URL: https://samurai.sipgate.net/RPC2
This probably means you are using an invalid username or password
Have you set up the config as explained on the plugin page (at the top of the documentation)?
I also assume that this means your earlier problem was solved... Can you accept the answer if my answer helped, or explain what you did to fix it if it did not?
I agree with Tim. You can only log in, if your Sipgate-Registration was verified by Sipgate.
Points, which you can check to see if your account is not working:
Try to log in on the sipgate.de webpage
Use the Perl-Client given here: http://www.sipgate.de/basic/api
The client can be downloaded at this location:http://www.sipgate.de/beta/public/static/downloads/basic/api/sipgate_api_perl_examples.zip
Hopefully you should not be able to do at least one of these things. Then you know you have to talk to the support # sipgate
The documentation on the plugin-page says, you have to have a 'conf/Config.groovy'-file. This means that you should have the basic Config.groovy file in the folder 'grails-app/conf/', which ships with every Grails installation. So my guess is that you might have created a different Config.groovy-file. So better check on the Config.groovy-file. The SMS-plugin should have generated some placeholders for you, where you need to enter your sipgate-account-data.

Resources