Upload local keystore to apify


#1

Hi!
Is there a way to upload a keystore and request queue from a local run to apify?


#2

Hi,

you can use forceCloud option for openKeyValueStore or openRequestQueue function.


#3

Thanks ! I will give this a try!


#4

Hmm I cannot use the forceCloud option. If I try to run this code:

const options = {
        forceCloud : true,
};
const requestQueue = await Apify.openRequestQueue('msn.com/de-at/autos/motorrad', options );

I get this error:

> The function passed to Apify.main() threw an exception:
> ApifyClientError: Parameter "queueIdOrName" of type Maybe String must be provided
>     at exports.checkParamOrThrow (/Users/bmayr/Documents/Projekte_lokal/ai-tracer-repos/webScraping/apify/msn_motorrad/node_modules/apify-client/build/utils.js:196:15)
>     at Object.openRequestQueue (/Users/bmayr/Documents/Projekte_lokal/ai-tracer-repos/webScraping/apify/msn_motorrad/node_modules/apify/build/request_queue.js:973:32)
>     at Apify.main (/Users/bmayr/Documents/Projekte_lokal/ai-tracer-repos/webScraping/apify/msn_motorrad/main.js:27:38)
>     at run (/Users/bmayr/Documents/Projekte_lokal/ai-tracer-repos/webScraping/apify/msn_motorrad/node_modules/apify/build/actor.js:283:13)
>     at Object.main (/Users/bmayr/Documents/Projekte_lokal/ai-tracer-repos/webScraping/apify/msn_motorrad/node_modules/apify/build/actor.js:300:3)
>     at Object.<anonymous> (/Users/bmayr/Documents/Projekte_lokal/ai-tracer-repos/webScraping/apify/msn_motorrad/main.js:21:7)
>     at Module._compile (internal/modules/cjs/loader.js:721:30)
>     at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
>     at Module.load (internal/modules/cjs/loader.js:620:32)
>     at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
>     at Function.Module._load (internal/modules/cjs/loader.js:552:3)
>     at Function.Module.runMain (internal/modules/cjs/loader.js:774:12)
>     at executeUserCode (internal/bootstrap/node.js:342:17)
>     at startExecution (internal/bootstrap/node.js:276:5)
>     at startup (internal/bootstrap/node.js:227:5)
>     at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
> npm ERR! code ELIFECYCLE
> npm ERR! errno 91
> npm ERR! @0.0.1 start: `node main.js`
> npm ERR! Exit status 91
> npm ERR! 
> npm ERR! Failed at the @0.0.1 start 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/bmayr/.npm/_logs/2019-03-13T14_49_18_462Z-debug.log
> Error: npm exited with code 91

I cannot figure out why this happens?


#5

I think you will need to use a URL friendly name, like ‘msn-com-de-at’.
But is is strange I got this error with your code:

ApifyClientError: Invalid value provided: Name can only contain letters ‘a’ through ‘z’, the digits ‘0’ through ‘9’, and the hyphen (’-’) but only in the middle of the string (e.g. ‘my-value-1’)
2

Can you try to run it using apify CLI? There you can easily call apify login and you will be logged under your Apify account on your local PC.