Base solution for your next web application
Open Closed

Issues while upgrading to v2.0.0-rc2 #2965


User avatar
0
maharatha created

Hi -

I am trying to upgarde to v2.0.0-rc2 and below are the two issues :

The return type of

CreateAsync(tenant)

has changed to Void. Any reason for this ?

and

throw _abpLoginResultTypeHelper.CreateExceptionForFailedLoginAttempt(loginResult.Result , usernameOrEmailAddress, tenancyName); to 

throw _abpLoginResultTypeHelper.CreateExceptionForFailedLoginAttempt(loginResult, usernameOrEmailAddress, tenancyName);

13 Answer(s)
  • User Avatar
    0
    maharatha created

    As i resolve the existing issues came across another issue :

    System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed.
       at System.Security.Cryptography.CapiSymmetricAlgorithm.DepadBlock(Byte[] block, Int32 offset, Int32 count)
       at System.Security.Cryptography.CapiSymmetricAlgorithm.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)
       at System.Security.Cryptography.CryptoStream.FlushFinalBlock()
       at System.Security.Cryptography.CryptoStream.Dispose(Boolean disposing)
       at System.IO.Stream.Close()
       at System.IO.Stream.Dispose()
       at Abp.Runtime.Security.SimpleStringCipher.Decrypt(String cipherText, String passPhrase, Byte[] salt)
       at xxx.xx.MultiTenancy.TenantAppService.<>c.<GetTenantUnits>b__21_0(<>f__AnonymousType414`3 item) in
    

    This is a major issue after the upgrade and it is causing a lot of problems. Please provide a solution.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Can you share your code GetTenantUnits ? Also is it possible to share sample values for DefaultPassPhrase, DefaultInitVectorBytes, DefaultSalt if you are using different than ABP's.

    Thanks.

  • User Avatar
    0
    maharatha created
    public async Task<PagedResultDto<TenantListDto>> GetTenantUnits(SearchInputDto input)
            {
                var query = from tenant in TenantManager.Tenants
                            join org in _organizationRepository.GetAll() on tenant.OrganizationUnitId equals org.Id
                            join connection in _connectionStringRepository.GetAll() on org.ConnectionStringId equals connection.Id
                            select new { tenant, OrganizationName = org.DisplayName, ConnectionName = connection.ConnectionString };
    
                if (!ReferenceEquals(input.Filters, null))
                {
                    SearchTypes mapSearchFilters = Helper.MappingFilters(input.Filters);
                    if (!ReferenceEquals(mapSearchFilters, null))
                        query = Helper.CreateFilters(query, mapSearchFilters);
                }
    
                var tenantCount = await query.CountAsync();
                var tenants =
                    await query.OrderBy(Helper.GetSort("tenant.Name ASC", input.Sorting)).PageBy(input).ToListAsync();
    
                return new PagedResultDto<TenantListDto>(tenantCount, tenants.Select(item =>
                {
                    var dto = item.tenant.MapTo<TenantListDto>();
                    dto.OrganizationName = item.OrganizationName;
                    var connectionString =
                        new SqlConnectionStringBuilder(SimpleStringCipher.Instance.Decrypt(item.ConnectionName));
                    dto.ServerName = connectionString.DataSource;
                    dto.DatabaseName = connectionString.InitialCatalog;
                    return dto;
                }).ToList());
            }
    

    I use Abp Defaults.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Thanks for sharing your code. I couldn't reproduce the error. Do you get the same error message when you run this line in a unit test ?

    SimpleStringCipher.Instance.Decrypt(item.ConnectionName)
    

    If so, can you share a sample value for "item.ConnectionName" ? Or better, can you share your project with us via email ?

    Thanks.

  • User Avatar
    0
    maharatha created

    The connection string are getting encrypted differently after the upgrade :

  • User Avatar
    0
    maharatha created

    This is the same string that's being encrypted differently before and after upgrade.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Can you share the old and new encrypted values and raw value to us as text ? We will test this using the values provided by you.

    You can send then to <a href="mailto:[email protected]">[email protected]</a>.

    Thanks.

  • User Avatar
    0
    maharatha created

    I just sent you an email.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Thanks for the information. We have fixed and we are going to release ABP tomorrow.

    Thanks.

  • User Avatar
    0
    maharatha created

    I appreciate the fix you made. I am just hoping if the response time could be little faster. It took almost 5-6 days to identify and fix the issue.

    This is a major bug if anyone is using multi database and multi tenancy.

  • User Avatar
    0
    exlnt created

    I just did the upgrade to ABP 2.0.1 and am facing a serious issue. I cannot login to my tenant with any user Id. I cannot even login to my tenant via the host tenant. Soon as you click on the "log into tenant" from the Tenant grid it throws an error.

    It also does not show any users from my tenant instance either.

    I checked my error log and it shows the same cryptography error shown in this thread.

    Will the update being published tomorrow address this issue?

    I have posted my own thread on upgrade issues here: #3023

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @maharatha,

    Sorry for the delay that we caused, we thought it was a minor problem at the beginning and we figured it out with your help. Thanks for your help again and sorry for the delay.

    Hi @exlnt,

    We are releasing fixed vesion of ABP in a few minutes, you can update and try.

    Thanks.

  • User Avatar
    0
    exlnt created

    I completed the upgrade to version 2.0.2 and now I'm running into errors in my app. I posted details here: #3023@d2485843-c543-4ba2-bf4a-9f0c4d7ddf8b