Open Closed

Cannot set profile picture #1577


User avatar
0
jogoertzen created
  • ABP Framework version: v4.3.3
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:

There is no exception message, but the auth-server logs contain the following information that seems to indicate that the user is not authorized to access /api/account/profile-picture.

[auth-server_f3e6eab0-2]: [14:36:07 INF] Request starting HTTP/1.1 POST https://localhost:44322/api/account/profile-picture application/json 822772
[auth-server_f3e6eab0-2]: [14:36:07 INF] CORS policy execution successful.
[auth-server_f3e6eab0-2]: [14:36:07 DBG] CORS request made for path: /api/account/profile-picture from origin: http://localhost:4200 but was ignored because path was not for an allowed IdentityServer CORS endpoint
[auth-server_f3e6eab0-2]: [14:36:07 INF] No CORS policy found for the specified request.
[auth-server_f3e6eab0-2]: [14:36:07 INF] Authorization failed. These requirements were not met:
[auth-server_f3e6eab0-2]: DenyAnonymousAuthorizationRequirement: Requires an authenticated user.
[auth-server_f3e6eab0-2]: [14:36:07 INF] AuthenticationScheme: Identity.Application was challenged.
[auth-server_f3e6eab0-2]: [14:36:07 INF] Request finished HTTP/1.1 POST https://localhost:44322/api/account/profile-picture application/json 822772 - 302 0 - 8.0785ms
  • Steps to reproduce the issue:
    • Generate a new microservice solution via abp suite v4.3.3 with the options below

  • Run out\MyProject\etc\docker\up.ps1
  • Run tye run in out\MyProject
  • Open Chrome browser on http://localhost:4200
  • Login as admin / 1q2w3E*
  • Click admin > Manage your profile > Profile picture > Upload File > Choose File > Pick an image file > Save Changes > Yes
  • Observe error below

Note: The Microsoft.EntityFrameworkCore.Tools package was recently upgraded to 5.0.8 which seemed to cause version conflicts with 5.0.7 during the build. I worked around the issue by downgrading to 5.0.7 and editing any .csproj files that contained version 5.0.* and replaced them with 5.0.7 explicitly.


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

    hi

    We will fix this problem.

    Note: The Microsoft.EntityFrameworkCore.Tools package was recently upgraded to 5.0.8 which seemed to cause version conflicts with 5.0.7 during the build. I worked around the issue by downgrading to 5.0.7 and editing any .csproj files that contained version 5.0.* and replaced them with 5.0.7 explicitly.

    You can try to install the latest NET SDK.

    5.0.302 https://dotnet.microsoft.com/download/dotnet/5.0

  • User Avatar
    0
    jogoertzen created

    Hi maliming,

    Unfortunately, installing the latest .NET SDK did not solve the problem; the same error occurs.

    I did a little digging and it seems Volo.Abp.EntityFrameworkCore >= 4.3.3 still depends on Microsoft.EntityFrameworkCore 5.0.7, but there are several package references in the Microservice template 4.3.3 that specify a wildcard in the patch version number (ie. 5.0.*) for Microsoft.EntityFrameworkCore that started resolving to 5.0.8 as of 2021-07-13. This seems to be what is breaking the build.

    It seems the only options right now are (1) to replace all instances of 5.0.* with 5.0.7 to match Volo.Abp.EntityFrameworkCore, or (2) wait for a new version of Volo.Abp.EntityFrameworkCore that depends on Microsoft.EntityFrameworkCore 5.0.8.

    Is that an accurate assessment?

  • User Avatar
    0
    jogoertzen created

    We confirmed a third option exists: explicitly adding Microsoft.EntityFrameworkCore.Relational 5.0.8 to the Shared.Hosting project gets rid of the conflict.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Thanks @jogoertzen

    I will check this.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can try to add below to AuthServer project.

    <ItemGroup>
        <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.*">
            <PrivateAssets>all</PrivateAssets>
            <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
        </PackageReference>
    </ItemGroup>
    
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi jogoertzen

    Please send a email to liming.ma@volosoft.com I will share the git difference with you.

  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    Note: The Microsoft.EntityFrameworkCore.Tools package was recently upgraded to 5.0.8 which seemed to cause version conflicts with 5.0.7 during the build. I worked around the issue by downgrading to 5.0.7 and editing any .csproj files that contained version 5.0.* and replaced them with 5.0.7 explicitly.

    This is about local nuget cache missmatch with Microsoft.EntityFrameworkCore. You can also try removing <PrivateAssets>all</PrivateAssets> line.

    Solutions to this problem will be a local solution.

    We will discuss about using specific version of Microsoft.EntityFrameworkCore.

  • User Avatar
    0
    ServiceBot created
    Support Team Automatic process manager

    This question has been automatically marked as stale because it has not had recent activity.

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