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

error: Not Found #377

Closed
liammulh opened this issue Feb 25, 2023 · 3 comments
Closed

error: Not Found #377

liammulh opened this issue Feb 25, 2023 · 3 comments

Comments

@liammulh
Copy link
Member

While investigating #375, I noticed there were three instances of this error in Rosetta's log.

@liammulh liammulh self-assigned this Feb 25, 2023
@liammulh
Copy link
Member Author

Here is the error in context:

Feb 23 15:18:31 phet-server2.int.colorado.edu rosetta[375109]: info: storing translation of strings in build-a-molecule long-term
Feb 23 15:18:31 phet-server2.int.colorado.edu rosetta[375109]: info: trying to update contents of file on github
Feb 23 15:18:31 phet-server2.int.colorado.edu rosetta[375109]: error: Not Found {"body":{"documentation_url":"https://docs.github.com/rest/reference/repos#get-repository-content","message":"Not Found"},"headers":{"access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","connection":"close","content-length":"113","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Thu, 23 Feb 2023 22:18:31 GMT","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"GitHub.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","vary":"Accept-Encoding, Accept, X-Requested-With","x-accepted-oauth-scopes":"","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-api-version-selected":"2022-11-28","x-github-media-type":"github.v3; format=json","x-github-request-id":"9A36:4172:188A7D9:3267ABB:63F7E637","x-oauth-scopes":"repo","x-ratelimit-limit":"5000","x-ratelimit-remaining":"4999","x-ratelimit-reset":"1677194311","x-ratelimit-resource":"core","x-ratelimit-used":"1","x-xss-protection":"0"},"statusCode":404}
Feb 23 15:18:31 phet-server2.int.colorado.edu rosetta[375109]: info: trying to create file on github
Feb 23 15:18:32 phet-server2.int.colorado.edu rosetta[375109]: info: created file on github
Feb 23 15:18:32 phet-server2.int.colorado.edu rosetta[375109]: info: stored translation of strings in build-a-molecule long-term

@liammulh
Copy link
Member Author

In storeTranslationLongTerm, we try to update the file first. If the file doesn't exist, we create it:

try {
logger.info( 'trying to update contents of file on github' );
const contentsRes = await longTermStorage.contentsAsync( translationFilePath, privateConfig.BABEL_BRANCH );
longTermStorageRes = await longTermStorage.updateContentsAsync(
translationFilePath,
commitMessage,
fileContents,
contentsRes[ 0 ].sha,
privateConfig.BABEL_BRANCH
);
logger.info( 'updated contents of file on github' );
logger.info( `stored translation of strings in ${repo} long-term` );
}
catch( e ) {
logger.error( e );
try {
// try to create the file
logger.info( 'trying to create file on github' );
longTermStorageRes = await longTermStorage.createContentsAsync(
translationFilePath,
commitMessage,
fileContents,
privateConfig.BABEL_BRANCH
);
logger.info( 'created file on github' );
logger.info( `stored translation of strings in ${repo} long-term` );
}
catch( e ) {
logger.error( e );
}
}

@liammulh
Copy link
Member Author

This is deployed.

@liammulh liammulh closed this as completed Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant