cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

Error: listen EPERM: operation not permitted when starting a Websocket or HTTP Server

Error: listen EPERM: operation not permitted when starting a Websocket or HTTP Server

BenjaminS
New Poster

Hello,

I tried to implement a interface connected to a provider, to create Datalayer Nodes via this interface. Just to give you an example:
I want to send a request to my application, that I need a Datalayer Node named XY with the datatype for example Int32. My app receives the request and creates the specified node for me.

First I tried to implement an HTTP Server to provide a REST interface. After this did not work I tried it with an unix socket, like in the python webserver sample.

In both cases I got the error:
Error: listen EPERM: operation not permitted /var/snap/my-provider/x1/transfer.sok (or in case of HTTP Server instead of the path I got the error with the port I tried to open)

The thing I am confused about is, that the sample projects do work and also work if I modify them, just without the interface.

I am happy about feedback, even though this could be a silly question.

Best regards
Benjamin S.

1 REPLY 1

nickH
Community Moderator
Community Moderator

Hi Benjamin, 

Please keep in mind that snaps by default run in their sandbox. Interfaces allow access to a resource outside of a snap’s confinement. 

You have to configure these interfaces for your application in your snapcraft.yaml. Here you can see a list of interfaces to connect to. You could also look at the snapcraft.yaml (folder: /snap) of the python webserver example and check which interfaces are used here. 

Best regards, 

Nick 

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist