alanhe421 / alfred-workflows

Save time, Improve life.🚀 ☕️ 💻
https://medium.com/@alanhe421/list/alfred-a65a11fa7a0f
MIT License
645 stars 61 forks source link

cn.alanhe.giphy: No such file or directory problems #251

Closed jaywongs closed 2 years ago

jaywongs commented 2 years ago

Describe the bug

installed this workflow and run with this problems, Alfred/Workflow Data/cn.alanhe.giphy: No such file or directory

Version Info (please complete the following information):

To Reproduce Steps to reproduce the behavior: input [gif words] and no response, with debug on get this error log"

[18:45:59.990] Giphy[Script Filter] Queuing argument 'dog' [18:46:00.252] Giphy[Script Filter] Script with argv '(null)' finished [18:46:00.253] ERROR: Giphy[Script Filter] Code 1: node:child_process:397 ex = new Error('Command failed: ' + cmd + '\n' + stderr); ^

Error: Command failed: find /Users/xxx/Library/Caches/com.runningwithcrayons.Alfred/Workflow\ Data/cn.alanhe.giphy -mtime +1 -type f -delete find: /Users/xxx/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/cn.alanhe.giphy: No such file or directory

at ChildProcess.exithandler (node:child_process:397:12)
at ChildProcess.emit (node:events:390:28)
at maybeClose (node:internal/child_process:1062:16)
at Socket.<anonymous> (node:internal/child_process:448:11)
at Socket.emit (node:events:390:28)
at Pipe.<anonymous> (node:net:687:12) {

killed: false, code: 1, signal: null, cmd: 'find /Users/xxx/Library/Caches/com.runningwithcrayons.Alfred/Workflow\ Data/cn.alanhe.giphy -mtime +1 -type f -delete', stdout: '', stderr: 'find: /Users/xxx/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/cn.alanhe.giphy: No such file or directory\n' }

Node.js v17.0.1 [18:49:04.960] Giphy[Script Filter] Queuing argument 'dog' [18:49:05.135] Giphy[Script Filter] Script with argv '(null)' finished [18:49:05.139] ERROR: Giphy[Script Filter] Code 1: node:child_process:397 ex = new Error('Command failed: ' + cmd + '\n' + stderr); ^

Error: Command failed: find /Users/xxx/Library/Caches/com.runningwithcrayons.Alfred/Workflow\ Data/cn.alanhe.giphy -mtime +1 -type f -delete find: /Users/xxx/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/cn.alanhe.giphy: No such file or directory

at ChildProcess.exithandler (node:child_process:397:12)
at ChildProcess.emit (node:events:390:28)
at maybeClose (node:internal/child_process:1062:16)
at Socket.<anonymous> (node:internal/child_process:448:11)
at Socket.emit (node:events:390:28)
at Pipe.<anonymous> (node:net:687:12) {

killed: false, code: 1, signal: null, cmd: 'find /Users/xxx/Library/Caches/com.runningwithcrayons.Alfred/Workflow\ Data/cn.alanhe.giphy -mtime +1 -type f -delete', stdout: '', stderr: 'find: /Users/xxx/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/cn.alanhe.giphy: No such file or directory\n' }

Node.js v17.0.1

Screenshots If applicable, add screenshots to help explain your problem.

jaywongs commented 2 years ago

after create a dir of cn.alanhe.giphy manually, and get this error log:

