对 Power BI 报表服务器中的计划刷新进行故障排除Troubleshoot scheduled refresh in Power BI Report Server

本文将讨论可用于解决 Power BI 报表服务器中计划刷新问题的资源。This article discusses resources available to troubleshoot issues with scheduled refresh in Power BI Report Server.

对于后续出现的问题,本文将进行信息更新以为你提供帮助。As issues come up, this article will be updated with information to help you.

常见问题Common issues

以下是在尝试为报表计划刷新时会遇到的较为常见的一些问题。The following are the more common issues you will hit when trying to schedule refresh for a report.

连接到不同的数据源可能需要安装第三方驱动程序才能成功连接。Connecting to different data sources may require 3rd party drivers that need to be installed in order to connect successfuly. 不仅需要在使用 Power BI Desktop 的计算机上安装驱动程序,而且还需要确保在报表服务器上安装驱动程序。Not only would you need to install them on the machine you are using Power BI Desktop on, but you will also need to make sure the driver is installed on the report server.

另外,可能会同时提供 32 位和 64 位驱动程序。The driver may also come in both 32bit and 64bit. 请确保安装 64 位驱动程序,因为 Power BI 报表服务器是 64 位的。Make sure to install the 64bit driver as Power BI Report Server is 64bit.

有关如何安装和配置第三方驱动程序的详细信息,请咨询制造商。Please refer to the manufacturer for details on how to install and configure 3rd party drivers.

内存压力Memory pressure

当报表需要更多内存来进行处理和呈现时,可能会出现内存压力。Memory pressure can occur when reports require more memory to process and render. 报表上的计划刷新可能需要占用计算机上的大量内存,Schedule refresh on reports may demand a significant amount of memory on the machine. 尤其是对于较大的报表。Especially for larger reports. 内存压力可能会导致报表失败,也可能会导致报表服务器本身崩溃。Memory pressure can result in report failures as well as a potential crash of the report server itself.

如果持续遇到内存压力,则可能需要查看报表服务器的横向扩展部署,以便分散资源负载。If you are encountering memory pressure consistently, it may be worth looking at a scaled out deployment of the report server in order to spread the load of resources. 另外,还可以使用 rsreportserver.config 内的 IsDataModelRefreshService 设置定义给定的报表服务器用于数据刷新。使用此设置,可以定义一个或多个服务器作为前端服务器来处理按需报表,并将另一组服务器定义为专用于计划的刷新。You can also define that a given report server is used for data refresh with the IsDataModelRefreshService setting within rsreportserver.config. With this setting, you could define one or more servers to be the front end server to handle on demand reports, and have another set of servers to only be used for scheduled refresh.

有关如何监视 Analysis Services 实例的信息,请参阅监视 Analysis Services 实例For information on how to monitor an Analysis Services instance, see Monitor an Analysis Services Instance.

有关 Analysis Services 中内存设置的信息,请参阅内存属性For information about memory settings within Analysis Services, see Memory Properties.

Kerberos 配置Kerberos configuration

使用 Windows 凭据连接到数据源可能需要配置 Kerberos 约束委派才能建立成功的连接。Connecting to a data source with windows credentials may require configuring Kerberos constrained delegation to make a successful connection. 有关如何配置 Kerberos 约束委派的详细信息,请参阅配置 Kerberos 以使用 Power BI 报表For more information about how to configure Kerberos constrained delegation, see Configure Kerberos to use Power BI reports.

已知问题Known issues

有关已知问题的信息可用时将在此处列出。Information about known issues will be listed here when they become available.

配置设置Configuration settings

可以使用以下设置影响计划的刷新。The following settings can be used to affect scheduled refresh. 在 SQL Server Management Studio (SSMS) 中设定的设置适用于横向扩展部署中的所有报表服务器。Settings set within SQL Server Management Studio (SSMS) apply to all report servers within a scale-out deployment. 在 rsreportserver.config 中配置的设置适用于设定这些设置的特定服务器。Settings configured within rsreportserver.config are for the specific server they are set on.

