anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: ynput/OpenPype
Issue: Scene Manager: Update all to latest bug

## Bug

Running **Maya 2023** and running update all command in scene inventory. It produce this traceback:

```
# Traceback (most recent call last):
#   File "C:\\Users\\annat\\Documents\\Projects\\OpenPype\\sources\\OpenPype\\openpype\\tools\\sceneinventory\\window.py", line 171, in _on_update_all
#     self._view.update_all()
#   File "C:\\Users\\annat\\Documents\\Projects\\OpenPype\\sources\\OpenPype\\openpype\\tools\\sceneinventory\\view.py", line 844, in update_all
#     update_container(item, -1)
#   File "C:\\Users\\annat\\Documents\\Projects\\OpenPype\\sources\\OpenPype\\openpype\\pipeline\\load\\utils.py", line 477, in update_container
#     return loader.update(container, new_representation)
#   File "C:\\Users\\annat\\Documents\\Projects\\OpenPype\\sources\\OpenPype\\openpype\\hosts\\maya\\plugins\\load\\load_look.py", line 107, in update
#     msg = ScrollMessageBox(QtWidgets.QMessageBox.Warning,
#   File "C:\\Users\\annat\\Documents\\Projects\\OpenPype\\sources\\OpenPype\\openpype\\widgets\\message_window.py", line 117, in __init__
#     scroll_widget.setMinimumWidth(min(max_width, max_len * 6))
# TypeError: '<' not supported between instances of 'int' and 'builtin_function_or_method'
```


