Open Closed

ABP 7.0.1 Commercial MVC Delete Record Fails when called from virtual directory app #4794


User avatar
0
rwright-ruhealth created
  • ABP Framework version: v7.0.1
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): NO ( MULTI PROJECT: YES)
  • Exception message and stack trace: NO Error; POPUP Alert: "An Error Has Occurred" "Error Detail Not Sent By Server" Error Log shows no error info, just a call to the api object [INF] Request finished HTTP/2 GET https://myserver.com/myapp/api/app/departments/7 - - - 200 - application/j which is a get for the record which exists. For what it's worth, health-status is throwing errors as well. Otherwise the app is working.
  • Steps to reproduce the issue:" I think this is a **BUG **in ABP.IO. It should not break the application to serve it from a virtual directory in IIS.
  • Create an ABP.IO App on local windows machine using ABP Suite.
  • Fix Up the paths in the index.js file so the app is properly served else the modals will not launch when app is published. just add the appPath + (and remove the leading / to the script createModal / editModal. Example:
  • var createModal = new abp.ModalManager({ viewUrl: abp.appPath + "Departments/CreateModal", scriptUrl: abp.appPath + "Pages/Departments/createModal.js", // here we have to remove the leading slash modalClass: "departmentCreate" });
  • Publish the App to An IIS Server WINDOWS 2019 where the app is served as a virtual application. example: https://myhost.com/myapp.
  • Create a record / Update the record. Should work. Delete the record. Error msg from above pops up.
  • a javascript debug of appPath should show "/myapp/" from the index.js in the pages directory.
  • The delete script is never called because the javascript myPageService.delete(data.record.mypage.id) is not called. I need to fix up the path on the delete so it hits the service, however, this delete is dynamically created api, not static api. On the localmachine with no virtual application, everything works as expected.

Implemented this routine in my AppNameWebModule.cs file as well, based on information from : https://support.abp.io/QA/Questions/181/Problem-with-IIS-application-path

Configure<AbpLayoutHookOptions>(options => { options.Add(LayoutHooks.Head.Last, typeof(AbpApplicationPathViewComponent)); });


6 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you share an online website URL to show this problem?

    liming.ma@volosoft.com

  • User Avatar
    0
    rwright-ruhealth created

    Maliming,

    I emailed you a link to server. Any word?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I will check it asap.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    I think the URL https://xxxx.org/grantrak/api/app/departments/7 is correct.

    Request URL: https://xxxx.org/grantrak/api/app/departments/7
    Request Method: DELETE
    Status Code: 405 
    

    https://stackoverflow.com/questions/6147181/405-method-not-allowed-in-iis7-5-for-put-method https://learn.microsoft.com/en-us/aspnet/web-api/overview/testing-and-debugging/troubleshooting-http-405-errors-after-publishing-web-api-applications

  • User Avatar
    0
    rwright-ruhealth created

    Maliming;

    Removing WEBDAV from the IIS server via remove roles/features solved the delete issue we were experiencing.

    We still are encountering pathing issues with inbuilt pieces of ABP commercial. When trying to change the profile picture, the upload xmlhttprequest is trying to POST to the root of the site and it does not include the virtual application path. Is there a document published by ABP that covers proper configuration for applications served from virtual application directories, i.e. https://mysite.org/myapp

    SEE this post as well: https://support.abp.io/QA/Questions/4800/User-Image-Lost (DOES NOT WORK FOR ME)

    The path being posted to is: Volo.Abp.Account.Public.Web.Pages.Account.ManageModel.B8A9BBA0EEE4D03117FA135C1ED22DE0.js?_v=638161345940120111:5

       POST https://www.somesite.org/api/account/profile-picture 404  The POST request should be https://www.somesite.org/myapp/api/account/profile-picture  This works locally, but not on production server.
       
    

    The error is: SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON at JSON.parse (<anonymous>) at Object.getResponseData (Volo.Abp.Account.Public.Web.Pages.Account.ManageModel.B8A9BBA0EEE4D03117FA135C1ED22DE0.js?_v=638161345940120111:5:696191) at XMLHttpRequest.<anonymous> (Volo.Abp.Account.Public.Web.Pages.Account.ManageModel.B8A9BBA0EEE4D03117FA135C1ED22DE0.js?_v=638161345940120111:5:699320)

    Thank you.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can replace the abp/account/src/Volo.Abp.Account.Pro.Public.Web/Pages/Account/Components/ProfileManagementGroup/ProfilePicture/Default.js

    update "/api/account/profile-picture"; to api/account/profile-picture";.

    I will update it in the next patch version.

    https://docs.abp.io/en/abp/latest/Virtual-File-System#replacing-overriding-virtual-files

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09