SSMS 中的设置:Settings within SSMS:

设置Setting 说明Description
EnablePowerBIReportEmbeddedModelsEnablePowerBIReportEmbeddedModels 启用或禁用使用报表中的导入数据的功能。Enables or disables the ability to use imported data within your reports. 有效值为 True 或 False。Valid values are True or False.
MaxFileSizeMbMaxFileSizeMb 已上载报表的最大文件大小。Maximum file size for uploaded reports. 默认值为 1000 MB (1 GB)。Default is 1000 MB (1 GB). 最大值为 2000 MB (2 GB)。Maximum value is 2000 MB (2 GB).
ModelCleanupCycleMinutesModelCleanupCycleMinutes 定义检查模型以将其从内存中收回的频率。Defines how often the model is checked to evict it from memory. 默认值为 15 分钟。Default is 15 minutes.
ModelExpirationMinutesModelExpirationMinutes 根据上次使用时间定义模型的到期并将其收回的时长。Defines how long until the model expires based on the last time used and is evicted. 默认值为 60 分钟。Default is 60 minutes.
ScheduleRefreshTimeoutMinutesScheduleRefreshTimeoutMinutes 定义一个模式的数据刷新需要多长时间。Defines how long the data refresh can take for a mode. 默认值为 120 分钟。Default is 120 minutes. 没有上限。There is no upper limit.

rsreportserver.config 中的设置:Settings within rsreportserver.config:

<Configuration>
    <Service>
        <PollingInterval>10</PollingInterval>
        <IsDataModelRefreshService>false</IsDataModelRefreshService>
        <MaxQueueThreads>0</MaxQueueThreads>
    </Service>
</Configuration>

用于故障排除的工具Tools for troubleshooting

与 Power BI 报表的计划刷新相关的日志Logs relevant for scheduled refresh of Power BI reports

保存有关计划刷新信息的日志文件是 RSPowerBI_ 日志。The log files which hold information about scheduled refresh are the RSPowerBI_ logs. 这些文件位于报表服务器安装位置的 LogFiles 文件夹中。They are located in the LogFiles folder of your report server installation location.

C:\Program Files\Microsoft Power BI Report Server\PBIRS\LogFiles\RSPowerBI_*.log

错误条件Error condition

