Select to view content in your preferred language

sddraft.exportSDDraft() spitting out error: 'dict' object has no attribute '_validateParameters'

588
7
Jump to solution
03-21-2025 01:05 PM
eallan
by
Occasional Contributor

I am trying to write a Notebook/Python script that will:

  1. select certain records from an SQL Server
  2. then export to a File GDB Table
  3. then I run the XY Table To Point tool to create a Feature Class from the File GDB Table
  4. then complete an Overwrite Web Layer, which is in our ArcGIS Online account

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:

eallan_0-1742588449214.png

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:

Screenshot 2025-03-21 121843.jpg

 

I have filled in the Name, Summary, and Tags (required items in order to publish or overwrite a web layer) for my map:

eallan_3-1742587174844.png

 

When I complete steps 1-3 above in my Notebook, those required items stay in place for the Map:

eallan_0-1742586467593.png

 

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: 

eallan_1-1742586818851.png

 

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

0 Kudos
1 Solution

Accepted Solutions
Clubdebambos
MVP Regular Contributor

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)

~ learn.finaldraftmapping.com

View solution in original post

7 Replies
DavidPike
MVP Notable Contributor

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.

eallan
by
Occasional Contributor

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:

Screenshot 2025-03-24 170015.jpg

 

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: ' '

 

0 Kudos
DavidPike
MVP Notable Contributor

Yes I'd remove any spaces from the service name.

Clubdebambos
MVP Regular Contributor

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

~ learn.finaldraftmapping.com
eallan
by
Occasional Contributor

Thank you @Clubdebambos for all that info, truly appreciated!

I commented out the sddraft.targetServer = target_server_connection :

eallan_3-1742859312185.png

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?:

eallan_4-1742859493449.png

 

0 Kudos
Clubdebambos
MVP Regular Contributor

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)

~ learn.finaldraftmapping.com
eallan
by
Occasional Contributor

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.

0 Kudos