digidem / mapeo-desktop

Local-first mapping and monitoring in remote environments
https://mapeo.app
GNU General Public License v3.0
261 stars 33 forks source link

create mapeo settings file in Google Colab #645

Open jensNH opened 2 years ago

jensNH commented 2 years ago

I have been trying to use mapeo-settings-builder on Colab, but get the error below when calling build. Do you know how to solve it? Kind regards Jens N Hansen

→ Using version 3.4.0 of mapeo-settings-builder ! Warning: no category json files found in /content/drive/My Drive/mapeo/mapeo-settings-monitoreo-forestal-ene22/categories ✓ Built presets and categories (1650ms) ✓ Generated svg sprite for iD (2710ms) ✓ Generated png sprite for Mapbox (121ms) ✖ (node:391) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome! src/tcmalloc.cc:283] Attempt to free invalid pointer 0x86fbaa769f0

TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

at onClose (/tools/node/lib/node_modules/mapeo-settings-builder/node_modules/puppeteer/lib/Launcher.js:239:14)
at Interface.<anonymous> (/tools/node/lib/node_modules/mapeo-settings-builder/node_modules/puppeteer/lib/Launcher.js:228:50)
at Interface.emit (events.js:327:22)
at Interface.close (readline.js:424:8)
at Socket.onend (readline.js:202:10)
at Socket.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)

(Use node --trace-warnings ... to show where the warning was created) ✖ (node:391) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) ✖ (node:391) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

colab_to_build_mapeo_settings.pdf

achou11 commented 2 years ago

thanks for submitting this! the additional details are helpful. at a glance, my guess is that this is related to puppeteer (the library used to convert svg files to image files) not finding the executable path to chromium on the machine. An identical issue is still open (https://github.com/puppeteer/puppeteer/issues/4991) and suggests that we'd have to point to a custom path for the executable when calling launch.

Potential solutions:

Would you mind giving the first one a try and seeing if it works? If it doesn't, can file issues to relevant DD repos and keep on our radar to fix.

Also, will likely move this issue to mapeo-settings-builder eventually since it's not really related to anything desktop-specific :)

jensNH commented 2 years ago

Thanks for getting back to me!

I have tried setting the executable path as described, which does not fix the issue. I will look into the second option.

Venlig hilsen/Kind regards/Saludos cordiales,

Jens Noe Hansen

Teknisk rådgiver/Technical advisor/Asesor técnico

Verdens Skove / Forests of the World / Bosques del Mundo

Mobile: +45 20 70 26 34

Vestergade 12, 1456 Copenhagen, Denmark

www.forestsoftheworld.org/

www.bosquesdelmundo.org

www.verdensskove.org

https://www.facebook.com/VerdensSkove?ref=ts&fref=ts

Den ons. 5. jan. 2022 kl. 17.00 skrev Andrew Chou @.***

:

thanks for submitting this! the additional details are helpful. at a glance, my guess is that this is related to puppeteer (the library used to convert svg files to image files) not finding the executable path to chromium on the machine. An identical issue is still open ( puppeteer/puppeteer#4991 https://github.com/puppeteer/puppeteer/issues/4991) and suggests that we'd have to point to a custom path for the executable when calling launch.

Potential solutions:

-

set the PUPPETEER_EXECUTABLE_PATH environment variable to the executable path e.g.

PUPPETEER_EXECUTABLE_PATH="/usr/lib/chromium-browser/chromium-browser" mapeo-settings-builder build

Somewhat hacky and not entirely sure it would work, but would be the shortest path if it does.

update mapeo-settings-builder to accept an argument or config related to puppeteer and update our fork of svg-to-img https://github.com/digidem/svg-to-img/ to accept that option to configure the puppeteer instance. not ideal and somewhat leaky as an abstraction but would definitely work

Would you mind giving the first one a try and seeing if it works? If it doesn't, can file issues to relevant DD repos and keep on our radar to fix.

Also, will likely move this issue to mapeo-settings-builder https://github.com/digidem/mapeo-settings-builder eventually since it's not really related to anything desktop-specific :)

— Reply to this email directly, view it on GitHub https://github.com/digidem/mapeo-desktop/issues/645#issuecomment-1005853285, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATUBZPHJ2BTZNMWPSH3NS5TUURTJDANCNFSM5LKFUWPA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

rudokemper commented 2 years ago

Hi @jensNH thanks for reporting this issue. While this is getting resolved, I wanted to mention that we have a public Discord channel in which we might be able to chat about some of these things more quickly and informally, in case you'd be interested in joining: https://discord.gg/KWRFDh3v73