2017-10-20 02:00:09.5188|ERROR|744|Error Processing Data Model Refresh: SessionId: e960c25e-ddd4-4763-aa78-0e5dceb53472, Status: Error Model can not be refreshed because not all the data sources are embedded, Exception Microsoft.PowerBI.ReportServer.AsServer.InvalidDataSourceException: Model can not be refreshed because not all the data sources are embedde
   at Microsoft.PowerBI.ReportServer.WebHost.EventHandler.AnalysisServicesDataRefresh.CanModelRefresh(IEnumerable`1 dataSources)
   at Microsoft.PowerBI.ReportServer.WebHost.EventHandler.DataRefreshScope.<>c__DisplayClass7.<ExecuteActionWithLogging>b__5()
   at Microsoft.PowerBI.ReportServer.WebHost.EventHandler.DataRefreshScope.<ExecuteFuncWithLogging>d__1`1.MoveNext()

成功刷新Successful refresh

2017-10-25 15:23:41.9370|INFO|6|Handling event with data: TimeEntered: 10/25/2017 8:23:41 PM, Type: Event, SessionId: 46d398db-0b1f-49d8-b7bd-c5461c07ec7a, EventType: DataModelRefresh
2017-10-25 15:23:41.9370|INFO|6|Processing Data Model Refresh: SessionId: 46d398db-0b1f-49d8-b7bd-c5461c07ec7a, Status: Starting Data Refresh.
2017-10-25 15:23:41.9370|INFO|6|Processing Data Model Refresh: SessionId: 46d398db-0b1f-49d8-b7bd-c5461c07ec7a, Status: Starting Retrieving PBIX AsDatabaseInfo.
2017-10-25 15:23:42.7134|INFO|6|Processing Data Model Refresh: SessionId: 46d398db-0b1f-49d8-b7bd-c5461c07ec7a, Status: Starting Verifying all the data sources are embedded.
2017-10-25 15:23:42.7134|INFO|6|Processing Data Model Refresh: SessionId: 46d398db-0b1f-49d8-b7bd-c5461c07ec7a, Status: Starting Verifying connection strings are valid.
2017-10-25 15:23:42.7134|INFO|6|Processing Data Model Refresh: SessionId: 46d398db-0b1f-49d8-b7bd-c5461c07ec7a, Status: Starting Streaming model to Analysis Server.
2017-10-25 15:23:42.7603|INFO|6|Processing Data Model Refresh: SessionId: 46d398db-0b1f-49d8-b7bd-c5461c07ec7a, Status: Starting Refreshing the model.
2017-10-25 15:23:51.5258|INFO|6|Processing Data Model Refresh: SessionId: 46d398db-0b1f-49d8-b7bd-c5461c07ec7a, Status: Starting Removing credentials from the model.
2017-10-25 15:23:51.6508|INFO|6|Processing Data Model Refresh: SessionId: 46d398db-0b1f-49d8-b7bd-c5461c07ec7a, Status: Starting Saving model to the catalog.

不正确的凭据Incorrect Credentials

2017-10-20 08:22:01.5595|INFO|302|Processing Data Model Refresh: SessionId: 22cd9ec3-b21a-4eb1-81ae-15fac8d379ea, Status: Starting Refreshing the model.
2017-10-20 08:22:02.3758|ERROR|302|Error Processing Data Model Refresh: SessionId: 22cd9ec3-b21a-4eb1-81ae-15fac8d379ea, Status: Error Failed to refresh the model, Exception Microsoft.AnalysisServices.OperationException: Failed to save modifications to the server. Error returned: 'The credentials provided for the SQL source are invalid. (Source at rosecatalog;reportserver.). The exception was raised by the IDbCommand interface.
'.
   at Microsoft.AnalysisServices.Tabular.Model.SaveChanges(SaveOptions saveOptions)
   at Microsoft.PowerBI.ReportServer.AsServer.TOMWrapper.RefreshModel(Database database)
   at Microsoft.PowerBI.ReportServer.AsServer.AnalysisServicesServer.RefreshDatabase(String databaseName, IEnumerable`1 dataSources)
   at Microsoft.PowerBI.ReportServer.WebHost.EventHandler.AnalysisServicesDataRefresh.RefreshDatabase(AsDatabaseInfo asDatabaseInfo)
   at Microsoft.PowerBI.ReportServer.WebHost.EventHandler.DataRefreshScope.<>c__DisplayClass7.<ExecuteActionWithLogging>b__5()
   at Microsoft.PowerBI.ReportServer.WebHost.EventHandler.DataRefreshScope.<ExecuteFuncWithLogging>d__1`1.MoveNext()
2017-10-20 08:22:02.4588|ERROR|302|Error Processing Data Model Refresh: SessionId: 22cd9ec3-b21a-4eb1-81ae-15fac8d379ea, Status: Error Failed Data Refresh, Exception Microsoft.AnalysisServices.OperationException: Failed to save modifications to the server. Error returned: 'The credentials provided for the SQL source are invalid. (Source at rosecatalog;reportserver.). The exception was raised by the IDbCommand interface.
'.
   at Microsoft.PowerBI.ReportServer.WebHost.EventHandler.DataRefreshScope.ExecuteActionWithLogging(Action methodToExecute, String description, String localizedDescription, String messageInFailure, RefreshInfo refreshInfo, DataAccessors dataAccessors, ReportEventType operation, Int64 size, Boolean isDataRetrieval, Boolean showInExecutionLog)
   at Microsoft.PowerBI.ReportServer.WebHost.EventHandler.AnalysisServicesDataRefresh.RefreshData(RefreshInfo refreshInfo)
   at Microsoft.PowerBI.ReportServer.WebHost.EventHandler.DataRefreshScope.<>c__DisplayClass7.<ExecuteActionWithLogging>b__5()
   at Microsoft.PowerBI.ReportServer.WebHost.EventHandler.DataRefreshScope.<ExecuteFuncWithLogging>d__1`1.MoveNext()

启用详细日志记录Enabling Verbose Logging

在 Power BI 报表服务器中启用详细日志记录与 SQL Server Reporting Services 相同。Enabling verbose logging, in Power BI Report Server, is the same as it is for SQL Server Reporting Services.

  1. 打开 <install directory>\PBIRS\ReportServer\bin\ReportingServicesService.exe.configOpen <install directory>\PBIRS\ReportServer\bin\ReportingServicesService.exe.config.
  2. <system.diagnostics> 下,将 DefaultTraceSwitch 更改为 4。Under <system.diagnostics>, change DefaultTraceSwitch to 4.
  3. <RStrace> 下,将 Components 更改为 all:4。Under <RStrace>, change Components to all:4.

ExecutionLogExecutionLog

每当呈现 Power BI 报表或执行计划刷新计划时,都会向数据库中的执行日志添加新条目。Whenever a Power BI report is rendered, or a schedule refresh plan is executed, new entries are added to the Execution Log in the database. 这些条目可在报表服务器目录数据库内的 ExecutionLog3 视图中查看。These entries are available in the ExecutionLog3 view within the report server catalog database.

Power BI 报表的执行日志条目不同于其他报表类型的条目。Execution log entries for Power BI reports differ from entries for other report types.

  • TimeRendering 列始终是 0。TimeRendering columns is always 0. Power BI 报表的呈现是在浏览器中,而不在服务器中。Rendering of Power BI reports happens in the browser, not in the server.
  • 存在 2 种请求类型和后续项操作:There are 2 Request Types and subsequent item actions:
    • 交互式:每当查看报表时。Interactive: whenever a report is being viewed.
      • ASModelStream:当数据模型从目录流式传输到 Analysis Services 时。ASModelStream: when the data model is streamed to Analysis Services from the catalog.
      • ConceptualSchema:当用户单击查看报表时。ConceptualSchema: when user clicks on viewing the report.
      • QueryData:每当从客户端请求数据时。QueryData: whenever data is being requested from client.
    • 刷新缓存:每当已执行计划刷新计划时。Refresh Cache: whenever a schedule refresh plan has been executed.
      • ASModelStream:每当数据模型从目录流式传输到 Analysis Services 时。ASModelStream: whenever the data model is streamed to Analysis Services from the catalog.
      • DataRefresh:每当从一个或多个数据源刷新数据时。DataRefresh: whenever data is being refreshed from one or more data sources.
      • SaveToCatalog:每当将数据模型保存回目录时。SaveToCatalog: whenever the data model is being saved back to the catalog.

Analysis ServicesAnalysis Services

有时你可能需要修改 Analysis Services 以诊断问题,或者调整内存限制。There may be times you want to modify Analysis Services for diagnositing issues, or adjust memory limits.

重要

这些设置将在升级报表服务器时重置。These settings will be reset any time you upgrade the report server. 请务必保留更改的副本,并根据需要重新应用。Be sure to keep a copy of your changes and reapply them if needed.

安装位置Install location

Power BI 报表服务器和 Analysis Services 的默认位置如下所示。The default location for Power BI Report Server, and Analysis Services is the following.

C:\Program Files\Microsoft Power BI Report Server\PBIRS\ASEngine

配置 Analysis Services 设置 (msmdsrv.ini)Configuring Analysis Services settings (msmdsrv.ini)

<install directory>\PBIRS\ASEngine 目录中,将会找到 msmdsrv.ini 文件,其可用于控制 Analysis Services 的不同设置。In the <install directory>\PBIRS\ASEngine directory, you will find the msmdsrv.ini file, which you can use to control different settings of Analysis Services. 打开此文件时,你会很快意识到此文件并没有你所期望的 msmdsrv.ini 文件中的所有设置。When you open this file, you will immediately realize that this file doesn't have all the settings you would expect in the msmdsrv.ini file.

这是因为在 <install directory>\PBIRS\ASEngine\workspaces 中启动了由 Power BI 报表服务器运行的实际 Analysis Services 进程。This is because the actual Analysis Services process that is run by Power BI Report Server is launched in <install directory>\PBIRS\ASEngine\workspaces. 在该文件夹中,你将看到经常使用的完整 msmdsrv.ini 文件。In that folder, you will see the full msmdsrv.ini file you are used to. 重要的是不要修改工作区文件夹内的文件,因为每当 Analysis Services 进程启动时都会重写该文件。It is important not to modify the file within the workspaces folder as it is rewritten whenever the Analysis Services process launches. 如果你想要控制设置,请通过修改 <install directory>\PBIRS\ASEngine 目录中的 msmdsrv.ini 来实现。If you want to control a setting, please do this by modifying msmdsrv.ini in the <install directory>\PBIRS\ASEngine directory.

每当启动 Analysis Services 进程时,都会重置以下设置。The following settings are reset when ever the Analysis Services process is launched. 你对这些设置进行的任何更改都将被忽略。Any changes you make to these will be ignored.

  • ConfigurationSettings\PrivateProcessConfigurationSettings\PrivateProcess
  • ConfigurationSettings\DataDirConfigurationSettings\DataDir
  • ConfigurationSettings\LogDirConfigurationSettings\LogDir
  • ConfigurationSettings\TempDirConfigurationSettings\TempDir
  • ConfigurationSettings\BackupDirConfigurationSettings\BackupDir
  • ConfigurationSettings\AllowedBrowsingFoldersConfigurationSettings\AllowedBrowsingFolders
  • ConfigurationSettings\CrashReportsFolderConfigurationSettings\CrashReportsFolder
  • ConfigurationSettings\ExtensionDirConfigurationSettings\ExtensionDir
  • ConfigurationSettings\PortConfigurationSettings\Port
  • ConfigurationSettings\DeploymentModeConfigurationSettings\DeploymentMode
  • ConfigurationSettings\ServerLocationConfigurationSettings\ServerLocation
  • ConfigurationSettings\TMCompatabilitySKUConfigurationSettings\TMCompatabilitySKU
  • ConfigurationSettings\FlightRecorder\TraceDefinitionFileConfigurationSettings\FlightRecorder\TraceDefinitionFile

分析本地 Analysis Services 进程Profiling the local Analysis Services process

SQL 事件探查器跟踪可以在本地 Analysis Services 进程上运行,以进行诊断。A SQL Profiler trace can be run on the local Analysis Services process for diagnostic purposes. 要连接到本地 Analysis Services 实例,请执行以下操作。To connect to the local Analysis Services instance, do the following.

SQL Server Profiler 跟踪包含在 SQL Server Management Studio (SSMS) 下载中。SQL Server Profiler Trace is included with the SQL Server Management Studio (SSMS) download.

  1. 以管理员身份启动 SQL Server Profiler。Start SQL Server Profiler as an administrator.
  2. 选择“新建跟踪”按钮。Select the New Trace button.
  3. 在“连接到服务器”对话框中,选择“Analysis Services”,然后输入 localhost:5132 作为服务器名。In the Connect to server dialog, select Analysis Services and enter localhost:5132 for the server name.
  4. 在“跟踪属性”对话框中,选择要捕获的事件,然后选择“运行”。In the Trace properties dialog, select the events you want to capture and select Run.

锁定内存页 Windows 特权Lock Pages In Memory Windows privilege

如果发现无法呈现 Power BI 报表,则可将“锁定内存页”特权分配给正在运行 Power BI 报表服务器的服务帐户可能会有所帮助。If you find that you are unable to render a Power BI report, assigning the Lock pages in memory privilege to the services account running Power BI Report server may help. 有关如何配置“锁定内存页”的详细信息,请参阅分配给 Analysis Services 服务帐户的 Windows 特权For more information about how to configure Lock pages in memory, see Windows privileges assigned to the Analysis Services service account.

更多问题?More questions? 尝试咨询 Power BI 社区Try asking the Power BI Community