Welcome to the Alteryx Knowledge Base
Created/Edited -
This process is for MongoDB Persistence only. Do not use for SQL DB Persistence.
Run a manual re-index and when to do it.
Alteryx Server uses indexes to improve the performance of the Server UI. At times the indexing system can stop functioning and require reindexing to resume functioning. The most common cause for this is an unclean shutdown (hard stop) of the Service.
- All versions of Alteryx Server
- Embedded Mongo
- User-Managed Mongo (except Atlas or TLS-enabled MongoDB)
Common symptoms that may indicate the need for reindexing:
- Newly published workflows can be accessed if the user clicks on "View in Browser", but do not appear when the user views their workspace.
- User name lookup may not find users when trying to add them to a Shared Gallery Database Connection or Collections.
The reindexing process is quick and does not require a Service restart or interrupt your users. While it's safe, it's always a best practice to have a recent backup of your database before making any changes. See: Alteryx Server Backup and Recovery Part 2: Procedures.
STEP 1 Get the Controller Token and Mongo database User password
- Go to the Controller node for your Alteryx Server
- Run Alteryx System Settings
- Copy the Controller > General > Controller Token
- Copy the Controller > Persistence > non-admin Password
- Click Cancel to exit Alteryx System Settings
STEP 2 Delete MongoDB locks and commandQueueItems
- Open a Command Prompt as the Administrator.
- Navigate to your installation location for \Alteryx\bin. By default, this is C:\Program Files\Alteryx\bin
- Prepare your commands by copying the version-specific set of commands into Notepad and replacing MONGO_PASSWORD with your password from above. For User-Managed Mongo, the connection string will need to be appropriate for your Mongo installations, see: MongoDB Advanced Connection Strings
- Copy and paste all lines into the command prompt and hit enter to ensure the Mongo Shell executes the final exit command.
VERSION 23,2+
mongosh -u user -p MONGO_PASSWORD -host localhost:27018 AlteryxGallery
db.locks.remove({})
db.commandQueueItems.remove({})
db.searchLocks.remove({})
exit
-- Press Enter to exit --
VERSION 23.1
mongo -u user -p MONGO_PASSWORD -host localhost:27018 AlteryxGallerydb.locks.remove({})db.commandQueueItems.remove({})db.searchLocks.remove({})exit
-- Press Enter to exit --
VERSION 23.1 and prior
mongo -u user -p MONGO_PASSWORD -host localhost:27018 AlteryxGallerydb.locks.remove({})db.commandQueueItems.remove({})exit
-- Press Enter to exit --
mongo -u user -p MONGO_PASSWORD -host localhost:27018 AlteryxGallery_Lucenedb.luceneFs.locks.remove({})exit
-- Press Enter to exit --
- Close the Command Prompt window.
STEP 3 Run the "Rebuild Gallery Indexes.yxmd" workflow
- Download the attached workflow. Scroll down to the end of this article to find it.
- Open the workflow in Alteryx Designer. Select the Run button.
- Configure it as instructed in the workflow.
-
- Single-node environment -- If running on the Server, use a URL that works to access the Gallery from the server. This is http://localhost/gallery in some environments.
- Multi-node environment -- Run the workflow from your local machine. This will properly handle a multi-node environment where the Gallery may be on its own server or accessed through a load balancer.
- Your machine -- Use the Gallery URL you use to connect to the Gallery.
- Confirm the issue that led you to attempt reindexing is now working as expected. Note: If you have to reindex frequently, open a Customer Support case as there may be a deeper issue occuring.
STEP 4 For 23.1 and 23.2 only, confirm no indexes were skipped
- In 23.1 and 23.2, if a 500 error was received when running the reindexing workflow, a 200 may be returned if it's run again. However, this indicates the reindexing process SKIPPED an index that failed to build on the first run. Please open a Customer Support case and provide the Gallery log for the time of the reindexing attempts.
- You can manually review the Gallery log to ensure no indexes were skipped by confirming there are no lines like the following (where COLLECTION_TO_INDEX will vary for the indexes being rebuilt):
Skipped rebuilding the COLLECTION_TO_INDEX index.,
Troubleshooting
Following are issues and possible resolutions for problems encountered when reindexing.
- 404 Error
Go to the Gallery in the browser and ensure the URL used in the browser is the same used in the workflow.
- 403 Error
This indicates the workflow can't connect to the Server API while running on the Server machine or that the wrong Controller Token was entered.
-
- Confirm the Controller Token is correct.
- If running on the Server try both http://localhost and the FQDN for the URL.
- Try running the workflow from your local desktop using the URL used to access the Gallery (followed by /api/status/rebuild/all).
- 500 error -- 23.1 and 23.2 only
For 23.1 and 23.2 Server please read the following carefully.
When the 23.1/23.2 reindex process fails to index one of the ~12 collections it indexes it will:
-
- stop
- not reindex the remaining collections
- return a 500 error
- log the cause of the error
- set a 15-minute flag in the searchLocks collections that will cause the reindexer to skip this collection on the next reindex attempt (within the 15-minute timeout window).
When the workflow is run a second time the index that couldn't be generated will be skipped and, if the remaining indexes can be generated, the call will return 200. Despite the 200 return, at least one index was NOT created. Therefore assets (like Workflows or Users) may not appear in the Server UI. Please open a Support case and provide the Gallery logs that cover the time you made the multiple attempts to reindex.
Example of a 500 error shown in the Results pane for the Browse Tool:
- 500 error - all versions
- Option for 23.1/23.2 -- See section above.
- Option for 23.3 and prior -- The step to delete locks above may have been skipped. This can appear in the Gallery logs as:
2022-09-05 09:15:11.678892,ERROR,77,AlteryxServerHost,ErrorHandler POST,/gallery/api/status/rebuild/all,500,
2022-09-05 09:15:11.678892,ERROR,77,AlteryxServerHost,ErrorHandler,… Lock obtain timed out: MongoDB.Lucene.MongoDocumentLock-...
- Option for all versions -- This may be caused by FIPs being enabled on the Server. Please see: Alteryx Server: Troubleshooting 500 error message when rebuilding Gallery Indexes
- JSON Parse Tool error: Error message: Invalid value, at character position: 0
Error:
Review what the Download Tool Output Anchor shows.
This is multi-line content. so right-click, copy, and paste into a text editor.
In the specific example above, access is denied to the reindexing endpoint. In this case, the reindexing workflow was blocked from running on the Server itself, but could be run the user's machine.
- A timeout error from the Download Tool
- Increase the number of seconds the Download Tool will waitin the tool's configuration, OR
- Change the API call to run each reindex individually. Replace the word all at the end of the API call with:
-
-
- AppInfo
- Subscription
- User
- Tag
- Page
- District
- Media
- Credential
- DataConnection
- Insight
-