Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 19, 2010 @ 16:33
    Jan Skovgaard
    0

    Scheduled tasks not working

    Hi

    First of I'm not sure this is the right category for this question...but anyway here goes...

    I'm having a bit of a hard time to get the scheduled task in umbraco working.

    Currently the site is in a development environment and the correct domain has not been assigned yet.

    I have the following in the umbracoSettings.config

        <task log="true" alias="autoArchiving60" interval="60" url="/indstillinger.aspx" />

    I can't see what should be wrong here?

    In the log comment it reads this: autoArchiving60 has been called with response: False


    Dows anyone have an idea what could be wrong?

    /Jan

  • Richard Soeteman 4045 posts 12898 karma points MVP 2x
    Jan 19, 2010 @ 16:41
    Richard Soeteman
    1

    Hi Jan,

    Relative paths don't work. you need to enter the full url( http://mydomain.com/indstillinger.aspx) . And then it will work....

    Hope it helps you,

    Richard

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 20, 2010 @ 00:09
    Jan Skovgaard
    0

    Hi Richard

    Thank you for your reply. I thought that a relative path would work, since it's been described in this WIKI entry with a relative path: http://our.umbraco.org/wiki/reference/packaging/package-actions/community-made-package-actions/add-a-scheduled-task

    However when I'm using the full path it also fails. As mentioned the DNS has not been setup yet so I'm currently using the IP so the url looks something like this for instance http://xxx.xx.xx.xxx/mytask.aspx - But I guess that it should be working even though I'm using the IP right? If so...it still does'nt :'-(

    /Jan

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Jan 20, 2010 @ 09:12
    Morten Bock
    2

    This is what it does:

     private static bool getTaskByHttp(string url)
            {
                HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url);
                HttpWebResponse myHttpWebResponse = null;
                try
                {
                    myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
                    if (myHttpWebResponse.StatusCode == HttpStatusCode.OK)
                    {
                        myHttpWebResponse.Close();
                        return true;
                    }
                    else
                    {
                        myHttpWebResponse.Close();
                        return false;
                    }
                }
                catch
                {
                }
                finally
                {
                    // Release the HttpWebResponse Resource.
                    if (myHttpWebResponse != null)
                        myHttpWebResponse.Close();
                }
    
                return false;
            }

    So you could try that from your own code and see if you get the correct statuscode back.

  • Richard Soeteman 4045 posts 12898 karma points MVP 2x
    Jan 20, 2010 @ 09:22
    Richard Soeteman
    0

    Hi Jan,

    IP should work indeedd. you can access the page http://xxx.xx.xx.xxx/mytask.aspx  from that server? If it's a normal aspx page and not excluded in the web.config it will throw a 404. So maybe that goes wrong?

    Cheers,

    Richard

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 20, 2010 @ 10:50
    Jan Skovgaard
    0

    @Morten: Thanks for your help. I've just tested the console app and it returns "true"...So now I'm thinking...what would be the next step?

    @Richard: Yes, the page exists :)

    /Jan

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 20, 2010 @ 11:09
    Jan Skovgaard
    0

    Turns out that I should just use "localhost". :)

     

    Thanks for your help guys.

    /Jan

  • Murray Roke 503 posts 966 karma points c-trib
    Jun 10, 2010 @ 04:32
    Murray Roke
    0

    I imagine localhost will not work in a shared hosting environment (which includes most kinds of test & staging servers)

  • Peter Josefson 15 posts 37 karma points
    Sep 04, 2011 @ 18:22
    Peter Josefson
    0

    Just ran into this... CMSImport stopped running when we moved a site to a production server. Which, of course, doesn't have the same URL as the test server.

    So... umbraco on the production server kept on triggering the tasks on the test server. A kind of nice but somewhat surprising feature... you could have one umbraco installation run tasks on all your servers this way - with a big umbracoSettings.config file... :)

    Not much happened on the production server, though...

    Seriously, this is a serious problem that makes staging even more confusing. Is it VERY hard to modify getTaskByHttp so that it accepts paths like "/something" and "~/something" and prepend the relevant beginning of the URL to them (with some backward compatibility in place to leave it as is if it starts with http://)?

    I haven't dug deep enough in umbraco to know whether or not backgrund code has access to the (a) site host header. If not, it should be trivial to stick it somewhere in application state on the first request. Not?

  • Murray Roke 503 posts 966 karma points c-trib
    Sep 04, 2011 @ 23:00
    Murray Roke
    0

    vote for this issue here: http://umbraco.codeplex.com/workitem/22757

Please Sign in or register to post replies

Write your reply to:

Draft