Zondebok Posted October 16, 2018 Posted October 16, 2018 Installed successfully, but I get the following when trying to do any translation
bikeNik Posted October 18, 2018 Posted October 18, 2018 (edited) Zondebok, Highly likely it's the network problem. Can you use https://translate.google.com in your country without VPN? Edited October 18, 2018 by bikeNik
Zondebok Posted October 18, 2018 Posted October 18, 2018 1 hour ago, bikeNik said: Zondebok, Highly likely it's the network problem. Can you use https://translate.google.com in your country without VPN? Sure. I live in the US, and it works fine here.
bikeNik Posted October 18, 2018 Posted October 18, 2018 (edited) Anyway, the network problem. It that line (105:17) in `google-translate-api/index.js` catch the query errors. In logs (Alfred preference => Toggle debugging mode => log [all information]) should be more detail information... Could you get it.. Edited October 18, 2018 by bikeNik
Zondebok Posted October 18, 2018 Posted October 18, 2018 1 hour ago, bikeNik said: Anyway, the network problem. It that line (105:17) in `google-translate-api/index.js` catch the query errors. In logs (Alfred preference => Toggle debugging mode => log [all information]) should be more detail information... Could you get it.. Starting debug for 'Google Translate' [2018-10-18 13:22:23][input.scriptfilter] Queuing argument '' [2018-10-18 13:22:23][input.scriptfilter] Queuing argument 't' [2018-10-18 13:22:23][input.scriptfilter] Queuing argument 'te' [2018-10-18 13:22:23][input.scriptfilter] Queuing argument 'tes' [2018-10-18 13:22:23][input.scriptfilter] Queuing argument 'test' [2018-10-18 13:22:24][input.scriptfilter] Script with argument 'test' finished [2018-10-18 13:22:24][input.scriptfilter] { "items": [ { "title": "Error: ", "subtitle": "Activate this item to try again. | ⌘L to see the stack trace", "autocomplete": "", "icon": { "path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns" }, "valid": false, "text": { "largetype": "Error\n at /usr/local/lib/node_modules/alfred-polyglot/node_modules/google-translate-api/index.js:105:17\n at process._tickCallback (internal/process/next_tick.js:68:7)", "copy": "Error\n at /usr/local/lib/node_modules/alfred-polyglot/node_modules/google-translate-api/index.js:105:17\n at process._tickCallback (internal/process/next_tick.js:68:7)" } } ] }
bikeNik Posted October 18, 2018 Posted October 18, 2018 (edited) Zondebok, I found two issues and both of them from google-translate-api, apparently. BAD_REQUEST response BAD_NETWORK p.s. I had a similar error from this file and resolved it by VPN. but after a day or two, this problem was gone by default. Edited October 20, 2018 by bikeNik
Nikersify Posted October 19, 2018 Author Posted October 19, 2018 12 hours ago, bivalvegruff said: What does this mean? Did you install node.js?
bivalvegruff Posted October 19, 2018 Posted October 19, 2018 7 hours ago, Nikersify said: Did you install node.js? Ah, I suspected that was the issue. I haven't, because I don't really know what it does. Are there any security issues with it? I've heard javascript isn't quite safe.
deanishe Posted October 20, 2018 Posted October 20, 2018 (edited) On 10/19/2018 at 5:53 PM, bivalvegruff said: I haven't, because I don't really know what it does. It's a JavaScript interpreter/platform. It does the same thing as Python and Ruby and Perl, just they are included with macOS. In any case, this workflow won't run without Node… On 10/19/2018 at 5:53 PM, bivalvegruff said: Are there any security issues with it? I've heard javascript isn't quite safe. The security issues aren't relevant to workflows, and JavaScript is perfectly safe. The way webbrowsers run it causes the problems. So again, not relevant. Edited November 18, 2018 by deanishe speling bivalvegruff 1
Nikersify Posted October 20, 2018 Author Posted October 20, 2018 Update v1.2.1 I've pushed a new version of the workflow to npm, you can upgrade by running $ npm install -g alfred-polyglot Notable changes since v1.2.0: - Fixed tkk regexp not matching, which should resolve the weird google-translate-api errors This should fix it for you @Zondebok, let me know if it does
bikeNik Posted October 22, 2018 Posted October 22, 2018 (edited) Got this error again today in google-translate-api/index.js:105: 17. In my case err.stack looks like: "HTTPError: Response code 503 (Service Unavailable) at stream.catch.then.data (/Users/bikenik/.npm-global/lib/node_modules/alfred-polyglot/node_modules/got/index.js:123:13) at <anonymous> at process._tickCallback (internal/process/next_tick.js:189:7)" Google message is: Quote Our systems have detected unusual traffic from your computer network. This page checks to see if it's really you sending the requests, and not a robot. So that can't be resolved by updating the token (TKK). I couldn't come up with a solution other than changing my IP using VPN service. or with proxy google-translate-api/issues/70#i. or dedicated IP. Edited October 22, 2018 by bikeNik
Zondebok Posted October 22, 2018 Posted October 22, 2018 On 10/20/2018 at 5:23 AM, Nikersify said: This should fix it for you @Zondebok, let me know if it does Yep, this worked. Thanks!
Xusqui Posted December 1, 2018 Posted December 1, 2018 On 10/16/2018 at 10:37 PM, Zondebok said: Installed successfully, but I get the following when trying to do any translation I have also this error except for next_tick.js:77:7 the logs are these: Quote [2018-12-01 19:01:50][input.scriptfilter] Queuing argument '' [2018-12-01 19:01:50][input.scriptfilter] Script with argument '' finished [2018-12-01 19:01:50][input.scriptfilter] { "items": [ { "title": "Translate '...'" } ] } [2018-12-01 19:01:50][input.scriptfilter] Queuing argument 'h' [2018-12-01 19:01:51][input.scriptfilter] Queuing argument 'he' [2018-12-01 19:01:51][input.scriptfilter] Queuing argument 'hel' [2018-12-01 19:01:51][input.scriptfilter] Queuing argument 'hell' [2018-12-01 19:01:51][input.scriptfilter] Queuing argument 'hello' [2018-12-01 19:01:52][input.scriptfilter] Script with argument 'hello' finished [2018-12-01 19:01:52][input.scriptfilter] { "items": [ { "title": "Error: ", "subtitle": "Activate this item to try again. | ⌘L to see the stack trace", "autocomplete": "", "icon": { "path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns" }, "valid": false, "text": { "largetype": "Error\n at /usr/local/lib/node_modules/alfred-polyglot/node_modules/google-translate-api/index.js:105:17\n at process.internalTickCallback (internal/process/next_tick.js:77:7)", "copy": "Error\n at /usr/local/lib/node_modules/alfred-polyglot/node_modules/google-translate-api/index.js:105:17\n at process.internalTickCallback (internal/process/next_tick.js:77:7)" } } ] } Any idea on what's happening? I am on Alfred 3.7 and Macos Mojave 10.14.1 Thanks in advance!
Nikersify Posted December 1, 2018 Author Posted December 1, 2018 @Xusqui It's most likely Google blocking you for some reason, have you tried running the workflow on a different internet connection?
Xusqui Posted December 2, 2018 Posted December 2, 2018 Hi, thank you for your quick answer. I don't think that's the point. I disconnected from my network (cable and wi-fi) and connected to the internet tethering my cell-phone connection. Then flushed DNS Cache in my Mac. Despite that, I keep having the same issue.
bikeNik Posted December 2, 2018 Posted December 2, 2018 (edited) @Xusqui 1 hour ago, Xusqui said: I disconnected from my network (cable and wi-fi) and connected to the internet tethering my cell-phone connection. To rule out the errors related to Google's protections - try to go into this link: https://translate.google.com/translate_a/single?client=t&sl=auto&tl=en&hl=en&dt=at&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t&ie=UTF-8&oe=UTF-8&otf=1&ssel=0&tsel=0&kc=7&q=Hello world&tk=535281.958536 You should get the text file with JSON data, otherwise, you'll get the error - kind of 503 or another with some message from Google API. Edited December 2, 2018 by bikeNik
Xusqui Posted December 2, 2018 Posted December 2, 2018 (edited) Hi, thank you again... I get a .json file (f.txt.json) with the content: Quote [[["Hello world","Hello world",null,null,0]],null,"en",null,null,null,0.88929719,null,[["en"],null,[0.88929719],["en"]]] connected to my LAN Is it right? Edited December 2, 2018 by Xusqui further information
bikeNik Posted December 2, 2018 Posted December 2, 2018 @Xusqui 6 minutes ago, Xusqui said: Is it right? Yes. I think this request excludes Google's blocking errors from your computer.
Xusqui Posted December 2, 2018 Posted December 2, 2018 I've digged a little bit and see you use a script to auto-get a token... Could it be a token problem?
Xusqui Posted December 2, 2018 Posted December 2, 2018 I uninstalled it with Quote npm rm -g alfred-polyglot no errors Now when I try to reinstall it again I got a lot of errors in the npm instance...
Xusqui Posted December 2, 2018 Posted December 2, 2018 Ok... I completely uninstalled Node.js and npm and reinstalled again (10.14.1 for node and 6.4.1 for npm) I tried to install and now npm won't give me any errors, but the installation does: Quote $ sudo /usr/local/bin/npm install -g alfred-polyglot > alfred-polyglot@1.2.1 postinstall /usr/local/lib/node_modules/alfred-polyglot > alfy-init { Error: Command failed: alfred-link Error: Alfred preferences not found at location /Users/franciscofernandezcano/Library/Preferences/com.runningwithcrayons.Alfred-Preferences-3.plist at pathExists.then.exists (/usr/local/lib/node_modules/alfred-polyglot/node_modules/resolve-alfred-prefs/index.js:15:10) at Promise.all.then.arr (/usr/local/lib/node_modules/alfred-polyglot/node_modules/execa/index.js:201:11) at process._tickCallback (internal/process/next_tick.js:68:7) code: 1, killed: false, stdout: '', stderr: 'Error: Alfred preferences not found at location /Users/franciscofernandezcano/Library/Preferences/com.runningwithcrayons.Alfred-Preferences-3.plist\n at pathExists.then.exists (/usr/local/lib/node_modules/alfred-polyglot/node_modules/resolve-alfred-prefs/index.js:15:10)\n', failed: true, signal: null, cmd: 'alfred-link', timedOut: false } npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! alfred-polyglot@1.2.1 postinstall: `alfy-init` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the alfred-polyglot@1.2.1 postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /Users/franciscofernandezcano/.npm/_logs/2018-12-02T13_02_34_140Z-debug.log I PM the npm log.
Nikersify Posted December 2, 2018 Author Posted December 2, 2018 @Xusqui npm shouldn't be run with sudo, try running the same command without sudo. In case of EACCESS errors see this guide https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally
Xusqui Posted December 3, 2018 Posted December 3, 2018 Ok... That's what I had when I didn't make SUDO, I got EACCESS errors. So I have followed the instructions here: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally and now I can install and uninstall globally without sudo: Now the output when installing Alfred-polyglot seems to be fine: Quote $ npm install -g alfred-polyglot > alfred-polyglot@1.2.1 postinstall /Users/franciscofernandezcano/.npm-global/lib/node_modules/alfred-polyglot > alfy-init + alfred-polyglot@1.2.1 added 148 packages from 59 contributors in 10s But still getting the same error. As I have installed a node versión manager (n), I have tried different versions of node, and I get that error in all the versions I have tried. Any other suggestions?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now