Hi, my map/reduce script fails in all proceeding s...
# suitescript
k
Hi, my map/reduce script fails in all proceeding stages after the getInputData stage is completed, i wasn't even able to log any messages from the other stages, does anyone know what's the reason behind it? Seems like there is no way to debug if there's no error message
b
share the code
k
it's only some meaningless code as i'm trying out map reduce script, even so no log messages are logged after the getInputData stage
b
hopefully you can use summarize's context for Logging Errors
my first recommendation would be to use suitescript 2.0
not 2.1
anytime you see weird stuff, you want to go back to 2.0
k
thank you! pretty new to suitescript myself, let me try to use summarize's context and 2.0
b
secondly, should try testing a different search,, you are not the first to have problems with subsidiaries
if you are new to suitescript, i generally recommend using suitescript 2.0, especially if you are using a build tool like typescript that uses babel
2.0 has less weird errors than 2.1
i would not use 2.1 unless you know how to do something in 2.0
k
i tried version 2.0, location search instead of subsidiary, and context to log errors, still failing after getInputData stage and not seeing any log messages from other stages 😞
b
what does the compiled code look like?
k
Untitled
i can try to write a simple javascript script to see if it's a typescript issue
b
your map looks wrong, the context for a map is not used the same as the context for a summarize, the map errors is for when your script retries during a server restart
the vast majority of the time for troubleshooting, you should just log things and return hardcoded values
ive tried your code myself, it looks fine
k
then looks like the weird issue doesn't come from the script..
b
does a bunch of logs
id check that you have locations to actually search, but that sounds unlikely
k
yes i do have locations
b
my vote is to delete the script and try again
k
i see let me try
my map reduce task has been stuck in Processing for getInputData stage for more than 1 hour now... will keep you posted if deleting and retrying works
b
im guessing you have a test drive account on na1 servers
terrible performance there
k
well it's still stuck in Processing now.. looks like i have a pretty awful sandbox, things just aren't working properly
i think i will try to talk with support to see if i could get it unstuck, may as well give up writing map/reduce script and implement with other options for my use case for now
i finally found this sentence:
Only administrators can run scheduled scripts. If a user event script calls ScheduledScriptTask.submit(), the user event script has to be deployed with admin permissions.
-- i was calling the MR script from a restlet with a custom role
b
sounds like old documentation
k
thanks a lot for your help!