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

Currency conversion failing with error 403 #130

Closed
NeighNeighNeigh opened this issue Sep 22, 2023 · 6 comments
Closed

Currency conversion failing with error 403 #130

NeighNeighNeigh opened this issue Sep 22, 2023 · 6 comments

Comments

@NeighNeighNeigh
Copy link

NeighNeighNeigh commented Sep 22, 2023

Describe the bug
Currency conversion is failing with the following error

[23:26:11.173] ERROR: Calculate Anything[Script Filter] JSON error: JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0. in JSON:
CURL FAILED: request to https://api.exchangerate.host/latest failed, error was The requested URL returned error: 403

To Reproduce
Steps to reproduce the behaviour:

  1. Open Alfred
  2. Type 50 usd to aud
  3. See error in console

Debug Output
[23:26:05.977] Logging Started...
[23:26:08.708] Calculate Anything[Script Filter] Queuing argument ''
[23:26:08.765] Calculate Anything[Script Filter] Script with argv '(null)' finished
[23:26:08.771] Calculate Anything[Script Filter] {"items":[]}
[23:26:08.885] Calculate Anything[Script Filter] Queuing argument '0'
[23:26:08.939] Calculate Anything[Script Filter] Script with argv '(null)' finished
[23:26:08.943] Calculate Anything[Script Filter] {"items":[]}
[23:26:08.969] Calculate Anything[Script Filter] Queuing argument '0 '
[23:26:09.004] Calculate Anything[Script Filter] Script with argv '(null)' finished
[23:26:09.009] Calculate Anything[Script Filter] {"items":[]}
[23:26:09.276] Calculate Anything[Script Filter] Queuing argument '0 u'
[23:26:09.350] Calculate Anything[Script Filter] Script with argv '(null)' finished
[23:26:09.357] Calculate Anything[Script Filter] {"items":[]}
[23:26:09.377] Calculate Anything[Script Filter] Queuing argument '0 us'
[23:26:09.418] Calculate Anything[Script Filter] Script with argv '(null)' finished
[23:26:09.423] Calculate Anything[Script Filter] {"items":[]}
[23:26:09.606] Calculate Anything[Script Filter] Queuing argument '0 usd'
[23:26:09.662] Calculate Anything[Script Filter] Script with argv '(null)' finished
[23:26:09.668] Calculate Anything[Script Filter] {"items":[{"title":"50 USD","subtitle":"1 USD = 1 USD","arg":50,"icon":{"path":"flags/USD.png"},"mods":{"cmd":{"valid":true,"arg":50,"subtitle":"Action this item to copy the amount with no format"},"alt":{"valid":true,"arg":1,"subtitle":"Action this item to copy the value of 1 to the clipboard"}}}]}
[23:26:09.695] Calculate Anything[Script Filter] Queuing argument '0 usd '
[23:26:09.728] Calculate Anything[Script Filter] Script with argv '(null)' finished
[23:26:09.734] Calculate Anything[Script Filter] {"items":[{"title":"50 USD","subtitle":"1 USD = 1 USD","arg":50,"icon":{"path":"flags/USD.png"},"mods":{"cmd":{"valid":true,"arg":50,"subtitle":"Action this item to copy the amount with no format"},"alt":{"valid":true,"arg":1,"subtitle":"Action this item to copy the value of 1 to the clipboard"}}}]}
[23:26:09.810] Calculate Anything[Script Filter] Queuing argument '0 usd t'
[23:26:09.847] Calculate Anything[Script Filter] Script with argv '(null)' finished
[23:26:09.853] Calculate Anything[Script Filter] {"items":[]}
[23:26:09.962] Calculate Anything[Script Filter] Queuing argument '0 usd to'
[23:26:10.005] Calculate Anything[Script Filter] Script with argv '(null)' finished
[23:26:10.011] Calculate Anything[Script Filter] {"items":[]}
[23:26:10.035] Calculate Anything[Script Filter] Queuing argument '0 usd to '
[23:26:10.068] Calculate Anything[Script Filter] Script with argv '(null)' finished
[23:26:10.075] Calculate Anything[Script Filter] {"items":[]}
[23:26:10.216] Calculate Anything[Script Filter] Queuing argument '0 usd to a'
[23:26:10.262] Calculate Anything[Script Filter] Script with argv '(null)' finished
[23:26:10.271] Calculate Anything[Script Filter] {"items":[]}
[23:26:10.352] Calculate Anything[Script Filter] Queuing argument '0 usd to au'
[23:26:10.396] Calculate Anything[Script Filter] Script with argv '(null)' finished
[23:26:10.404] Calculate Anything[Script Filter] {"items":[]}
[23:26:10.566] Calculate Anything[Script Filter] Queuing argument '0 usd to aud'
[23:26:10.628] Calculate Anything[Script Filter] Script with argv '(null)' finished
[23:26:10.636] Calculate Anything[Script Filter] {"items":[{"title":"Updating rates...","valid":false,"arg":""}],"rerun":0.2,"variables":{"rerun":true}}
[23:26:10.835] Calculate Anything[Script Filter] Queuing argument '0 usd to aud'
[23:26:11.163] Calculate Anything[Script Filter] Script with argv '(null)' finished
[23:26:11.170] ERROR: Calculate Anything[Script Filter] Code 255: CURL FAILED: request to https://api.exchangerate.host/latest failed, error was The requested URL returned error: 403
Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /Users/nathan/Dropbox (Personal)/Maintenance/Systems/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8B5311D5-7F77-4B38-9A5C-13F817F2EFD9/workflow/tools/currency.php:486
Stack trace:
#0 /Users/nathan/Dropbox (Personal)/Maintenance/Systems/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8B5311D5-7F77-4B38-9A5C-13F817F2EFD9/workflow/tools/currency.php(412): Workflow\Tools\Currency->exchangeConversion(50.0, 'USD', 'AUD')
#1 /Users/nathan/Dropbox (Personal)/Maintenance/Systems/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8B5311D5-7F77-4B38-9A5C-13F817F2EFD9/workflow/tools/currency.php(285): Workflow\Tools\Currency->convert(Array)
#2 /Users/nathan/Dropbox (Personal)/Maintenance/Systems/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8B5311D5-7F77-4B38-9A5C-13F817F2EFD9/workflow/calculateanything.php(157): Workflow\Tools\Currency->processQuery()
#3 /Users/nathan/Dropbox (Personal)/Maintenance/Systems/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8B5311D5-7F77-4B38-9A5C-13F817F2EFD9/workflow/calculateanything.php(110): Workflow\CalculateAnything->processByType()
#4 /Users/nathan/Dropbox (Personal)/Maintenance/Systems/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8B5311D5-7F77-4B38-9A5C-13F817F2EFD9/process.php(46): Workflow\CalculateAnything->processQuery()
#5 Command line code(2): include_once('/Users/nathan/D...')
#6 {main}
thrown in /Users/nathan/Dropbox (Personal)/Maintenance/Systems/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8B5311D5-7F77-4B38-9A5C-13F817F2EFD9/workflow/tools/currency.php on line 486
[23:26:11.173] ERROR: Calculate Anything[Script Filter] JSON error: JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0. in JSON:
CURL FAILED: request to https://api.exchangerate.host/latest failed, error was The requested URL returned error: 403
Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /Users/nathan/Dropbox (Personal)/Maintenance/Systems/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8B5311D5-7F77-4B38-9A5C-13F817F2EFD9/workflow/tools/currency.php:486
Stack trace:
#0 /Users/nathan/Dropbox (Personal)/Maintenance/Systems/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8B5311D5-7F77-4B38-9A5C-13F817F2EFD9/workflow/tools/currency.php(412): Workflow\Tools\Currency->exchangeConversion(50.0, 'USD', 'AUD')
#1 /Users/nathan/Dropbox (Personal)/Maintenance/Systems/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8B5311D5-7F77-4B38-9A5C-13F817F2EFD9/workflow/tools/currency.php(285): Workflow\Tools\Currency->convert(Array)
#2 /Users/nathan/Dropbox (Personal)/Maintenance/Systems/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8B5311D5-7F77-4B38-9A5C-13F817F2EFD9/workflow/calculateanything.php(157): Workflow\Tools\Currency->processQuery()
#3 /Users/nathan/Dropbox (Personal)/Maintenance/Systems/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8B5311D5-7F77-4B38-9A5C-13F817F2EFD9/workflow/calculateanything.php(110): Workflow\CalculateAnything->processByType()
#4 /Users/nathan/Dropbox (Personal)/Maintenance/Systems/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8B5311D5-7F77-4B38-9A5C-13F817F2EFD9/process.php(46): Workflow\CalculateAnything->processQuery()
#5 Command line code(2): include_once('/Users/nathan/D...')
#6 {main}
thrown in /Users/nathan/Dropbox (Personal)/Maintenance/Systems/Alfred/Alfred.alfredpreferences/workflows/user.workflow.8B5311D5-7F77-4B38-9A5C-13F817F2EFD9/workflow/tools/currency.php on line 486

System information:

  • OS: Mac OS 13.5.2
  • Alfred Version Alfred 5.1.2
  • PHP Version - 8.2.10
@Billi0ns
Copy link

Same error, seems like there's a change in the exchangerate api which caused the error.
I just added a fixer api key and it fixes the problem for now.

@AgamMS10
Copy link

+1

@biati-digital
Copy link
Owner

I'm unable to replicate the error, could have been an issue with the exchangerate API.

@biati-digital
Copy link
Owner

Are you still having this problem?

@Billi0ns
Copy link

No, the exchangerate api is normal right now.
Guess it's just temporary issue on their end.
Thanks!

@biati-digital
Copy link
Owner

Thank's for letting me know. I'll close this issue.

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

No branches or pull requests

4 participants