Skip to main content

Changing Settings During a Crawl

A crawl is started with the project's settings as they were at that moment. While it runs, the API accepts changes that cannot alter what the crawl collects, and refuses the ones that would. This page lists both, and the errors a refused change returns.

When a crawl counts as running​

A project's crawl counts as running while its latest crawl's statusEnum is Crawling or Paused, and during the first part of Finalizing, while the crawled data is still being processed. A paused crawl blocks changes as a running one does: resume or cancel it to unblock them. Changes are not refused while the latest crawl is Queued. A Finalizing crawl may still refuse a change, so treat that refusal like any other and retry once the crawl is Finished.

To avoid the refusal, read Project.lastCrawlStatus before a change: it returns the latest crawl's CrawlStatus in one field. Otherwise, handle the error and retry once the crawl has finished.

Project settings (updateProject)​

The rules in this section apply to updateProject and, for Protect test suites, to updateTestSuite.

updateProject compares each submitted value with the stored one, and only a value that differs counts as a change, so most settings can be resent unchanged without a refusal. There are exceptions: testSitePassword counts as a change whenever it is sent, even with the same password, and an empty list may not compare equal to a setting that is stored as null. While a crawl is running, the safe approach is to send only the settings you mean to change, and to omit testSitePassword unless you are changing it.

These settings can change during a crawl and apply to the running crawl:

  • maximumCrawlRate and maximumCrawlRateAdvanced, except on projects with useStealthMode on: the new rate is saved but reaches only the next crawl
  • limitLevelsMax and limitPagesMax
  • autoFinalizeOnCrawlLimits
  • compareToCrawl
  • failureRateLimitEnabled, failureRateLookbackWindow and failureRateThreshold

These settings can change during a crawl and apply from the next crawl, because the running crawl does not read them:

  • crawlRobotsTxtNoindex
  • gaDateRange
  • minVisits

A change to any other crawl setting, including crawlTypes, is refused with PROJECT_UPDATE_DISALLOWED_CRAWL_RUNNING and nothing in the mutation is saved. Fields that do not configure a crawl, such as the project's name, can always change.

The refused settings​

The error's extensions.disallowedSettings lists every setting that was refused, so a client can drop those and resend the rest:

{
"errors": [
{
"message": "A Crawl is currently running and some of the provided settings cannot be updated.",
"extensions": {
"code": "PROJECT_UPDATE_DISALLOWED_CRAWL_RUNNING",
"disallowedSettings": ["crawlSubdomains", "crawlTypes"]
},
"path": ["updateProject"]
}
]
}

Most names match the UpdateProjectInput field you sent. Some are reported under the project's stored setting name instead, as crawlSubdomains is in the example above for includeSubdomains. Others include crawlCanonicalsInt for crawlRelCanonicalsInternal, and encryptedSiteTestPass and encryptedSiteTestPassIv for testSitePassword. If a name does not match a field you sent, the safe fallback is to send only the settings you meant to change.

Data sources​

Changes to the sources a crawl reads are refused while it runs, because they would add data to the crawl or take it away. These mutations fail with ACTION_DISALLOWED_CRAWL_RUNNING:

  • sitemaps: addCustomSitemaps, enableSitemap, enableSitemaps, disableSitemap, disableSitemaps and deleteSitemap
  • URL file uploads: createSignedUrlFileUpload, updateUrlFileUpload and deleteUrlFileUpload
  • Google Analytics 4: createGoogleAnalytics4ProjectProperty, updateGoogleAnalytics4ProjectProperty and deleteGoogleAnalytics4ProjectProperty
  • Google Search Console: the create, update and delete mutations for GoogleSearchConsoleProperty and GoogleSearchConsoleConfiguration
  • Adobe Analytics: createAdobeAnalyticsProjectReportSuite, updateAdobeAnalyticsProjectReportSuite and deleteAdobeAnalyticsProjectReportSuite
  • Logz.io and Splunk: the create, update and delete mutations for LogzioProjectQuery and SplunkProjectQuery
  • Lumar Log Manager: changes that add a log source to the running crawl or take one away. Other Log Manager changes apply from the next crawl; see Changes while a crawl is running

createMajesticConfiguration and updateMajesticConfiguration are refused in the same situation with their own code, MAJESTIC_CONFIGURATION_UPDATE_DISALLOWED_CRAWL_RUNNING.

These errors name no settings: the whole change waits for the crawl. The one exception is deleting a Log Manager source, whose error lists the blocking projects in extensions.projectIds.

Segments​

Segment changes are never refused during a crawl. A crawl uses the project's segments, at the versions they had, when it started crawling. This holds until the crawl is Finished, including the whole of Finalizing, so:

  • a segment created with createCrawlUrlSegment after a crawl has started is not generated for that crawl. It applies from the next crawl
  • a crawlUrlFilter edited with updateSegment or updateSegments after a crawl has started applies from the next crawl. The unfinished crawl keeps the filter it started with
  • deleteSegment takes effect at once. An unfinished crawl finishes without the segment

Changes made while the crawl is Queued apply to it. See Segment history for how edits and deletes affect earlier crawls.

Reports​

A crawl's reports are fixed when it starts crawling. They are generated from the report templates available to the project at that moment, each at the version it had then, and from the data sources the crawl produces. So:

  • a report template Lumar adds or updates while a crawl is running applies from the next crawl. The unfinished crawl is reported with the templates it started with
  • custom report templates and the custom metric containers linked to the project are fixed earlier, when the crawl is created. One created or linked after that, even while the crawl is Queued, applies from the next crawl, including when the crawl was created with none. Custom metric upload containers are read later, when the crawl starts crawling
  • Crawl.crawlDatasources and Crawl.crawlDatasource return a crawl's data sources from the moment it starts crawling, before any of their data has been processed. A listed data source does not mean its data can be read yet
  • an unarchived crawl keeps the reports and data sources it originally had

Error codes​

CodeReturned byWhat it carries
PROJECT_UPDATE_DISALLOWED_CRAWL_RUNNINGupdateProject, updateTestSuiteextensions.disallowedSettings
ACTION_DISALLOWED_CRAWL_RUNNINGThe data source mutations aboveextensions.projectIds on deletes of a Log Manager source
MAJESTIC_CONFIGURATION_UPDATE_DISALLOWED_CRAWL_RUNNINGcreateMajesticConfiguration, updateMajesticConfigurationNothing beyond the code

None of them is fixed by retrying straight away. Retry after the crawl finishes, or, for PROJECT_UPDATE_DISALLOWED_CRAWL_RUNNING, resend without the refused settings. See also the Error Codes Reference.