I am trying to write a Notebook/Python script that will:
I was able to publish the original web layer and also overwrite it manually via mouse and keyboard in ArcGIS Pro.
My script will complete steps 1-3, but at step 4 I am getting this error:
'dict' object has no attribute '_validateParameters'
Libraries and Modules I have uploaded:
Error can also be seen at the bottom of this screenshot (screenshot is also attached, incase this one is showing up too blurry) of my Notebook:
I have filled in the Name, Summary, and Tags (required items in order to publish or overwrite a web layer) for my map:
When I complete steps 1-3 above in my Notebook, those required items stay in place for the Map:
However, when I complete steps 1-3, the required items in the Feature Class will disappear, not sure if I need those required items in the Feature Class when I do a Share > Publish Web Layer / Overwrite Web Layer:
Does anyone know have an idea of why I am having this issue? Or could help point me in the right direction of Help Documentation?
Thank you
Solved! Go to Solution.
Hi @eallan,
It looks like you are placing the sddraft_output_filename and your sd_output_filename in your file geodatabase. It more than likely doesn't like the '.' (dot)
Set these to another folder that is not a .gdb
After that, if not working, test commenting out sddraft.serverFolder (or replace for sddraft.portalFolder)
that's strange, it all looks correct. have you tried removing the tags, desc, summary etc? May be some issue with overwriting those - ie. work your way through the sddraft parameters.
Thank you very much for the help @DavidPike,
I commented out all the credits, description, summary, tags, use limitations, and server folder. I was able to get that cell to complete, which was the one originally giving me the error:
'dict' object has no attribute '_validateParameters'
But then the next cell is still giving me this error now:
Start Staging Sddraft not staged. Analyzer errors encountered - Failed to execute. Parameters are not valid. ERROR 000814: Invalid file type ERROR 000814: Invalid file type Failed to execute (StageService).
This is what it looks like on my notebook for the commenting out of the parameters and the new error code I am getting:
Going to also see if creating a new project with no spaces in the title and no spaces in the .gdb title might fix it. I did the suggestion Clubdebambos said of just removing sddraft.targetServer and I left everything else the same in the script (like in my original post) and I got this error (I also shared it in my reply to his response):
ValueError: Service and/or folder name contains unsupported characters: ' '
Hi @eallan,
A couple of things to try...
You are using sddraft.targetFolder, try switch to portalFolder (I dont see targetFolder in the docs)
Remove sddraft.targetServer (you're already signing into AGOL, it knows where to go, and I don't see targetServer in the docs)
You can also try removing the arcpy.SignInToPortal() and just be already signed into AGOL in ArcGIS Pro.
This blog post details publishing from ArcGIS Pro with ArcPy.
And here's some other community posts that might be helpful:
Solved: Overwrite Web Layer - Esri Community
Automate overwrite web layer, feature class - Esri Community
All the best,
Glen
Thank you @Clubdebambos for all that info, truly appreciated!
I commented out the sddraft.targetServer = target_server_connection :
And now I'm getting this new error:
ValueError: Service and/or folder name contains unsupported characters: ' '
I'm thinking it's because of the spaces in my project title and gdb title?:
Hi @eallan,
It looks like you are placing the sddraft_output_filename and your sd_output_filename in your file geodatabase. It more than likely doesn't like the '.' (dot)
Set these to another folder that is not a .gdb
After that, if not working, test commenting out sddraft.serverFolder (or replace for sddraft.portalFolder)
That was the fix @Clubdebambos ! Thank you so much for helping me find the issue and correction for it. I ended up figuring this out yesterday after I spent a couple hours going through my code (ahhhh!) when I should of just checked back here and looked at your response ha.
I got my Notebook to work now, and also got it working as a Toolbox Script when I manually run it, but now I'm having issues with it not working when I schedule it, keep getting:
ERROR 000464: Cannot get exclusive schema lock. Either being edited or in use by another application or service. Failed to execute (ExportTable).
I might have to do another community post for this new issue if I can't figure it out by the end of the day.
Appreciate your help again. Have a good day.