question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

After upgrade to 6.0.2 my start page throws 404?

See original GitHub issue

Hey!

After I’ve upgraded Piranha to 6.0.2 my Start page (“/start”) request fails to resolve to a website, but 404 content is thrown instead. I have upgraded and made code adjustments, but my local environment targets old database (if that is of any relevance). My Startup code isn’t heavily modified, nor isn’t “StartPage”. What might affect this issue is that my DB has multiple pages of type “StartPage” (did that for my own convenience for some reason 😃 )

` public void Configure(IApplicationBuilder app, IHostingEnvironment env, IServiceProvider services, IApi api) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); }

        // Initialize Piranha
        App.Init(api);

        // Configure cache level
        App.CacheLevel = Piranha.Cache.CacheLevel.Basic;

        // Build content types
        var pageTypeBuilder = new Piranha.AttributeBuilder.PageTypeBuilder(api)
            .AddType(typeof(Models.BlogArchive))
            .AddType(typeof(Models.StandardPage))
            .AddType(typeof(Models.StartPage));
        pageTypeBuilder.Build()
            .DeleteOrphans();
        var postTypeBuilder = new Piranha.AttributeBuilder.PostTypeBuilder(api)
            .AddType(typeof(Models.BlogPost));
        postTypeBuilder.Build()
            .DeleteOrphans();

        // Register middleware
        app.UseStaticFiles();
        app.UseAuthentication();
        app.UsePiranha();
        app.UsePiranhaManager();
        app.UseHttpsRedirection();
        app.UseMvc(routes =>` 

Any ideas how to troubleshoot it properly would be so welcome, I’m pretty novice when it comes to ASP.NET apps

Thanks!

Alex Pawlak

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tidyuicommented, Apr 9, 2019

I’ve upgraded the official PiranhaCMS.org and all templates without issues so it has to be something else. Have you changed .net core runtime version or added any other middleware into the pipeline?

0reactions
AlexJPawlakcommented, Apr 9, 2019

Sorted out!

You said you upgraded templates just fine, so I started looking at my items one by one and it turned out I didn’t use a “template” you upgraded, but used the “MVCWeb” one available in Examples (not in the templates):

https://github.com/PiranhaCMS/piranha.core/blob/d969847abf2c487f90b2ab78ecc818a825f6c1fb/examples/MvcWeb/Controllers/CmsController.cs

I’ve replaced the CmsController file with actual template and it worked just fine 😃 https://github.com/PiranhaCMS/piranha.core.templates/blob/master/web/mvc/Controllers/CmsController.cs

I think I’ll review and cherry pick other files as well, are these new templates hosted somewhere so I can do a live lookup what they do?

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTP error 404 file not found on a server
To resolve this problem, verify that the file requested in the browser's URL exists on the IIS computer and that it is in...
Read more >
How to Fix WordPress 404 Not Found Error [8 Easy ...
A 404 "Not Found" error occurs when your browser cannot find the requested page. This blog shares the easy fixes to bypass the...
Read more >
API Upgrade from .Net Framework to .Net 6.0 throwing 404 ...
I have the following code which was working fine in .Net Framework but after upgrade it's throwing 404 error. This is basically my...
Read more >
6.1 update causes 404 error on every page
I upgraded to WP 6.1 at the same time as installing some plugin updates, and after that all pages just show a 404...
Read more >
Error 404: 4 Ways to Fix It
Error 404 is a response code, meaning the server could not locate the requested content. Check this article to learn 4 steps to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found