2017-05-16 6 views
1

에 asp.net을 게시 할 때 저는 현재 오류가 점점 오전 :System.Data.SqlClient.SqlException : 'null'사용자가 로그인하지가 못했습니다. 푸른

System.Data.SqlClient.SqlException: Login failed for user 'null'.

Asp.net 웹 API에서 토큰을 시도. 이것은 Azure에서만 발생하며 다른 서버에서는 발생하지 않습니다. Azure에서 로컬로 데이터베이스에 연결하는 사이트를 실행할 때도 문제가 없습니다. 어떤 이유로 데이터베이스를 만들려고 시도하는 중이고 허가가없는 것으로 보입니다. 이 오류에 대한

스택 추적 :

[SqlException (0x80131904): Login failed for user 'null'.] 
    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling) +821 
    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) +332 
    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) +38 
    System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +497 
    System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +89 
    System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +426 
    System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +78 
    System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +191 
    System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +154 
    System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +21 
    System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry) +90 
    System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +217 
    System.Data.SqlClient.SqlConnection.Open() +96 
    System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.<Open>b__36(DbConnection t, DbConnectionInterceptionContext c) +10 
    System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch(TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed) +72 
    System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection connection, DbInterceptionContext interceptionContext) +359 
    System.Data.Entity.SqlServer.<>c__DisplayClass33.<UsingConnection>b__32() +426 
    System.Data.Entity.SqlServer.<>c__DisplayClass1.<Execute>b__0() +10 
    System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Func`1 operation) +189 
    System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Action operation) +77 
    System.Data.Entity.SqlServer.SqlProviderServices.UsingConnection(DbConnection sqlConnection, Action`1 act) +174 
    System.Data.Entity.SqlServer.SqlProviderServices.UsingMasterConnection(DbConnection sqlConnection, Action`1 act) +556 
    System.Data.Entity.SqlServer.SqlProviderServices.CreateDatabaseFromScript(Nullable`1 commandTimeout, DbConnection sqlConnection, String createDatabaseScript) +86 
    System.Data.Entity.SqlServer.SqlProviderServices.DbCreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection) +164 
    System.Data.Entity.Core.Common.DbProviderServices.CreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection) +76 
    System.Data.Entity.Core.Objects.ObjectContext.CreateDatabase() +134 
    System.Data.Entity.Migrations.Utilities.DatabaseCreator.Create(DbConnection connection) +119 
    System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action mustSucceedToKeepDatabase) +142 
    System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration) +78 
    System.Data.Entity.Internal.DatabaseCreator.CreateDatabase(InternalContext internalContext, Func`3 createMigrator, ObjectContext objectContext) +89 
    System.Data.Entity.Internal.InternalContext.CreateDatabase(ObjectContext objectContext, DatabaseExistenceState existenceState) +116 
    System.Data.Entity.Database.Create(DatabaseExistenceState existenceState) +218 
    System.Data.Entity.CreateDatabaseIfNotExists`1.InitializeDatabase(TContext context) +149 
    System.Data.Entity.Internal.<>c__DisplayClassf`1.<CreateInitializationAction>b__e() +76 
    System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action) +60 
    System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization() +357 
    System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c) +7 
    System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input) +110 
    System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action) +198 
    System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase() +73 
    System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +28 
    System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +53 
    System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +15 
    System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +38 
    System.Data.Entity.QueryableExtensions.FirstOrDefaultAsync(IQueryable`1 source, Expression`1 predicate, CancellationToken cancellationToken) +138 
    System.Data.Entity.QueryableExtensions.FirstOrDefaultAsync(IQueryable`1 source, Expression`1 predicate) +145 
    Microsoft.AspNet.Identity.EntityFramework.<GetUserAggregateAsync>d__6c.MoveNext() +483 
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 
    Microsoft.AspNet.Identity.CultureAwaiter`1.GetResult() +59 
    Microsoft.AspNet.Identity.<FindAsync>d__12.MoveNext() +267 
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 
    com.phiresky.tatami.api.Providers.<GrantResourceOwnerCredentials>d__2.MoveNext() +234 
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 
    Microsoft.Owin.Security.OAuth.<InvokeTokenEndpointResourceOwnerPasswordCredentialsGrantAsync>d__3f.MoveNext() +466 
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 
    System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) +25 
    Microsoft.Owin.Security.OAuth.<InvokeTokenEndpointAsync>d__22.MoveNext() +1552 
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 
    System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) +25 
    Microsoft.Owin.Security.OAuth.<InvokeAsync>d__0.MoveNext() +1103 
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 
    Microsoft.Owin.Security.Infrastructure.<Invoke>d__0.MoveNext() +435 
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 
    Microsoft.Owin.Security.Infrastructure.<Invoke>d__0.MoveNext() +638 
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 
    Microsoft.Owin.Security.Infrastructure.<Invoke>d__0.MoveNext() +638 
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 
    Microsoft.AspNet.Identity.Owin.<Invoke>d__0.MoveNext() +404 
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 
    Microsoft.AspNet.Identity.Owin.<Invoke>d__0.MoveNext() +404 
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 
    Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.<RunApp>d__5.MoveNext() +182 
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 
    Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.<DoFinalWork>d__2.MoveNext() +180 
    Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.StageAsyncResult.End(IAsyncResult ar) +69 
    Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.EndFinalWork(IAsyncResult ar) +64 
    System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +380 
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155 
+0

실제로 이것은 연결 문자열이 잘못되었거나 완전히 누락 된 것처럼 들립니다. 배포 마법사를 살펴보고 '설정'섹션을 볼 수 있습니까? 원격 시스템에서 연결 문자열이 업데이트되는 방법에 대한 몇 가지 옵션이 있어야합니다. 로컬 설정으로 원격 구성을 업데이트하지 않는 것 같습니다. –

답변

5

가 알았어요! 매우 이상하지만 나는 Azure 포털 -> App Services-> {My App} -> 응용 프로그램 설정으로 가야만했습니다.

연결 문자열에 대한 설정이 있습니다. 연결 문자열의 사용자 ID 값이 null입니다. 내 일반적인 연결 문자열로 변경하고 지금은 잘 작동합니다.

+0

이것은 처음으로 푸른으로 배포되었습니다. 이전 배포에서와 마찬가지로 my web.config에 대한 변경 사항이 참조되지 않았 음을 알지 못했습니다. 이것은 나를 해결하는 데 도움이! – dj22

+0

MAN, 감사합니다! –

0

제 경우 VS 2017 및 IIS8과 함께 Entity Framework를 사용합니다. -> [데이터베이스] 폴더 -> [보안] 폴더 -> [로그인] 폴더

  1. 이동 MSSQL에 대한 관리 Studio
  2. [서버가] :

    나는 빨리 감기를 수행하여이 오류를 해결
  3. 오른쪽 클릭 [NT AUTHORITY \ 시스템] -> [속성] -> [서버 역할]
  4. 확인 [공개] 및 [시스템 관리자]
IIS에서
  • 다시 시작 웹 사이트