opensea-scraper icon indicating copy to clipboard operation
opensea-scraper copied to clipboard

Not working when deployed (Heroku)

Open jervalles opened this issue 3 years ago • 7 comments

This is not working for me when I deploy the app on heroku but working fine in local. Is that the same for you?

image

Wanna use this package because a collection can have different categories of NFT and OpeanSea's API don't provide to filter by trait

jervalles avatar Feb 12 '22 21:02 jervalles

Deploying scrapers to heroku or other providers (google cloud, AWS) is always trickier than running from local environment, because opensea might be able to detect IP addresses of those providers.

I use google cloud (firebase functions) and it seems to work well with puppeteer, I will quickly test my setup and let you know.

dcts avatar Feb 12 '22 22:02 dcts

Thank you for the fast answer!

Your package is just amazing and would love to work with it! if you have a solution I will be happy

jervalles avatar Feb 12 '22 22:02 jervalles

I could not make it work on firebase cloud function as well (for now). What is weird is that I have a setup that is deployed and working, but could not reproduce. Sorry I can't give a more helpful answer as of now, maybe with a fresh mind I will be able to figure out and will post here.

If you find out something else please share, might be interesting for folks using heroku too.

MY error when hosted on firebase cloud functions (for future reference):

{
  status: 'error',
  errorMessage: "Evaluation failed: TypeError: Cannot read properties of null (reading 'innerText')\n" +
    '    at <anonymous>:2:65',
  errorStack: "Error: Evaluation failed: TypeError: Cannot read properties of null (reading 'innerText')\n" +
    '    at <anonymous>:2:65\n' +
    '    at ExecutionContext._evaluateInternal (/workspace/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)\n' +
    '    at processTicksAndRejections (internal/process/task_queues.js:95:5)\n' +
    '    at async ExecutionContext.evaluate (/workspace/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)\n' +
    '    at async Object.rankings (/workspace/node_modules/opensea-scraper/src/functions/rankings.js:50:25)\n' +
    '    at async /workspace/index.js:9:23'
}

dcts avatar Feb 12 '22 23:02 dcts

Where is your working setup deployed? Cause I've just tried heroku but if I can use something else...

jervalles avatar Feb 13 '22 08:02 jervalles

tried to put a node server to a dedicated NAS with your solution and I got this as error. My local my and this server got the same project (from git)

image

jervalles avatar Feb 13 '22 14:02 jervalles

related to this: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#running-puppeteer-on-heroku

How can I add "no--sandbox" on your package?

edit : well I forked and added this. without succcess (same error)

jervalles avatar Feb 13 '22 16:02 jervalles

Thanks for reporting, it seems to be hard to deploy on any cloud infrastructure currently, also google cloud (see #40 ). This is not a problem specific to this package, but a general challenge when deploying scrapers on cloud infrastructure. We can keep this open in case someone finds a solution.

dcts avatar Feb 15 '22 04:02 dcts