FileBasedProject.PublishProject() succeeds but Studio indicates publish failed

We are having intermittent problems using the FIleBasedProject creation API. For some of the created projects we are unable to open in Studio. The error information states:

"The project with ID {0} can not be opened becasue it was not successfully published to the server"

However, the result of the PublishProject() call has a status of PublicationStatus.Published

Why are the projects not openable?

Parents Reply Children
  • I don't have access to the GroupShare server. Working with our internal IT team to review.
  • We see this error repeated several times in the execution log at the time of the inconsistent publish:

    2017-09-07 13:41:49.913#Sdl.StudioServer.Services.ProjectServer.PackagePublisher#Finished package publishing - error.
    System.Data.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---> System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception: The wait operation timed out
    --- End of inner exception stack trace ---
    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
    at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
    at System.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync()
    at System.Data.SqlClient.TdsParserStateObject.TryReadNetworkPacket()
    at System.Data.SqlClient.TdsParserStateObject.TryPrepareBuffer()
    at System.Data.SqlClient.TdsParserStateObject.TryReadByte(Byte& value)
    at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
    at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
    at System.Data.SqlClient.SqlDataReader.get_MetaData()
    at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
    at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
    at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
    at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
    at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
    at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
    at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
    at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
    --- End of inner exception stack trace ---
    at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
    at System.Data.Objects.ObjectContext.CreateFunctionObjectResult[TElement](EntityCommand entityCommand, ReadOnlyMetadataCollection`1 entitySets, EdmType[] edmTypes, MergeOption mergeOption)
    at System.Data.Objects.ObjectContext.ExecuteFunction[TElement](String functionName, MergeOption mergeOption, ObjectParameter[] parameters)
    at Sdl.StudioServer.Services.ProjectServer.PackageEntities.ProjectData.GetPublishedProjectInformation(Nullable`1 userGuid, String projectUniqueIds)
    at Sdl.StudioServer.Services.ProjectServer.ProjectServerManager.GetProjectDetails(Guid projectId)
    at Sdl.ProjectServer.Implementation.ProjectServer.ProjectServerEventPublisher.PublishProjectCreatedEvent(Guid projectId, IDictionary`2 assigneesAfter, List`1 languageFilesForAssiegnees, List`1 languageFileIds)
    at Sdl.StudioServer.Services.ProjectServer.PackagePublisher.Publish(Boolean useAssignment)
  • Found timeouts in the executions log, but I would expect this to fail, not be returned as Published.
  • Some extra information I got from Chris, posting it here so that SDL Dev team can see it too:

    ====================
    We have created a program using the FileBasedProject API to grab 1 or more files to create a project. We have at most 10 parallel processes, segmented by language, processing a single set of files at a time. The above code snippet is the last step in the processing which publishes the project to the server. We have matched log entries to projects failing to open in Studio to see that the status was Published, even though the error indicates the pubish was unsuccesful.

    This program has been running several months since its last modification in both our test and production environments. I don't know how much load testing happened as part of the UAT for the 2017 upgrade. To my knowledge, the problems at this high frequency started as of the upgrade in our production environment. This could have happened before but so seldom it was not noticeable.
    ====================
  • Thanks , this is important because I don't think the filebased API is the way to go for this. Studio was not built for processing multiple projects at the same time. It would be more sensible to use the REST API in GroupShare to support this kind of approach.

    Why is Studio being used for this instead of GroupShare?

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

  • Unknown said:
    It would be more sensible to use the REST API in GroupShare to support this kind of approach.

    Why is Studio being used for this instead of GroupShare?

    It's my understanding that

    a) their application was created to work with GS2015 where REST API wasn't available, I believe

    b) with GS2015 it worked

    So these "it's not designed for this" statements sound rather alibistic than like a real arguments :-\

  • I don't think there is any need for this kind of language Evzen. I don't know what version they are using but most of our GroupShare customers have a support contract so my thought process would be this:

    1. Fact: Studio is not designed to mass handle projects via the API
    2. Fact: our customers were forced to try and use the filebased API in the past for this because there was no alternative
    3. Fact: as a supported customer GS 2017 is freely available to you
    4. Fact: GS 2017 has a much improved REST API that supports the creation of projects and is designed for mass handling of projects
    5. Fact: this customer has already upgraded to 2017 and has tested in UAT for 10 months with low volumes
    6. Fact: the problem they have encountered only started when they went into production

    So in my opinion continuing to try and make something work with a sub optimal solution even if it did work in the past (and I don't know if it did or not) seems a less than satisfactory way to go forward.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

  • Unknown said:
    6. Fact: the problem they have encountered only started when they went into production

    > This program has been running several months since its last modification in both our test and production environments.

    From this I actually understand that the program worked in production as well... against GS2015. The problems started only after upgrade to GS2017.
    That's how I read the story.

    The point I'm trying to make - and I believe it's the original poster's point too - is that there is no reason why things which worked before (although not officially supported... but without real technical reason to not work if known caveats are carefully treated) should not still work.

    Plus, there is another aspect - statements like "you should use new API" are not easily done, especially in production. Such statements are usually made by managers who have no idea about the real world... who believe that Rome can be built by simply sending email, or so :-\

    That's why people naturally start asking why things which worked before suddenly stop working without a reason.

  • Unknown said:
    The point I'm trying to make - and I believe it's the original poster's point too - is that there is no reason why things which worked before (although not officially supported... but without real technical reason to not work if known caveats are carefully treated) should not still work.

    Perhaps you can make your point without being so antagonistic.  You've said before I should not take things personally but it's very difficult sometimes with the comments you make.  You either don't have a very good command of English and use words you don't really understand, or you are just deliberately hostile. I am an optimist so I hope it's not the latter and that you'll improve over time.

    There is a very good reason why things may not work when we move from one version to another.  The file-based solution is not designed to handle heavy volumes with concurrent processing.  It would have been a workaround at best until we provided a similar solution that could be used directly on GroupShare.  Any changes that would impact the performance of project creation in Studio could affect the performance of solutions built around the API.

    Unknown said:
    Plus, there is another aspect - statements like "you should use new API" are not easily done, especially in production.

    Really!!

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

  • Seems like the SQL stored procedure [SDlSystem].[proj].[GetPublishedProjectInformation] is timing out for some reason.
    After a quick look at the SP, I would expect it to take (possibly significantly) longer if a greater number of project is published on the server.
    How many projects do you have on your server?
    Are there possibly any performance issues on the SQL Server?

    PS: Yes, PublicationStatus.Published is odd.