[18:51:51.201] Giphy[Script Filter] Queuing argument 'dog' [18:51:51.328] Giphy[Script Filter] Script with argv '(null)' finished [18:51:51.330] Giphy[Script Filter] Error: connect EHOSTUNREACH 0.0.30.210:80 - Local (30.225.56.119:49422) at internalConnect (node:net:931:16) at defaultTriggerAsyncIdScope (node:internal/async_hooks:454:18) at GetAddrInfoReqWrap.emitLookup [as callback] (node:net:1075:9) at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:74:8) { errno: -65, code: 'EHOSTUNREACH', syscall: 'connect', address: '0.0.30.210', port: 80, config: { url: '/v1/gifs/search', method: 'get', headers: { Accept: 'application/json, text/plain, /', 'User-Agent': 'axios/0.21.0', host: 'api.giphy.com' }, params: { api_key: 'Gz9oMSpG2PDXkiFwcgh5wyg243U9OHFg', q: 'dog', limit: '15', offset: 0, rating: 'g', lang: 'en' }, baseURL: 'https://api.giphy.com', transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, adapter: [Function: httpAdapter], xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, validateStatus: [Function: validateStatus], data: undefined }, request: <ref *1> Writable { _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: false, needDrain: false, ending: false, ended: false, finished: false, destroyed: false, decodeStrings: true, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: true, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, afterWriteTickInfo: null, buffered: [], bufferedIndex: 0, allBuffers: true, allNoop: true, pendingcb: 0, constructed: true, prefinished: false, errorEmitted: false, emitClose: true, autoDestroy: true, errored: null, closed: false, closeEmitted: false,

},
_events: [Object: null prototype] {
  response: [Function: handleResponse],
  error: [Function: handleRequestError]
},
_eventsCount: 2,
_maxListeners: undefined,
_options: {
  maxRedirects: 21,
  maxBodyLength: 10485760,
  protocol: 'http:',
  path: 'https://api.giphy.com/v1/gifs/search?api_key=Gz9oMSpG2PDXkiFwcgh5wyg243U9OHFg&q=dog&limit=15&offset=0&rating=g&lang=en',
  method: 'GET',
  headers: [Object],
  agent: undefined,
  agents: [Object],
  auth: undefined,
  hostname: '7890',
  port: null,
  nativeProtocols: [Object],
  pathname: 'https://api.giphy.com/v1/gifs/search',
  search: '?api_key=Gz9oMSpG2PDXkiFwcgh5wyg243U9OHFg&q=dog&limit=15&offset=0&rating=g&lang=en'
},
_ended: true,
_ending: true,
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 0,
_requestBodyBuffers: [],
_onNativeResponse: [Function (anonymous)],
_currentRequest: ClientRequest {
  _events: [Object: null prototype],
  _eventsCount: 7,
  _maxListeners: undefined,
  outputData: [],
  outputSize: 0,
  writable: true,
  destroyed: false,
  _last: true,
  chunkedEncoding: false,
  shouldKeepAlive: false,
  maxRequestsOnConnectionReached: false,
  _defaultKeepAlive: true,
  useChunkedEncodingByDefault: false,
  sendDate: false,
  _removedConnection: false,
  _removedContLen: false,
  _removedTE: false,
  _contentLength: 0,
  _hasBody: true,
  _trailer: '',
  finished: true,
  _headerSent: true,
  _closed: false,
  socket: [Socket],
  _header: 'GET https://api.giphy.com/v1/gifs/search?api_key=Gz9oMSpG2PDXkiFwcgh5wyg243U9OHFg&q=dog&limit=15&offset=0&rating=g&lang=en HTTP/1.1\r\n' +
    'Accept: application/json, text/plain, */*\r\n' +
    'User-Agent: axios/0.21.0\r\n' +
    'host: api.giphy.com\r\n' +
    'Connection: close\r\n' +
    '\r\n',
  _keepAliveTimeout: 0,
  _onPendingData: [Function: nop],
  agent: [Agent],
  socketPath: undefined,
  method: 'GET',
  maxHeaderSize: undefined,
  insecureHTTPParser: undefined,
  path: 'https://api.giphy.com/v1/gifs/search?api_key=Gz9oMSpG2PDXkiFwcgh5wyg243U9OHFg&q=dog&limit=15&offset=0&rating=g&lang=en',
  _ended: false,
  res: null,
  aborted: false,
  timeoutCb: null,
  upgradeOrConnect: false,
  parser: null,
  maxHeadersCount: null,
  reusedSocket: false,
  host: '7890',
  protocol: 'http:',
  _redirectable: [Circular *1],
  [Symbol(kCapture)]: false,
  [Symbol(kNeedDrain)]: false,
  [Symbol(corked)]: 0,
  [Symbol(kOutHeaders)]: [Object: null prototype]
},
_currentUrl: 'http://7890/https://api.giphy.com/v1/gifs/search?api_key=Gz9oMSpG2PDXkiFwcgh5wyg243U9OHFg&q=dog&limit=15&offset=0&rating=g&lang=en',
[Symbol(kCapture)]: false

}, response: undefined, isAxiosError: true, toJSON: [Function: toJSON] } [18:51:51.335] ERROR: Giphy[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: Error: connect EHOSTUNREACH 0.0.30.210:80 - Local (30.225.56.119:49422) at internalConnect (node:net:931:16) at defaultTriggerAsyncIdScope (node:internal/async_hooks:454:18) at GetAddrInfoReqWrap.emitLookup [as callback] (node:net:1075:9) at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:74:8) { errno: -65, code: 'EHOSTUNREACH', syscall: 'connect', address: '0.0.30.210', port: 80, config: { url: '/v1/gifs/search', method: 'get', headers: { Accept: 'application/json, text/plain, /', 'User-Agent': 'axios/0.21.0', host: 'api.giphy.com' }, params: { api_key: 'Gz9oMSpG2PDXkiFwcgh5wyg243U9OHFg', q: 'dog', limit: '15', offset: 0, rating: 'g', lang: 'en' }, baseURL: 'https://api.giphy.com', transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, adapter: [Function: httpAdapter], xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, validateStatus: [Function: validateStatus], data: undefined }, request: <ref *1> Writable { _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: false, needDrain: false, ending: false, ended: false, finished: false, destroyed: false, decodeStrings: true, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: true, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, afterWriteTickInfo: null, buffered: [], bufferedIndex: 0, allBuffers: true, allNoop: true, pendingcb: 0, constructed: true, prefinished: false, errorEmitted: false, emitClose: true, autoDestroy: true, errored: null, closed: false, closeEmitted: false,

},
_events: [Object: null prototype] {
  response: [Function: handleResponse],
  error: [Function: handleRequestError]
},
_eventsCount: 2,
_maxListeners: undefined,
_options: {
  maxRedirects: 21,
  maxBodyLength: 10485760,
  protocol: 'http:',
  path: 'https://api.giphy.com/v1/gifs/search?api_key=Gz9oMSpG2PDXkiFwcgh5wyg243U9OHFg&q=dog&limit=15&offset=0&rating=g&lang=en',
  method: 'GET',
  headers: [Object],
  agent: undefined,
  agents: [Object],
  auth: undefined,
  hostname: '7890',
  port: null,
  nativeProtocols: [Object],
  pathname: 'https://api.giphy.com/v1/gifs/search',
  search: '?api_key=Gz9oMSpG2PDXkiFwcgh5wyg243U9OHFg&q=dog&limit=15&offset=0&rating=g&lang=en'
},
_ended: true,
_ending: true,
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 0,
_requestBodyBuffers: [],
_onNativeResponse: [Function (anonymous)],
_currentRequest: ClientRequest {
  _events: [Object: null prototype],
  _eventsCount: 7,
  _maxListeners: undefined,
  outputData: [],
  outputSize: 0,
  writable: true,
  destroyed: false,
  _last: true,
  chunkedEncoding: false,
  shouldKeepAlive: false,
  maxRequestsOnConnectionReached: false,
  _defaultKeepAlive: true,
  useChunkedEncodingByDefault: false,
  sendDate: false,
  _removedConnection: false,
  _removedContLen: false,
  _removedTE: false,
  _contentLength: 0,
  _hasBody: true,
  _trailer: '',
  finished: true,
  _headerSent: true,
  _closed: false,
  socket: [Socket],
  _header: 'GET https://api.giphy.com/v1/gifs/search?api_key=Gz9oMSpG2PDXkiFwcgh5wyg243U9OHFg&q=dog&limit=15&offset=0&rating=g&lang=en HTTP/1.1\r\n' +
    'Accept: application/json, text/plain, */*\r\n' +
    'User-Agent: axios/0.21.0\r\n' +
    'host: api.giphy.com\r\n' +
    'Connection: close\r\n' +
    '\r\n',
  _keepAliveTimeout: 0,
  _onPendingData: [Function: nop],
  agent: [Agent],
  socketPath: undefined,
  method: 'GET',
  maxHeaderSize: undefined,
  insecureHTTPParser: undefined,
  path: 'https://api.giphy.com/v1/gifs/search?api_key=Gz9oMSpG2PDXkiFwcgh5wyg243U9OHFg&q=dog&limit=15&offset=0&rating=g&lang=en',
  _ended: false,
  res: null,
  aborted: false,
  timeoutCb: null,
  upgradeOrConnect: false,
  parser: null,
  maxHeadersCount: null,
  reusedSocket: false,
  host: '7890',
  protocol: 'http:',
  _redirectable: [Circular *1],
  [Symbol(kCapture)]: false,
  [Symbol(kNeedDrain)]: false,
  [Symbol(corked)]: 0,
  [Symbol(kOutHeaders)]: [Object: null prototype]
},
_currentUrl: 'http://7890/https://api.giphy.com/v1/gifs/search?api_key=Gz9oMSpG2PDXkiFwcgh5wyg243U9OHFg&q=dog&limit=15&offset=0&rating=g&lang=en',
[Symbol(kCapture)]: false

}, response: undefined, isAxiosError: true, toJSON: [Function: toJSON] }

alanhe421 commented 2 years ago

@jaywongs

关于giphy api报错这块

giphy需要走代理,即Alfred本身要配置代理,或者Mac全局模式代理已开启。

image
jaywongs commented 2 years ago

代理是始终开着且确认可用的

jaywongs commented 2 years ago

不好意思刚才确认了是代理设置有问题,抱歉~