[cuID:[OP-4666](https://app.clickup.com/t/861m3ywnu)]

Changed files:
openpype/widgets/message_window.py

diff --git a/openpype/widgets/message_window.py b/openpype/widgets/message_window.py
index 94e51f5d4f..a44df2ec8e 100644
--- a/openpype/widgets/message_window.py
+++ b/openpype/widgets/message_window.py
@@ -105,16 +105,19 @@ class ScrollMessageBox(QtWidgets.QDialog):
         content_widget = QtWidgets.QWidget(self)
         scroll_widget.setWidget(content_widget)
 
-        max_len = 0
+        message_len = 0
         content_layout = QtWidgets.QVBoxLayout(content_widget)
         for message in messages:
             label_widget = QtWidgets.QLabel(message, content_widget)
             content_layout.addWidget(label_widget)
-            max_len = max(max_len, len(message))
+            message_len = max(message_len, len(message))
 
         # guess size of scrollable area
-        max_width = QtWidgets.QApplication.desktop().availableGeometry().width
-        scroll_widget.setMinimumWidth(min(max_width, max_len * 6))
+        desktop = QtWidgets.QApplication.desktop()
+        max_width = desktop.availableGeometry().width()
+        scroll_widget.setMinimumWidth(
+            min(max_width, message_len * 6)
+        )
         layout.addWidget(scroll_widget)
 
         if not cancelable:  # if no specific buttons OK only
Repository: ynput/OpenPype
Issue: Bug: Substance Painter: When creating TextureSet in Publisher, its params arent propagated to the Instance

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior:

When user creates new ```Texture Set``` in ```Publisher``` and change its parameters like ```Output Template``` or ```File Type``` etc. those changes arent propagated to the newly created ```Texture Set``` instance and resets back to default values.

![image](https://github.com/ynput/OpenPype/assets/112623825/a232f0fb-820c-4fec-ba51-ad908f3ac526)


### Expected Behavior:

If any changes made to any of the parameters on ```Texture Set``` instance during creation it should propagate those to newly created ```Texture Set``` obviously, so user doesnt need to tweak those params again because of reverting to defaults.

### Version

3.15.11-nightly.4

### What platform you are running OpenPype on?

Windows

### Steps To Reproduce:

1. Go to OP>Create
2. Create new ```Texture Set``` instance
3. Tweak its settings to your liking so it differ from defaults
4. Check newly created ```Texture Set``` if all changes were propagated/saved

### Are there any labels you wish to add?

- [X] I have added the relevant labels to the bug report.

### Relevant log output:

_No response_

### Additional context:

_No response_


[cuID:[OP-6232](https://app.clickup.com/t/863h2adfe)]

Changed files:
openpype/hosts/substancepainter/plugins/create/create_textures.py

diff --git a/openpype/hosts/substancepainter/plugins/create/create_textures.py b/openpype/hosts/substancepainter/plugins/create/create_textures.py
index dece4b2cc1..6972ba2794 100644
--- a/openpype/hosts/substancepainter/plugins/create/create_textures.py
+++ b/openpype/hosts/substancepainter/plugins/create/create_textures.py
@@ -34,6 +34,18 @@ class CreateTextures(Creator):
         if not substance_painter.project.is_open():
             raise CreatorError("Can't create a Texture Set instance without "
                                "an open project.")
+        # Transfer settings from pre create to instance
+        creator_attributes = instance_data.setdefault(
+            "creator_attributes", dict())
+        for key in [
+            "exportPresetUrl",
+            "exportFileFormat",
+            "exportSize",
+            "exportPadding",
+            "exportDilationDistance"
+        ]:
+            if key in pre_create_data:
+                creator_attributes[key] = pre_create_data[key]
 
         instance = self.create_instance_in_context(subset_name,
                                                    instance_data)
Repository: ynput/OpenPype
Issue: Bug: 3dsmax - OP Menu >"Set Frame Range" doesnt work in Max 2024

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior:

When setting frame range for asset/shot via OP menu ```Set Frame Range``` it doesnt work and frame range stays as is.

![image](https://github.com/ynput/OpenPype/assets/112623825/20e736f3-a67d-498b-827f-74ee27dedf0d)


### Expected Behavior:

```Set Frame Range``` should set scene frame range according to Database.

### Version

3.15.11-nightly.4

### What platform you are running OpenPype on?

Windows

### Steps To Reproduce:

1. Check if the ```frame range``` is not same as in Database and change it so they differ
2. use OP Menu > ```Set Frame Range``` action to fix it
3. The scene still have original wrong frame range without any change

### Are there any labels you wish to add?

- [X] I have added the relevant labels to the bug report.

### Relevant log output:

_No response_

### Additional context:

_No response_


[cuID:[OP-6244](https://app.clickup.com/t/863h2hqt3)]

Changed files:
openpype/hosts/max/api/lib.py

diff --git a/openpype/hosts/max/api/lib.py b/openpype/hosts/max/api/lib.py
index 1d53802ecf..dbaa6e4a24 100644
--- a/openpype/hosts/max/api/lib.py
+++ b/openpype/hosts/max/api/lib.py
@@ -250,10 +250,7 @@ def reset_frame_range(fps: bool = True):
         frame_range["handleStart"]
     )
     frame_end_handle = frame_range["frameEnd"] + int(frame_range["handleEnd"])
-    frange_cmd = (
-        f"animationRange = interval {frame_start_handle} {frame_end_handle}"
-    )
-    rt.Execute(frange_cmd)
+    set_timeline(frame_start_handle, frame_end_handle)
     set_render_frame_range(frame_start_handle, frame_end_handle)
 
 
@@ -285,3 +282,10 @@ def get_max_version():
     """
     max_info = rt.MaxVersion()
     return max_info[7]
+
+
+def set_timeline(frameStart, frameEnd):
+    """Set frame range for timeline editor in Max
+    """
+    rt.animationRange = rt.interval(frameStart, frameEnd)
+    return rt.animationRange
Repository: ynput/OpenPype
Issue: Bug: Houdini Extract OpenGL is optional but doesn't make any sense

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior:

The review publish instance implemented with #3839 has the ExtractOpenGL node set to "optional" but for a review instance that doesn't really make any sense since it's the only extractor for it and whenever you disable it then Integration fails because the instance has no representations to publish because it created nothing.

### Expected Behavior:

I think the extractor should not be optional.

### Version

3.15.4-nightly.3

### What platform you are running OpenPype on?

Windows

### Steps To Reproduce:

1. Start Houdini
2. Create a review instance
3. On the review instance on publish tab disable "Extract OpenGL"
4. Publish
5. It will fail.

### Are there any labels you wish to add?

- [X] I have added the relevant labels to the bug report.

### Relevant log output:

_No response_

### Additional context:

_No response_


[cuID:[OP-5756](https://app.clickup.com/t/861mp7g8f)]

Changed files:
openpype/hosts/houdini/plugins/publish/extract_opengl.py

diff --git a/openpype/hosts/houdini/plugins/publish/extract_opengl.py b/openpype/hosts/houdini/plugins/publish/extract_opengl.py
index c26d0813a6..6c36dec5f5 100644
--- a/openpype/hosts/houdini/plugins/publish/extract_opengl.py
+++ b/openpype/hosts/houdini/plugins/publish/extract_opengl.py
@@ -2,27 +2,20 @@ import os
 
 import pyblish.api
 
-from openpype.pipeline import (
-    publish,
-    OptionalPyblishPluginMixin
-)
+from openpype.pipeline import publish
 from openpype.hosts.houdini.api.lib import render_rop
 
 import hou
 
 
-class ExtractOpenGL(publish.Extractor,
-                    OptionalPyblishPluginMixin):
+class ExtractOpenGL(publish.Extractor):
 
     order = pyblish.api.ExtractorOrder - 0.01
     label = "Extract OpenGL"
     families = ["review"]
     hosts = ["houdini"]
-    optional = True
 
     def process(self, instance):
-        if not self.is_active(instance.data):
-            return
         ropnode = hou.node(instance.data.get("instance_node"))
 
         output = ropnode.evalParm("picture")
Repository: ynput/OpenPype
Issue: Maya: Deadline limit groups are not working

 Setting `limit group` on render job in Maya has no effect.

[cuID:1nuvvy3]

Changed files:
openpype/modules/default_modules/deadline/plugins/publish/submit_maya_deadline.py

diff --git a/openpype/modules/default_modules/deadline/plugins/publish/submit_maya_deadline.py b/openpype/modules/default_modules/deadline/plugins/publish/submit_maya_deadline.py
index 2d43b0d085..e6c42374ca 100644
--- a/openpype/modules/default_modules/deadline/plugins/publish/submit_maya_deadline.py
+++ b/openpype/modules/default_modules/deadline/plugins/publish/submit_maya_deadline.py
@@ -288,6 +288,22 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin):
                 "pluginInfo", {})
         )
 
+        self.limit_groups = (
+            context.data["project_settings"].get(
+                "deadline", {}).get(
+                "publish", {}).get(
+                "MayaSubmitDeadline", {}).get(
+                "limit", [])
+        )
+
+        self.group = (
+            context.data["project_settings"].get(
+                "deadline", {}).get(
+                "publish", {}).get(
+                "MayaSubmitDeadline", {}).get(
+                "group", "none")
+        )
+
         context = instance.context
         workspace = context.data["workspaceDir"]
         anatomy = context.data['anatomy']
Repository: ynput/OpenPype
Issue: Missing defaults in settings

 ## Description
- tray should show popup if there are missing default values in settings

[cuID:PYPE-1221]

Changed files:
openpype/settings/__init__.py, openpype/tools/tray/pype_tray.py

diff --git a/openpype/settings/__init__.py b/openpype/settings/__init__.py
index 74f2684b2a..9d7598a948 100644
--- a/openpype/settings/__init__.py
+++ b/openpype/settings/__init__.py
@@ -25,7 +25,8 @@ from .lib import (
 )
 from .entities import (
     SystemSettings,
-    ProjectSettings
+    ProjectSettings,
+    DefaultsNotDefined
 )
 
 
@@ -51,6 +52,8 @@ __all__ = (
     "get_anatomy_settings",
     "get_environments",
     "get_local_settings",
+
     "SystemSettings",
-    "ProjectSettings"
+    "ProjectSettings",
+    "DefaultsNotDefined"
 )
diff --git a/openpype/tools/tray/pype_tray.py b/openpype/tools/tray/pype_tray.py
index 35b254513f..fde43980cc 100644
--- a/openpype/tools/tray/pype_tray.py
+++ b/openpype/tools/tray/pype_tray.py
@@ -17,6 +17,11 @@ from openpype.api import (
 from openpype.lib import get_pype_execute_args
 from openpype.modules import TrayModulesManager
 from openpype import style
+from openpype.settings import (
+    SystemSettings,
+    ProjectSettings,
+    DefaultsNotDefined
+)
 
 from .pype_info_widget import PypeInfoWidget
 
@@ -114,6 +119,54 @@ class TrayManager:
 
         self.main_thread_timer = main_thread_timer
 
+        # For storing missing settings dialog
+        self._settings_validation_dialog = None
+
+        self.execute_in_main_thread(self._startup_validations)
+
+    def _startup_validations(self):
+        """Run possible startup validations."""
+        self._validate_settings_defaults()
+
+    def _validate_settings_defaults(self):
+        valid = True
+        try:
+            SystemSettings()
+            ProjectSettings()
+
+        except DefaultsNotDefined:
+            valid = False
+
+        if valid:
+            return
+
+        title = "Settings miss default values"
+        msg = (
+            "Your OpenPype will not work as expected! \\n"
+            "Some default values in settigs are missing. \\n\\n"
+            "Please contact OpenPype team."
+        )
+        msg_box = QtWidgets.QMessageBox(
+            QtWidgets.QMessageBox.Warning,
+            title,
+            msg,
+            QtWidgets.QMessageBox.Ok,
+            flags=QtCore.Qt.Dialog
+        )
+        icon = QtGui.QIcon(resources.get_openpype_icon_filepath())
+        msg_box.setWindowIcon(icon)
+        msg_box.setStyleSheet(style.load_stylesheet())
+        msg_box.buttonClicked.connect(self._post_validate_settings_defaults)
+
+        self._settings_validation_dialog = msg_box
+
+        msg_box.show()
+
+    def _post_validate_settings_defaults(self):
+        widget = self._settings_validation_dialog
+        self._settings_validation_dialog = None
+        widget.deleteLater()
+
     def show_tray_message(self, title, message, icon=None, msecs=None):
         """Show tray message.
Repository: ynput/OpenPype
Issue: Delivery Action file sequence handling

 **Describe the bug**
Delivery action fails to process file sequences 

**To Reproduce**
Anatomy Template:
{root[work]}/{project[name]}/out/{asset}_{task}_{@version}<.{@frame}>.{ext}
1. Publish exr file sequence from Nuke
2. on Ftrack version, run delivery action
3. See error :
Source file was not found
C:\\projects\\foo\\shots\\sq01\\sh010\\publish\\render\\renderCompositingMain\\v002\\PMR_sh010_renderCompositingMain_v002.```####```.exr doesn't exist for 614cc36ce6112e570b7474a6

**Desktop (please complete the following information):**
 - OS: Windows 10

**Additional context**
It seems that process_sequence checks if src_path argument exists, but src_path argument contains hashes, so it fails every time.

What would be the clean way to check if file sequence exists?

https://github.com/pypeclub/OpenPype/blob/2921bc6c46b076c9aaf73d8caaa54febe04050fe/openpype/lib/delivery.py#L231



[cuID:PYPE-1926]

Changed files:
openpype/lib/delivery.py

diff --git a/openpype/lib/delivery.py b/openpype/lib/delivery.py
index 943cd9fcaf..5735cbc99d 100644
--- a/openpype/lib/delivery.py
+++ b/openpype/lib/delivery.py
@@ -1,9 +1,11 @@
 """Functions useful for delivery action or loader"""
 import os
 import shutil
+import glob
 import clique
 import collections
 
+
 def collect_frames(files):
     """
         Returns dict of source path and its frame, if from sequence
@@ -228,7 +230,16 @@ def process_sequence(
         Returns:
             (collections.defaultdict , int)
     """
-    if not os.path.exists(src_path):
+
+    def hash_path_exist(myPath):
+        res = myPath.replace('#', '*')
+        glob_search_results = glob.glob(res)
+        if len(glob_search_results) > 0:
+            return True
+        else:
+            return False
+
+    if not hash_path_exist(src_path):
         msg = "{} doesn't exist for {}".format(src_path,
                                                repre["_id"])
         report_items["Source file was not found"].append(msg)
Repository: ynput/OpenPype
Issue: Maya: Loaded reference names

 ## Problem

When loading published stuff to scene as references, OpenPype will create reference named after asset. This is too generic because if we load multiple published things into the same scene, it will mangle names. Imagine shot `s01_010` with two model subsets published. If I load first it will create reference named `s01_010_RN`. But if I load second one, it will load it as `s01_011_RN` and that is confusing as hell.

## Proposal

We should append subset name to reference name. That way it stays reasonably named - `s01_010-modelMain_RN` and `s01_010-modelProxy_RN`


[cuID:PYPE-1218]

Changed files:
openpype/hosts/maya/plugins/load/load_reference.py, openpype/hosts/maya/api/plugin.py

diff --git a/openpype/hosts/maya/api/plugin.py b/openpype/hosts/maya/api/plugin.py
index 448cb814d9..fdad0e0989 100644
--- a/openpype/hosts/maya/api/plugin.py
+++ b/openpype/hosts/maya/api/plugin.py
@@ -123,7 +123,7 @@ class ReferenceLoader(api.Loader):
         count = options.get("count") or 1
         for c in range(0, count):
             namespace = namespace or lib.unique_namespace(
-                asset["name"] + "_",
+                "{}_{}_".format(asset["name"], context["subset"]["name"]),
                 prefix="_" if asset["name"][0].isdigit() else "",
                 suffix="_",
             )
diff --git a/openpype/hosts/maya/plugins/load/load_reference.py b/openpype/hosts/maya/plugins/load/load_reference.py
index 6dd161cf98..cfe8149218 100644
--- a/openpype/hosts/maya/plugins/load/load_reference.py
+++ b/openpype/hosts/maya/plugins/load/load_reference.py
@@ -41,14 +41,13 @@ class ReferenceLoader(openpype.hosts.maya.api.plugin.ReferenceLoader):
             family = "model"
 
         with maya.maintained_selection():
-
-            groupName = "{}:{}".format(namespace, name)
+            groupName = "{}:_GRP".format(namespace)
             cmds.loadPlugin("AbcImport.mll", quiet=True)
             nodes = cmds.file(self.fname,
                               namespace=namespace,
                               sharedReferenceFile=False,
                               groupReference=True,
-                              groupName="{}:{}".format(namespace, name),
+                              groupName=groupName,
                               reference=True,
                               returnNewNodes=True)
Repository: ynput/OpenPype
Issue: Alternate site for Site Sync doesn't work for sequences

 It seems that only first file in a sequence is marked with alternate site.

[cuID:1u46jz8]

Changed files:
openpype/modules/default_modules/sync_server/providers/sftp.py, openpype/modules/default_modules/sync_server/sync_server_module.py

diff --git a/openpype/modules/default_modules/sync_server/providers/sftp.py b/openpype/modules/default_modules/sync_server/providers/sftp.py
index 3390cd5d3d..1585b326bd 100644
--- a/openpype/modules/default_modules/sync_server/providers/sftp.py
+++ b/openpype/modules/default_modules/sync_server/providers/sftp.py
@@ -421,7 +421,8 @@ class SFTPHandler(AbstractProvider):
 
         try:
             return pysftp.Connection(**conn_params)
-        except paramiko.ssh_exception.SSHException:
+        except (paramiko.ssh_exception.SSHException,
+                pysftp.exceptions.ConnectionException):
             log.warning("Couldn't connect", exc_info=True)
 
     def _mark_progress(self, collection, file, representation, server, site,
diff --git a/openpype/modules/default_modules/sync_server/sync_server_module.py b/openpype/modules/default_modules/sync_server/sync_server_module.py
index cd29d93384..500203f3fc 100644
--- a/openpype/modules/default_modules/sync_server/sync_server_module.py
+++ b/openpype/modules/default_modules/sync_server/sync_server_module.py
@@ -1574,6 +1574,7 @@ class SyncServerModule(OpenPypeModule, ITrayModule):
 
             Use 'force' to remove existing or raises ValueError
         """
+        reseted_existing = False
         for repre_file in representation.pop().get("files"):
             if file_id and file_id != repre_file["_id"]:
                 continue
@@ -1584,12 +1585,15 @@ class SyncServerModule(OpenPypeModule, ITrayModule):
                         self._reset_site_for_file(collection, query,
                                                   elem, repre_file["_id"],
                                                   site_name)
-                        return
+                        reseted_existing = True
                     else:
                         msg = "Site {} already present".format(site_name)
                         log.info(msg)
                         raise ValueError(msg)
 
+        if reseted_existing:
+            return
+
         if not file_id:
             update = {
                 "$push": {"files.$[].sites": elem}