Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to post new tracks in production, since deployment of version 1.49.3 or 1.49.4 #612

Closed
adrienjoly opened this issue May 27, 2023 · 8 comments · Fixed by #621 or #622
Closed
Assignees
Labels

Comments

@adrienjoly
Copy link
Member

adrienjoly commented May 27, 2023

Describe the bug
Unable to post a track on openwhyd.org.

To Reproduce
Steps to reproduce the behavior:

  1. Login from openwhyd.org
  2. paste a youtube URL to the search bar => add it
  3. => the track is not posted
  4. => the corresponding API request fails with a 502 status code
  5. => openwhyd's server restards

Expected behavior

A green banner should inform that the track was posted.

Screenshots

Production logs after reproducing:
Capture d’écran 2023-05-27 à 14 52 52 copie

Note: the order of logs is reversed. => read from bottom to top.

Spotted error: getIndex(...).addObjects is not a function in searchAlgolia.js:309

@adrienjoly adrienjoly self-assigned this May 27, 2023
@adrienjoly adrienjoly added the bug label May 27, 2023
@adrienjoly
Copy link
Member Author

Rolled back production to version 1.49.2:

git checkout d90f61158f60c6237e0cb2b0c676866b68755cca
npm install --prefer-offline --no-audit --production && cd scripts && ./restart.sh

=> I was able to post YouTube track after that.

=> The problem may come from changes happening between versions 1.49.2 and 1.49.4.

@adrienjoly
Copy link
Member Author

adrienjoly commented May 27, 2023

Potential source of error: update of algoliasearch dependency from version 3.35 to 4.17, cf 5fad246#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R61, in PR #606.

cf changelog

@adrienjoly
Copy link
Member Author

happened again on v1.49.8 in production

{
	"id": "AgAAAYl3mxH2PYGt1gAAAAAAAAAYAAAAAEFZbDNteUdzQUFESkxIUDZCWU1rN2dBQQAAACQAAAAAMDE4OTc3OWItMzNkNy00N2E2LTg4NGUtMDQzYmFlMmE4YWI5",
	"content": {
		"timestamp": "2023-07-21T08:39:58.710Z",
		"tags": [
			"service:openwhyd_pm2_err",
			"source:node",
			"filename:app-error.log",
			"datadog.submission_auth:private_api_key",
			"datadog.pipelines:false"
		],
		"host": "openwhyd-2gb",
		"service": "openwhyd_pm2_err",
		"message": "[31m❌ Error -- Fri, 21 Jul 2023 08:39:58 GMT TypeError: getIndex(...).addObjects is not a function",
		"attributes": {}
	}
}

https://app.datadoghq.com/logs?query=&cols=host%2Cservice&event=AgAAAYl3mxH2PYGt1gAAAAAAAAAYAAAAAEFZbDNteUdzQUFESkxIUDZCWU1rN2dBQQAAACQAAAAAMDE4OTc3OWItMzNkNy00N2E2LTg4NGUtMDQzYmFlMmE4YWI5&index=%2A&messageDisplay=inline&stream_sort=desc&viz=stream&from_ts=1689927936244&to_ts=1689928836244&live=true

adrienjoly added a commit that referenced this issue Jul 21, 2023
@adrienjoly adrienjoly reopened this Jul 21, 2023
@adrienjoly
Copy link
Member Author

disabled indexing of new tracks in v1.49.10, freshly deployed in production.,

@adrienjoly
Copy link
Member Author

Precision: despite 502 error from the /post API because of the algolia indexing error, track are posted.

@adrienjoly
Copy link
Member Author

adrienjoly commented Jul 22, 2023

First recent occurrence of this bug:

  • according to logs: Tue, 18 Jul 2023 13:00:03 GMT
  • according to datadog: Jul 18, 2023 at 15:00:04.505 (4 days ago)
image

Last version before that date: v1.49.6

image

Version actually running in production at time of first occurrence: v1.49.5

image

cf https://app.datadoghq.com/logs?query=v1.49.5%20&cols=host%2Cservice&event=AgAAAYlpCCzcyAydsAAAAAAAAAAYAAAAAEFZbHBDRFI2QUFEc0RuTlJtbmF4ZndBRAAAACQAAAAAMDE4OTY5YmEtYjg3YS00YjJjLWIxZmItZTY1MjhkNTU0NWQ4&index=%2A&messageDisplay=inline&stream_sort=desc&viz=stream&from_ts=1688736759137&to_ts=1690032759137&live=true

Version that was working fine in production before deploying v1.49.5: v1.49.2

image

=> Problem originates from the diff between v1.49.5 and v1.49.2: v1.49.2...v1.49.5

🎯 Indeed, algoliasearch was upgraded from ^3.35.1 to ^4.17.0, cf v1.49.2...v1.49.5#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R61

@adrienjoly
Copy link
Member Author

adrienjoly commented Jul 22, 2023

For reference, because of disabling indexing operations (until the migration from algoliaseach 3 to 4 is complete), the number of indexing operations have decreased over the last few days:

image image

=> they should get back to normal after v1.49.12 is deployed in production.

@adrienjoly
Copy link
Member Author

For reference, v1.49.12 is now running in production, with re-enabled indexing operations 🤞

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant