500 Internal Server Error: Object Reference Not Set When Creating Shape in PPTX

Subject: 500 Internal Server Error: Object Reference Not Set When Creating Shape in PPTX

Description:

Hello Aspose Support Team,

I’m experiencing an issue with the Aspose.Slides Cloud API when attempting to create a shape (specifically, a table) in a PPTX file. The API call results in a 500 Internal Server Error, with the following response:

**Please note: this was working few weeks before **
Error Details:

 File "/home/cmp/Projects/fca-report/venv/lib/python3.10/site-packages/asposeslidescloud/rest.py", line 289, in POST return self.request("POST", url, File "/home/cmp/Projects/fca-report/venv/lib/python3.10/site-packages/asposeslidescloud/rest.py", line 244, in request raise ApiException(http_resp=r) asposeslidescloud.rest.ApiException: (500) Reason: Internal Server Error HTTP response headers: HTTPHeaderDict({'Date': 'Wed, 28 Aug 2024 10:06:04 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '243', 'Connection': 'keep-alive', 'server': 'nginx/1.19.9'}) HTTP response body: Object reference not set to an instance of an object. 

Parameters Used in the API Call:

  • file_name: Chart-QAAdmin-08_28_2024_06_05_57.pptx
  • slide_index: 1
  • folder_name: ppt/dev/
  • aspose_storage: Report
  • dto:
{'alternate_links': None, 'alternative_text': None, 'alternative_text_title': None, 'columns': [{'width': 169.5}, {'width': 169.5}, {'width': 169.5}, {'width': 169.5}], 'effect_format': None, 'fill_format': None, 'first_col': None, 'first_row': None, 'height': None, 'hidden': None, 'horizontal_banding': None, 'hyperlink_click': None, 'hyperlink_mouse_over': None, 'last_col': None, 'last_row': None, 'line_format': None, 'name': None, 'right_to_left': None, 'rows': [{'cells': [{'border_bottom': {'alignment': None, 'begin_arrow_head': None, 'cap_style': None, 'custom_dash_pattern': None, 'dash_style': None, 'end_arrow_head': None, 'fill_format': None, 'join_style': None, 'miter_limit': None, 'sketch_type': None, 'style': None, 'width': 0}, 'border_diagonal_down': None, 'border_diagonal_up': None, 'border_left': {'alignment': 'Center', 'begin_arrow_head': None, 'cap_style': 'Flat', 'custom_dash_pattern': None, 'dash_style': 'SystemDashDot', 'end_arrow_head': None, 'fill_format': {'color': '#d9d9d9', 'type': 'Solid'}, 'join_style': 'Round', 'miter_limit': None, 'sketch_type': 'Curved', 'style': 'Single', 'width': 5.0}, 'border_right': {'alignment': 'Center', 'begin_arrow_head': None, 'cap_style': 'Flat', 'custom_dash_pattern': None, 'dash_style': 'SystemDashDot', 'end_arrow_head': None, 'fill_format': {'color': '#d9d9d9', 'type': 'Solid'}, 'join_style': 'Round', 'miter_limit': None, 'sketch_type': 'Curved', 'style': 'Single', 'width': 5.0}, 'border_top': {'alignment': 'Center', 'begin_arrow_head': None, 'cap_style': 'Flat', 'custom_dash_pattern': None, 'dash_style': 'SystemDashDot', 'end_arrow_head': None, 'fill_format': {'color': '#d9d9d9', 'type': 'Solid'}, 'join_style': 'Round', 'miter_limit': None, 'sketch_type': 'Curved', 'style': 'Single', 'width': 5.0}, 'col_span': None, 'column_index': None, 'fill_format': None, 'margin_bottom': None, 'margin_left': None, 'margin_right': None, 'margin_top': None, 'paragraphs': None, 'row_index': None, 'row_span': None, 'text': '', 'text_anchor_type': None, 'text_frame_format': None, 'text_vertical_type': None}, {'border_bottom': None, 'border_diagonal_down': None, 'border_diagonal_up': None, 'border_left': None, 'border_right': None, 'border_top': None, 'col_span': None, 'column_index': None, 'fill_format': None, 'margin_bottom': None, 'margin_left': None, 'margin_right': None, 'margin_top': None, 'paragraphs': None, 'row_index': None, 'row_span': None, 'text': '', 'text_anchor_type': None, 'text_frame_format': None, 'text_vertical_type': None}, {'border_bottom': None, 'border_diagonal_down': None, 'border_diagonal_up': None, 'border_left': None, 'border_right': None, 'border_top': None, 'col_span': None, 'column_index': None, 'fill_format': None, 'margin_bottom': None, 'margin_left': None, 'margin_right': None, 'margin_top': None, 'paragraphs': None, 'row_index': None, 'row_span': None, 'text': '', 'text_anchor_type': None, 'text_frame_format': None, 'text_vertical_type': None}, {'border_bottom': None, 'border_diagonal_down': None, 'border_diagonal_up': None, 'border_left': None, 'border_right': None, 'border_top': None, 'col_span': None, 'column_index': None, 'fill_format': None, 'margin_bottom': None, 'margin_left': None, 'margin_right': None, 'margin_top': None, 'paragraphs': None, 'row_index': None, 'row_span': None, 'text': '', 'text_anchor_type': None, 'text_frame_format': None, 'text_vertical_type': None}], 'height': None, 'minimal_height': 70}, {'cells': [{'border_bottom': {'alignment': 'Center', 'begin_arrow_head': None, 'cap_style': 'Flat', 'custom_dash_pattern': None, 'dash_style': 'SystemDashDot', 'end_arrow_head': None, 'fill_format': {'color': '#d9d9d9', 'type': 'Solid'}, 'join_style': 'Round', 'miter_limit': None, 'sketch_type': 'Curved', 'style': 'Single', 'width': 5.0}, 'border_diagonal_down': None, 'border_diagonal_up': None, 'border_left': {'alignment': 'Center', 'begin_arrow_head': None, 'cap_style': 'Flat', 'custom_dash_pattern': None, 'dash_style': 'SystemDashDot', 'end_arrow_head': None, 'fill_format': {'color': '#d9d9d9', 'type': 'Solid'}, 'join_style': 'Round', 'miter_limit': None, 'sketch_type': 'Curved', 'style': 'Single', 'width': 5.0}, 'border_right': {'alignment': 'Center', 'begin_arrow_head': None, 'cap_style': 'Flat', 'custom_dash_pattern': None, 'dash_style': 'SystemDashDot', 'end_arrow_head': None, 'fill_format': {'color': '#d9d9d9', 'type': 'Solid'}, 'join_style': 'Round', 'miter_limit': None, 'sketch_type': 'Curved', 'style': 'Single', 'width': 5.0}, 'border_top': None, 'col_span': None, 'column_index': None, 'fill_format': None, 'margin_bottom': None, 'margin_left': None, 'margin_right': None, 'margin_top': None, 'paragraphs': None, 'row_index': None, 'row_span': None, 'text': '', 'text_anchor_type': None, 'text_frame_format': None, 'text_vertical_type': None}, {'border_bottom': None, 'border_diagonal_down': None, 'border_diagonal_up': None, 'border_left': None, 'border_right': None, 'border_top': None, 'col_span': None, 'column_index': None, 'fill_format': None, 'margin_bottom': None, 'margin_left': None, 'margin_right': None, 'margin_top': None, 'paragraphs': None, 'row_index': None, 'row_span': None, 'text': '', 'text_anchor_type': None, 'text_frame_format': None, 'text_vertical_type': None}, {'border_bottom': None, 'border_diagonal_down': None, 'border_diagonal_up': None, 'border_left': None, 'border_right': None, 'border_top': None, 'col_span': None, 'column_index': None, 'fill_format': None, 'margin_bottom': None, 'margin_left': None, 'margin_right': None, 'margin_top': None, 'paragraphs': None, 'row_index': None, 'row_span': None, 'text': '', 'text_anchor_type': None, 'text_frame_format': None, 'text_vertical_type': None}, {'border_bottom': None, 'border_diagonal_down': None, 'border_diagonal_up': None, 'border_left': None, 'border_right': None, 'border_top': None, 'col_span': None, 'column_index': None, 'fill_format': None, 'margin_bottom': None, 'margin_left': None, 'margin_right': None, 'margin_top': None, 'paragraphs': None, 'row_index': None, 'row_span': None, 'text': '', 'text_anchor_type': None, 'text_frame_format': None, 'text_vertical_type': None}], 'height': None, 'minimal_height': 419}], 'self_uri': None, 'style': 'None', 'three_d_format': None, 'type': 'Table', 'vertical_banding': None, 'width': None, 'x': 20, 'y': 10, 'z_order_position': None} 

Aspose Storage

file is inside the Zip

Environment:

  • Operating System: Linux
  • Python Version: 3.10.12
  • Aspose.Slides Cloud SDK Version: asposeslidescloud==23.4.0

Steps to Reproduce:

  1. Use the provided parameters to create a shape in the specified slide of the PPTX file.
  2. The API call returns a 500 Internal Server Error with the message: “Object reference not set to an instance of an object.”

Additional Information:

  • The error message suggests a potential server-side issue with object references.
  • This issue is currently blocking the progress of our project.

Please advise on how to resolve this issue or if there is a workaround we can use.

Thank you for your assistance
image.png (40.9 KB)
Chart-QAAdmin-08_28_2024_06_05_57.zip (22.0 KB)

@HPLINC,
Thank you for describing the issue.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESCLOUD-1982 

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Hi @andrey.potapov, Any updates regarding the issue.

@HPLINC,
The issue is still open. Our developers need some time to look into the case. Unfortunately, I don’t have any additional information yet.

1 Like

Hi @andrey.potapov , Any new updates regarding the issue. we are stuck in PPT generation.

@HPLINC,
We are sorry that you have to encounter this problem. Unfortunately, I can’t help you in any way at the moment. I am also waiting for information from our developers.

@HPLINC,
The issue will be resolved in Aspose.Slides Cloud SDKs 24.9 but note that JSON keys must be specified like “minimalHeight”, not “minimal_height” etc.

dto = {'alternate_links': None, 'alternative_text': None, 'alternative_text_title': None, 'columns': [{'width': 169.5}, {'width': 169.5}, {'width': 169.5}, {'width': 169.5}], 'effect_format': None, 'fill_format': None, 'first_col': None, 'first_row': None, 'height': None, 'hidden': None, 'horizontal_banding': None, 'hyperlink_click': None, 'hyperlink_mouse_over': None, 'is_decorative': None, 'last_col': None, 'last_row': None, 'line_format': None, 'name': None, 'right_to_left': None, 'rows': [{'cells': [{'border_bottom': {'alignment': None, 'begin_arrow_head': None, 'cap_style': None, 'custom_dash_pattern': None, 'dash_style': None, 'end_arrow_head': None, 'fill_format': None, 'join_style': None, 'miter_limit': None, 'sketch_type': None, 'style': None, 'width': 0}, 'border_diagonal_down': None, 'border_diagonal_up': None, 'border_left': {'alignment': 'Center', 'begin_arrow_head': None, 'cap_style': 'Flat', 'custom_dash_pattern': None, 'dash_style': 'SystemDashDot', 'end_arrow_head': None, 'fill_format': {'color': '#d9d9d9', 'type': 'Solid'}, 'join_style': 'Round', 'miter_limit': None, 'sketch_type': 'Curved', 'style': 'Single', 'width': 5.0}, 'border_right': {'alignment': 'Center', 'begin_arrow_head': None, 'cap_style': 'Flat', 'custom_dash_pattern': None, 'dash_style': 'SystemDashDot', 'end_arrow_head': None, 'fill_format': {'color': '#d9d9d9', 'type': 'Solid'}, 'join_style': 'Round', 'miter_limit': None, 'sketch_type': 'Curved', 'style': 'Single', 'width': 5.0}, 'border_top': {'alignment': 'Center', 'begin_arrow_head': None, 'cap_style': 'Flat', 'custom_dash_pattern': None, 'dash_style': 'SystemDashDot', 'end_arrow_head': None, 'fill_format': {'color': '#d9d9d9', 'type': 'Solid'}, 'join_style': 'Round', 'miter_limit': None, 'sketch_type': 'Curved', 'style': 'Single', 'width': 5.0}, 'col_span': None, 'column_index': None, 'fill_format': None, 'margin_bottom': None, 'margin_left': None, 'margin_right': None, 'margin_top': None, 'paragraphs': None, 'row_index': None, 'row_span': None, 'text': '', 'text_anchor_type': None, 'text_frame_format': None, 'text_vertical_type': None, 'transparency': None}, {'border_bottom': None, 'border_diagonal_down': None, 'border_diagonal_up': None, 'border_left': None, 'border_right': None, 'border_top': None, 'col_span': None, 'column_index': None, 'fill_format': None, 'margin_bottom': None, 'margin_left': None, 'margin_right': None, 'margin_top': None, 'paragraphs': None, 'row_index': None, 'row_span': None, 'text': '', 'text_anchor_type': None, 'text_frame_format': None, 'text_vertical_type': None, 'transparency': None}, {'border_bottom': None, 'border_diagonal_down': None, 'border_diagonal_up': None, 'border_left': None, 'border_right': None, 'border_top': None, 'col_span': None, 'column_index': None, 'fill_format': None, 'margin_bottom': None, 'margin_left': None, 'margin_right': None, 'margin_top': None, 'paragraphs': None, 'row_index': None, 'row_span': None, 'text': '', 'text_anchor_type': None, 'text_frame_format': None, 'text_vertical_type': None, 'transparency': None}, {'border_bottom': None, 'border_diagonal_down': None, 'border_diagonal_up': None, 'border_left': None, 'border_right': None, 'border_top': None, 'col_span': None, 'column_index': None, 'fill_format': None, 'margin_bottom': None, 'margin_left': None, 'margin_right': None, 'margin_top': None, 'paragraphs': None, 'row_index': None, 'row_span': None, 'text': '', 'text_anchor_type': None, 'text_frame_format': None, 'text_vertical_type': None, 'transparency': None}], 'height': None, 'minimal_height': None}, {'cells': [{'border_bottom': {'alignment': 'Center', 'begin_arrow_head': None, 'cap_style': 'Flat', 'custom_dash_pattern': None, 'dash_style': 'SystemDashDot', 'end_arrow_head': None, 'fill_format': {'color': '#d9d9d9', 'type': 'Solid'}, 'join_style': 'Round', 'miter_limit': None, 'sketch_type': 'Curved', 'style': 'Single', 'width': 5.0}, 'border_diagonal_down': None, 'border_diagonal_up': None, 'border_left': {'alignment': 'Center', 'begin_arrow_head': None, 'cap_style': 'Flat', 'custom_dash_pattern': None, 'dash_style': 'SystemDashDot', 'end_arrow_head': None, 'fill_format': {'color': '#d9d9d9', 'type': 'Solid'}, 'join_style': 'Round', 'miter_limit': None, 'sketch_type': 'Curved', 'style': 'Single', 'width': 5.0}, 'border_right': {'alignment': 'Center', 'begin_arrow_head': None, 'cap_style': 'Flat', 'custom_dash_pattern': None, 'dash_style': 'SystemDashDot', 'end_arrow_head': None, 'fill_format': {'color': '#d9d9d9', 'type': 'Solid'}, 'join_style': 'Round', 'miter_limit': None, 'sketch_type': 'Curved', 'style': 'Single', 'width': 5.0}, 'border_top': None, 'col_span': None, 'column_index': None, 'fill_format': None, 'margin_bottom': None, 'margin_left': None, 'margin_right': None, 'margin_top': None, 'paragraphs': None, 'row_index': None, 'row_span': None, 'text': '', 'text_anchor_type': None, 'text_frame_format': None, 'text_vertical_type': None, 'transparency': None}, {'border_bottom': None, 'border_diagonal_down': None, 'border_diagonal_up': None, 'border_left': None, 'border_right': None, 'border_top': None, 'col_span': None, 'column_index': None, 'fill_format': None, 'margin_bottom': None, 'margin_left': None, 'margin_right': None, 'margin_top': None, 'paragraphs': None, 'row_index': None, 'row_span': None, 'text': '', 'text_anchor_type': None, 'text_frame_format': None, 'text_vertical_type': None, 'transparency': None}, {'border_bottom': None, 'border_diagonal_down': None, 'border_diagonal_up': None, 'border_left': None, 'border_right': None, 'border_top': None, 'col_span': None, 'column_index': None, 'fill_format': None, 'margin_bottom': None, 'margin_left': None, 'margin_right': None, 'margin_top': None, 'paragraphs': None, 'row_index': None, 'row_span': None, 'text': '', 'text_anchor_type': None, 'text_frame_format': None, 'text_vertical_type': None, 'transparency': None}, {'border_bottom': None, 'border_diagonal_down': None, 'border_diagonal_up': None, 'border_left': None, 'border_right': None, 'border_top': None, 'col_span': None, 'column_index': None, 'fill_format': None, 'margin_bottom': None, 'margin_left': None, 'margin_right': None, 'margin_top': None, 'paragraphs': None, 'row_index': None, 'row_span': None, 'text': '', 'text_anchor_type': None, 'text_frame_format': None, 'text_vertical_type': None, 'transparency': None}], 'height': None, 'minimal_height': None}], 'self_uri': None, 'style': 'None', 'three_d_format': None, 'transparency': None, 'type': 'Table', 'vertical_banding': None, 'width': None, 'x': 20, 'y': 10, 'z_order_position': None} asposeslidescloud.Slide.create_shape(file_name, slide_index, dto, None, None, None, folder_name, storage=aspose_storage) 

here we are using create_shape function. currently using the version is asposeslidescloud==24.8.0.
we checked once more. but we got an error

asposeslidescloud.rest.ApiException: (500)
Reason: Internal Server Error
HTTP response headers: HTTPHeaderDict({‘Date’: ‘Fri, 06 Sep 2024 07:23:41 GMT’, ‘Content-Type’: ‘application/json; charset=utf-8’, ‘Content-Length’: ‘243’, ‘Connection’: ‘keep-alive’, ‘server’: ‘nginx/1.19.9’})
HTTP response body: Object reference not set to an instance of an object.

could you please investigate this ?

@HPLINC,
Please note that the JSON keys in your dto are specified incorrectly. They must be named like “effectFormat” instead of “effect_format”, “fillFormat” instead of “fill_format” etc.

@andrey.potapov , Please give me the updated JSON keys of dto

@HPLINC,
It will take me some time to do this. I will get back to you soon.

@HPLINC,
There is no need to fill in data that has a value of None. You can fill in the data as follows:

dto = { 'columns': [{'width': 169.5}, {'width': 169.5}, {'width': 169.5}, {'width': 169.5}], 'rows': [{'cells': [{'borderBottom': {'width': 0}, 'borderLeft': {'alignment': 'Center', 'capStyle': 'Flat', 'dashStyle': 'SystemDashDot', 'fillFormat': {'color': '#d9d9d9', 'type': 'Solid'}, 'joinStyle': 'Round', 'sketchType': 'Curved', 'style': 'Single', 'width': 5.0}, 'borderRight': {'alignment': 'Center', 'capStyle': 'Flat', 'dashStyle': 'SystemDashDot', 'fillFormat': {'color': '#d9d9d9', 'type': 'Solid'}, 'joinStyle': 'Round', 'sketchType': 'Curved', 'style': 'Single', 'width': 5.0}, 'borderTop': {'alignment': 'Center', 'capStyle': 'Flat', 'dashStyle': 'SystemDashDot', 'fillFormat': {'color': '#d9d9d9', 'type': 'Solid'}, 'joinStyle': 'Round', 'sketchType': 'Curved', 'style': 'Single', 'width': 5.0}, 'text': ''}, {'text': ''}, {'text': ''}, {'text': ''}]}, {'cells': [{'borderBottom': {'alignment': 'Center', 'capStyle': 'Flat', 'dashStyle': 'SystemDashDot', 'fillFormat': {'color': '#d9d9d9', 'type': 'Solid'}, 'joinStyle': 'Round', 'sketchType': 'Curved', 'style': 'Single', 'width': 5.0}, 'borderLeft': {'alignment': 'Center', 'capStyle': 'Flat', 'dashStyle': 'SystemDashDot', 'fillFormat': {'color': '#d9d9d9', 'type': 'Solid'}, 'joinStyle': 'Round', 'sketchType': 'Curved', 'style': 'Single', 'width': 5.0}, 'borderRight': {'alignment': 'Center', 'capStyle': 'Flat', 'dashStyle': 'SystemDashDot', 'fillFormat': {'color': '#d9d9d9', 'type': 'Solid'}, 'joinStyle': 'Round', 'sketchType': 'Curved', 'style': 'Single', 'width': 5.0}, 'text': ''}, {'text': ''}, {'text': ''}, {'text': ''}]}], 'style': 'None', 'type': 'Table', 'x': 20, 'y': 10 } 

API reference: Aspose.Slides Cloud - API References

Anyway, the error you described in the first message persists. You should wait for Aspose.Slides Cloud SDK for Python 24.9. We apologize for any inconvenience caused.

@HPLINC,
The issues you found earlier (filed as SLIDESCLOUD-1982) have been fixed in Aspose.Slides Cloud SDK for Python 24.9.
You can check all fixes on the Release Notes page.