On MAMP I am getting this error.
Notice: Undefined index: rest_server in services_endpoint_callback() (line 196 of /Applications/MAMP/htdocs/service01/sites/all/modules/services/services.module).

In addition, I can not call a service.
I do get this message when I call:
http://service01:8888/testservice01

Services Endpoint "testservice01" has been setup successfully.

but when I try...
http://service01:8888/testservice01/json
I get a 404 JSON service not found.

Comments

rickmanelius’s picture

Same here. The endpoint is setup, and the services_test one works and responds with "CRUD Retrieve test"

But with node or anything else... it's
Notice: Undefined index: rest_server in services_endpoint_callback() (line 196 of services.module).

aaronott’s picture

This error refers to the settings section of the server, in this case the rest_server. Tracing this back I found that the server_settings array was empty even though there are the default check boxes on the settings screen:

stdClass Object
(
    [eid] => 1
    [name] => note
    [server] => rest_server
    [path] => note
    [authentication] => Array
        (
            [services] => services
        )

    [server_settings] => Array
        (
        )

    [resources] => Array
        (
            [event] => Array
                (
                    [operations] => Array
                        (
                            [retrieve] => Array
                                (
                                    [enabled] => 1
                                )

                            [create] => Array
                                (
                                    [enabled] => 1
                                )

                            [update] => Array
                                (
                                    [enabled] => 1
                                )

                        )

                )

        )

    [debug] => 1
    [table] => services_endpoint
    [type] => Normal
    [export_type] => 1
)

I found that when I went back to admin/structure/services/list/event/server and changed the check boxes and clicked save, the settings were available and I wasn't getting this error anymore:

stdClass Object
(
    [eid] => 1
    [name] => note
    [server] => rest_server
    [path] => note
    [authentication] => Array
        (
            [services] => services
        )

    [server_settings] => Array
        (
            [rest_server] => Array
                (
                    [formatters] => Array
                        (
                            [json] => 1
                            [bencode] => 
                            [jsonp] => 
                            [php] => 
                            [rss] => 
                            [xml] => 
                            [yaml] => 
                        )

                    [parsers] => Array
                        (
                            [application/json] => 1
                            [application/vnd.php.serialized] => 
                            [application/x-www-form-urlencoded] => 
                            [application/x-yaml] => 
                            [multipart/form-data] => 
                        )

                )

        )

    [resources] => Array
        (
            [event] => Array
                (
                    [operations] => Array
                        (
                            [retrieve] => Array
                                (
                                    [enabled] => 1
                                )

                            [create] => Array
                                (
                                    [enabled] => 1
                                )

                            [update] => Array
                                (
                                    [enabled] => 1
                                )

                        )

                )

        )

    [debug] => 1
    [table] => services_endpoint
    [type] => Normal
    [export_type] => 1
)
rickmanelius’s picture

I can confirm that the fix in #2 fixes the error.

kylebrowning’s picture

Im not sure, is this a bug?

The one thing I can say is that JSON is not a resource.

http://service01:8888/testservice01/json is an invalid URL.

make sure node resource is enabled and try http://service01:8888/testservice01/node

BarisW’s picture

And if you want JSON output, try http://service01:8888/testservice01/node.json

Re #2: Saving the'SERVER' form solves this bug as well. Maybe the default server settings are incorrect?

batje’s picture

I had this too, but then on ubuntu linux.

Resaving worked, and the special condition i had was that i was using a D7 database that had been upgraded from D6. (i did a drush pm-uninstall services before doing a drush pm-enable services)

franz’s picture

Title: On MAMP, I am getting this error » Service settings not being saved?

I have a similar problem, same error. In my case, however, the resources are missing from the server info array, and they still show up on the 'Resources' tab as checked. I tried saving this page without success:

<?php
stdClass Object
(
    [module] => rest_server
    [endpoint] => derp
    [endpoint_path] => derp
    [debug] => 1
    [settings] => Array
        (
            [formatters] => Array
                (
                    [bencode] => 1
                    [json] => 1
                    [php] => 1
                    [rss] => 1
                    [xml] => 1
                    [yaml] => 1
                    [jsonp] => 
                )

            [parsers] => Array
                (
                    [application/json] => 1
                    [application/vnd.php.serialized] => 1
                    [application/x-yaml] => 1
                    [multipart/form-data] => 1
                    [application/x-www-form-urlencoded] => 
                )

        )

)
?>
franz’s picture

My issue was something else, as I was using the wrong REST method.

ltwinner’s picture

Resaving the settings worked for me too.

ygerasimov’s picture

Status: Active » Fixed

There was a bug fixed in #1436366. Resaving endpoint will fix your settings.

Closing this issue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

liquidcms’s picture

Issue summary: View changes

Unfortunately i can't change status of this.

This is still broken. I cannot make changes (check or uncheck) to Resources. Status suggests saved; but no change shows up after. No errors and nothing in logs. Other forms submit fine.

On linux copy of the site it seems almost random; sometimes saved, sometimes not. On WAMP copy of the site; it never saves.