Closed rlundy closed 6 months ago
I tried Fiddler to see what URL it was trying to hit and there's nothing there, even if I tell it to intercept and decrypt HTTPS. When I run the Phrase CLI, it isn't making an entry in the Fiddler list.
Hi @rlundy thanks for reporting this, the error is indeed not telling much. We will open an internal task to improve on this.
In the meantime, could you double check your project ID in your phrase.yml configuration?
I've confirmed that the project ID is correct. Our phrase.yml file looks like this (but with the correct project ID, of course):
phrase:
project_id: REDACTED
push:
sources:
- file: ./src/assets/locales/<locale_name>.json
params:
file_format: i18next
pull:
targets:
- file: ./src/assets/locales/<locale_name>.json
params:
file_format: i18next
Just to double check: a project with that ID exists on app.phrase.com (our EU app instance), not on us.app.phrase.com (or US instance)? Otherwise an appropriate API url has to be specified in the config as well.
Correct, we're using app.phrase.com, EU data center. We're based in Switzerland.
Doubtless worth noting is that some Phrase CLI commands do work correctly. If I use
phrase users user
for example, I do get back the details of my user.
I also tried adding host:
to the .yml file:
phrase:
host: https://api.phrase.com/v2/
project_id: REDACTED
[...etc...]
But this gave me the same results; phrase users user
works but phrase push -w -v
gives a 404 with no other info.
@rlundy what about
phrase projects show --id ID_OF_YOUR_PROJECT
Does that work? 404 somehow still suggests that either project or locale id is wrong.
It turns out that another employee at our company decided, without notifying anybody, to revoke the API key because he thought we should be using an API key tied to his account instead of the account it was on. With the new non-revoked API key, I can now see the project by ID.
But there's still something for Phrase to fix here.
Where an API key is invalid, it ought to be showing us a 401, not a 404. Then at least we can be barking up the right tree when we look for a fix.
@theSoenke May I ask what the fix was?
@rlundy we couldn't reproduce your case. When I try to perform a push (or, to keep it simple, projects show
) using an invalid token, I'm getting 401 (you can try that yourself, by stripping your working token the last character for example).
Your 404s suggest to me that the token was still valid, but the user owning it didn't have the access to the project in question. So, from that perspective, it's just an unknown project and 404 would be a valid response.
I'm trying the command
phrase push -w
, and I get backIf I use
phrase push -w -v
instead, I get more data [shown below, redacted], but still no useful error message:What would be more useful is an explanation of why the 404 happened. What address was I trying to reach that doesn't exist?