WebDeploy - Error: (build date) An error occurred when the request was processed on the remote computer

just a reminder

rewrite from: https://stackoverflow.com/questions/6939150/web-deployment-task-build-failed via https://asoftwareguy.com/2012/05/03/msdeploy-and-when-it-just-stops-working/

Error: (build date) An error occurred when the request was processed on the remote computer.

Error: Unable to perform the operation. Please contact your server administrator to check authorization and delegation settings.


I encountered the same issue when building via TFS. When I tried to manually import the website I got a more informative error: "not able to log on the user \WDeployConfigWriter".

Turns out that when you install web deploy it sets up two local accounts WDeployConfigWriter and WDeployAdmin. The passwords on these accounts are set to expire. So reset the passwords on the web server and set to "never expire". Then go to Management Service Delegation in IIS. Each of the presented rules has a UserName field. Where it is WDeployAdmin or WDeployConfigWriter right click and update the credentials to the new passwords.

A full explanation with screenshots can be found here: http://workinghardinit.wordpress.com/2011/07/18/wdeployconfigwriter-account-issues-trouble-shooting-web-deploy-2-0-with-lessons-learned/

do not use equal sign in paths in windows or make sure to use dbl quotes...

env: windows 10

so basically, when a path contains an equal sign, for example:

d:\some_folder\=some_other_folder\some_even_deeper_nested_folder\and_so_on

a command like this:

rmdir d:\some_folder\=some_other_folder\some_even_deeper_nested_folder\and_so_on

will be effectively evaluated as:

rmdir d:\some_folder

a fix? appears to be simple (notice the dbl quotes!):

rmdir "d:\some_folder\=some_other_folder\some_even_deeper_nested_folder\and_so_on"

kill pg connection

PostgreSQL 9.2 and above:

SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'TARGET_DB'
  AND pid <> pg_backend_pid();

PostgreSQL 9.1 and below:

SELECT pg_terminate_backend(pg_stat_activity.procpid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'TARGET_DB'
  AND procpid <> pg_backend_pid();

Logging in pgsql

edit postgresql.conf and change the following:

log_statement = 'all'
log_min_duration_statement = 0
logging_collector = on
#log_directory = 'pg_log'

make sure pg_log is available relative to the data dir

restart pgsql service

PostGIS to GeoJSON

SELECT
    row_to_json(feature_collection)
FROM (
    SELECT
        'FeatureCollection'::text as type,
        case
            when
                array_agg(feature_collection_data) is null
            then
                array_to_json(ARRAY[]::varchar[]) 
            else
                array_to_json(array_agg(feature_collection_data))
        end as features
    FROM (
        SELECT
            'Feature'::text as type,
            ST_AsGeoJSON({geomCol})::json as geometry,
            row_to_json((SELECT row FROM (SELECT {properties}) as row)) as properties
        FROM
            {table} as row_data
        WHERE
            {where}
    )  as feature_collection_data
)  as feature_collection;";

Notes:

{geomCol} - geom column to select from or geometry returning call such as ST_GeomFromText('POINT(' || lon || ' ' || lat || ')' ,4326)

{properties} - a comma separated list of columns to select from; can be aliased

{table} - a table to select from

{where} - a where clause if needed